Examples of ErrorMessage


Examples of org.easymock.internal.ErrorMessage

*/
public class ErrorMessageTest {

    @Test
    public void testGetters() {
        final ErrorMessage m = new ErrorMessage(true, "error", 3);
        assertTrue(m.isMatching());
        assertEquals("error", m.getMessage());
        assertEquals(3, m.getActualCount());
    }
View Full Code Here

Examples of org.eclipse.wst.wsdl.validation.internal.util.ErrorMessage

    String uri = error.getLiteralSystemId();
    if(uri == null)
    {
      uri = error.getPublicId();
    }
    ErrorMessage errorMessage = new ErrorMessage();
    errorMessage.setErrorLine(error.getLineNumber());
    errorMessage.setErrorMessage(error.getMessage());
    errorMessage.setErrorColumn(error.getColumnNumber());
    errorMessage.setURI(uri);
    errorMessage.setSeverity(severity);
    return errorMessage;
  }
View Full Code Here

Examples of org.jdesktop.wonderland.common.messages.ErrorMessage

                    sender.send(clientID, new CellServerComponentResponseMessage(
                                                    message.getMessageID(), state));
                } else {
                    // Otherwise, the component already exists, so send an error
                    // message back to the client.
                    sender.send(clientID, new ErrorMessage(message.getMessageID(),
                               "The Component " + className + " already exists."));
                    return;
                }
            } catch (java.lang.Exception excp) {
                // Rethrow runtime exceptions so we don't mess up Darkstar
                if (excp instanceof RuntimeException) {
                    throw (RuntimeException) excp;
                }

                // Log an error in the log and send back an error message.
                logger.log(Level.WARNING, "Unable to add component " +
                        className + " for cell " + cellMO.getName(), excp);
                sender.send(clientID, new ErrorMessage(message.getMessageID(), excp));
                return;
            }

            // If we made it here, everything worked.  Send the updated server
            // state object to all clients as an asynchronous event
View Full Code Here

Examples of org.jdesktop.wonderland.common.messages.ErrorMessage

                String className = message.getCellComponentServerClassName();
                Class clazz = CellComponentUtils.getLookupClass(Class.forName(className));
                CellComponentMO component = cellMO.getComponent(clazz);
                if (component == null) {
                    logger.warning("Cannot find component for class " + className);
                    sender.send(clientID, new ErrorMessage(message.getMessageID()));
                    return;
                }

                // Remove the component and send a success message back to the
                // client
                cellMO.removeComponent(component);
                sender.send(clientID, new OKMessage(message.getMessageID()));

                // Send the same event message to all clients as an asynchronous
                // event
                cellMO.sendCellMessage(clientID, message);
               
            } catch (java.lang.ClassNotFoundException excp) {
                // Just got an exception and ignore here
                logger.log(Level.WARNING, "Cannot find component class", excp);
                sender.send(clientID, new ErrorMessage(message.getMessageID(), excp));
            }
        }
View Full Code Here

Examples of org.jdesktop.wonderland.common.messages.ErrorMessage

                                Message message)
    {
        if (message instanceof CellHierarchyMessage) {
            messageReceived(sender, clientID, (CellHierarchyMessage) message);
        } else {
            sender.send(clientID, new ErrorMessage(message.getMessageID(),
                        "Unexpected message type: " + message.getClass()));
        }
    }
View Full Code Here

Examples of org.jdesktop.wonderland.common.messages.ErrorMessage

                sender.send(clientID, response);
               
                break;
            default :
                logger.severe("Unexpected message in CellCacheClientHandler "+message.getActionType());
                sender.send(clientID, new ErrorMessage(message.getMessageID(),
                        "Unexpected message in CellCacheClientHandler: " +
                        message.getActionType()));
                break;
        }
    }
View Full Code Here

Examples of org.jdesktop.wonderland.common.messages.ErrorMessage

            logger.fine("Attempting to load cell mo: " + className);
            CellMO cellMO = CellMOFactory.loadCellMO(className);
            if (cellMO == null) {
                /* Log a warning and move onto the next cell */
                logger.warning("Unable to load cell MO: " + className );
                sender.send(clientID, new ErrorMessage(editMessage.getMessageID(),
                        "Unable to load cell MO: " + className));
                return;
            }

            // Find the parent cell (if any)
            CellMO parent = null;
            CellID parentCellID = ((CellCreateMessage)editMessage).getParentCellID();
            if (parentCellID != null) {
                parent = CellManagerMO.getCell(parentCellID);
            }

            /* Call the cell's setup method */
            try {
                cellMO.setServerState(setup);

                if (parent == null) {
                    WonderlandContext.getCellManager().insertCellInWorld(cellMO);
                } else {
                    parent.addChild(cellMO);
                }
                //everything worked okay. send response message
                sender.send(clientID, new CellCreatedMessage(editMessage.getMessageID(), cellMO.getCellID()));

            } catch (ClassCastException cce) {
                logger.log(Level.WARNING, "Error setting up new cell " +
                        cellMO.getName() + " of type " +
                        cellMO.getClass() + ", it does not implement " +
                        "BeanSetupMO.", cce);
                sender.send(clientID,
                        new ErrorMessage(editMessage.getMessageID(),cce));
                return;
            } catch (MultipleParentException excp) {
                logger.log(Level.WARNING, "Error adding new cell " + cellMO.getName()
                        + " of type " + cellMO.getClass() + ", has multiple parents", excp);
                sender.send(clientID,
                        new ErrorMessage(editMessage.getMessageID(), excp));
                return;
            }
        }
        else if (editMessage.getEditType() == EditType.DELETE_CELL) {
            // Find the cell object given the ID of the cell. If the ID is
            // invalid, we just log an error and return.
            CellID cellID = ((CellDeleteMessage)editMessage).getCellID();
            CellMO cellMO = CellManagerMO.getCell(cellID);
            if (cellMO == null) {
                logger.warning("No cell found to delete with cell id " + cellID);
                return;
            }

            // Find out the parent of the cell. This may be null if the cell is
            // at the world root. This determines from where to remove the cell
            CellMO parentMO = cellMO.getParent();
            if (parentMO != null) {
                parentMO.removeChild(cellMO);
            }
            else {
                CellManagerMO.getCellManager().removeCellFromWorld(cellMO);
            }
        }
        else if (editMessage.getEditType() == EditType.DUPLICATE_CELL) {
            // Find the cell object given the ID of the cell. If the ID is
            // invalid, we just log an error and return.
            CellID cellID = ((CellDuplicateMessage)editMessage).getCellID();
            CellMO cellMO = CellManagerMO.getCell(cellID);
            if (cellMO == null) {
                logger.warning("No cell found to duplicate with cell id " + cellID);
                sender.send(clientID, new ErrorMessage(editMessage.getMessageID(),
                        "No cell found to duplicate with cell id " + cellID));
                return;
            }
            CellMO parentCellMO = cellMO.getParent();

            // We need to fetch the current state of the cell from the cell we
            // wish to duplicate. We also need the name of the server-side cell
            // class
            CellServerState state = cellMO.getServerState(null);
            String className = state.getServerClassName();

            // Attempt to create the cell using the cell factory and the class
            // name of the server-side cell.
            CellMO newCellMO = CellMOFactory.loadCellMO(className);
            if (newCellMO == null) {
                /* Log a warning and move onto the next cell */
                logger.warning("Unable to duplicate cell MO: " + className);
                sender.send(clientID, new ErrorMessage(editMessage.getMessageID(),
                        "Unable to duplicate cell MO: " + className));
                return;
            }

            // We want to modify the position of the new cell slight, so we
            // offset the position by (1, 1, 1).
            PositionComponentServerState position = (PositionComponentServerState)state.getComponentServerState(PositionComponentServerState.class);
            if (position == null) {
                logger.warning("Unable to determine the position of the cell " +
                        "to duplicate with id " + cellID);
                sender.send(clientID, new ErrorMessage(editMessage.getMessageID(),
                        "Unable to determine the position of the cell " +
                        "to duplicate with id " + cellID));
                return;
            }
            Vector3f offset = new Vector3f(1, 0, 1);
            Vector3f origin = position.getTranslation();
            position.setTranslation(offset.add(origin));
            state.addComponentServerState(position);

            // Set the desired name of the cell contained within the message
            state.setName(((CellDuplicateMessage)editMessage).getCellName());
           
            // Set the state of the new cell and add it to the same parent as
            // the old cell. If the old parent cell is null, we just insert it
            // as root.
            newCellMO.setServerState(state);
            try {
                if (parentCellMO == null) {
                    WonderlandContext.getCellManager().insertCellInWorld(newCellMO);
                }
                else {
                    parentCellMO.addChild(newCellMO);
                }
                sender.send(clientID, new CellCreatedMessage(editMessage.getMessageID(), newCellMO.getCellID()));
            } catch (MultipleParentException excp) {
                logger.log(Level.WARNING, "Error duplicating cell " +
                        newCellMO.getName() + " of type " + newCellMO.getClass() +
                        ", has multiple parents", excp);
                sender.send(clientID, new ErrorMessage(editMessage.getMessageID(),
                        excp));
                return;
            }
        }
        else if (editMessage.getEditType() == EditType.REPARENT_CELL) {
View Full Code Here

Examples of org.jdesktop.wonderland.common.messages.ErrorMessage

        } else if (message instanceof TakeControlRequestMessage) {
            response = handleTakeControl(sender, clientID, message);
        } else {
            logger.warning("Unrecognized message type: " + message.getClass() +
                           " from " + clientID);
            response = new ErrorMessage(message.getMessageID(),
                                        "Unrecognized message type: " +
                                        message.getClass());
        }

        // send a response back to the requester
View Full Code Here

Examples of org.jdesktop.wonderland.common.messages.ErrorMessage

                                Message message)
    {
        if (message instanceof CellMessage) {
            messageReceived(sender, clientID, (CellMessage) message);
        } else {
            Message error = new ErrorMessage(message.getMessageID(),
                    "Unexpected message type: " + message.getClass());

            sender.send(clientID, error);
        }
    }
View Full Code Here

Examples of org.jdesktop.wonderland.common.messages.ErrorMessage

        // find the appropriate cell
        CellMO cell = CellManagerMO.getCell(message.getCellID());

        // if there was no cell, handle the error
        if (cell == null) {
            sender.send(clientID, new ErrorMessage(message.getMessageID(),
                    "Unknown cell id: " + message.getCellID()));
            return;
        }
        ChannelComponentMO channelComponent = cell.getComponent(ChannelComponentMO.class);

        if (channelComponent == null) {
            sender.send(clientID, new ErrorMessage(message.getMessageID(),
                    "Cell does not have a ChannelComponent id: " + message.getCellID()));
            return;

        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.