Examples of CellServerState


Examples of org.jdesktop.wonderland.common.cell.state.CellServerState

        // Get the cell server state, injecting the content URI into it via
        // the properties
        Properties props = new Properties();
        props.put("content-uri", uri);
        CellServerState state = factory.getDefaultCellServerState(props);

        // Create the new cell at a distance away from the avatar
        try {
            // OWL issue #224: api update
            CellUtils.createCell(state);
View Full Code Here

Examples of org.jdesktop.wonderland.common.cell.state.CellServerState

            // If we want to query the cell setup for the given cell ID, first
            // fetch the cell and ask it for its cell setup class. We also
            // want to catch any exception to make sure we send back a
            // response
            CellMO cellMO = getCell();
            CellServerState cellSetup = cellMO.getServerState(null);

            // Formulate a response message, fill in the cell setup, and return
            // to the client.
            MessageID messageID = message.getMessageID();
            CellServerStateResponseMessage response = new CellServerStateResponseMessage(messageID, cellSetup);
View Full Code Here

Examples of org.jdesktop.wonderland.common.cell.state.CellServerState

            return null;
        }

        String cellID = cellMO.getCellID().toString();
        String cellName = cellMO.getName();
        CellServerState setup = cellMO.getServerState(null);
        if (setup == null) {
            return null;
        }

        // Now take out any component state that shouldn't be snapshotted
        if (!recordCellIDs) {
            // get the list of all server states
            CellComponentServerState[] ccsss =
                    setup.getComponentServerStates().values().toArray(new CellComponentServerState[0]);

            // check for snapshot annotations on the corresponding class
            for (CellComponentServerState ccss : ccsss) {
                if (ccss != null && hasNoSnapshotAnnotation(ccss)) {
                    logger.info("Remove component of type " +
                                ccss.getServerComponentClassName() +
                                " due to @NoSnapshot annotation");

                    setup.removeComponentServerState(ccss.getClass());
                }
            }
        }

        // If required, put the cellID of the cell in its metadata
        // Required by event recorder
        if (recordCellIDs) {
            setup.getMetaData().put("CellID", cellID.toString());
        }

        // Create the descriptor for the cell using the world root, path of the
        // parent, name of the cell and setup information we obtained from the
        // cell
View Full Code Here

Examples of org.jdesktop.wonderland.common.cell.state.CellServerState

                                           WonderlandClientID clientID,
                                           CellServerStateSetMessage message)
        {
            // Fetch the cell, and set its server state. Catch all exceptions
            // and report.
            CellServerState state = message.getCellServerState();
            CellMO cellMO = getCell();
            cellMO.setServerState(state);

            // Notify the sender that things went OK
            sender.send(clientID, new OKMessage(message.getMessageID()));
View Full Code Here

Examples of org.jdesktop.wonderland.common.cell.state.CellServerState

            // Fetch the cell, and set its server state. Catch all exceptions
            // and report. This assumes that all components have been removed
            // from the server state object, since they are handled separately
            // below. The client needs to remove the component state objects
            // to save network bandwidth in the message size.
            CellServerState state = message.getCellServerState();
            if (state != null) {
                cellMO.setServerState(state);
            }

            // Fetch the set of cell component server states. For each, update
View Full Code Here

Examples of org.jdesktop.wonderland.common.cell.state.CellServerState

           
            /*
             * Download and parse the cell configuration information. Create a
             * new cell based upon the information.
             */
            CellServerState setup = CellImporterUtils.getWFSCell(root, relativePath, child.name);
            if (setup == null) {
                logger.info("WFSLoader: unable to read cell setup info " + relativePath + "/" + child.name);
                continue;
            }
            logger.info(setup.toString());
           
            /*
             * If the cell is at the root, then the relative path will be "/"
             * and we do not want to prepend it to the cell path.
             */
            String cellPath = relativePath + "/" + child.name;
            if (relativePath.compareTo("") == 0) {
                cellPath = child.name;
            }

            /*
             * Create the cell and pass it the setup information
             */
            String className = setup.getServerClassName();
            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);
                continue;
            }

            /* Set the cell name */
//            cellMO.setName(child.name);

            /** XXX TODO: add an import details cell component XXX */

            /* Call the cell's setup method */
            try {
                cellMO.setServerState(setup);
            } catch (ClassCastException cce) {
                logger.log(Level.WARNING, "Error setting up new cell " +
                        cellMO.getName() + " of type " +
                        cellMO.getClass(), cce);
                continue;
            }
           
            /*
             * Add the child to the cell hierarchy. If the cell has no parent,
             * then we insert it directly into the world
             */
            try {
                if (parentRef == null) {
                    WonderlandContext.getCellManager().insertCellInWorld(cellMO);
                }
                else {
                    logger.info("WFSLoader: Adding child (ID=" + cellMO.getCellID().toString() +
                            ") to parent (ID=" + parentRef.get().getCellID().toString() + ")");
                    parentRef.get().addChild(cellMO);
                    logger.info("WFSLoader: Parent Cell ID=" + cellMO.getParent().getCellID().toString());
                    Collection<ManagedReference<CellMO>> refs = cellMO.getParent().getAllChildrenRefs();
                    Iterator<ManagedReference<CellMO>> it = refs.iterator();
                    while (it.hasNext() == true) {
                        logger.info("WFSLoader: Child Cell=" + it.next().get().getCellID().toString());
                    }
                    logger.info("WFSLoader: Cell Live: " + cellMO.isLive());
                }
            } catch (MultipleParentException excp) {
                logger.log(Level.WARNING, "Attempting to add a new cell with " +
                        "multiple parents: " + cellMO.getName());
                continue;
            }
           
            /*
             * Since we are loading cells for the first time, we put the cell
             * in both the cell object and last modified reference map. We
             * add the cell to its parent. If the parent is null, we add to the
             * root.
             */
            ManagedReference<CellMO> cellRef = AppContext.getDataManager().createReference(cellMO);
            this.cellMOMap.put(cellPath, cellRef);
            logger.info("WFSLoader: putting " + cellPath + " (ID=" + cellMO.getCellID().toString() + ") into map with " + child.lastModified);
            logger.info(setup.toString());
           
            /*
             * See if the cell has any children and add to the linked list.
             */
            CellList newChildren = CellImporterUtils.getWFSChildren(root, cellPath);
View Full Code Here

Examples of org.jdesktop.wonderland.common.cell.state.CellServerState

                CellComponentRegistry.getCellComponentRegistry();
        Set<CellComponentFactorySPI> factories = registry.getAllCellFactories();

        // Fetch the set of component property display names that are already
        // on the set and remove from the list of factories.
        CellServerState state = editframe.getCellServerState();
        Iterator<CellComponentFactorySPI> it = factories.iterator();
        while (it.hasNext() == true) {
            CellComponentFactorySPI spi = it.next();
            Class clazz = spi.getDefaultCellComponentServerState().getClass();
            if (state.getComponentServerState(clazz) != null) {
                it.remove();
            }
        }

        // Put all of the factories into a list and sort based upon the display
View Full Code Here

Examples of org.jdesktop.wonderland.common.cell.state.CellServerState

    /**
     * @inheritDoc()
     */
    public void open() {
        CellServerState state = editor.getCellServerState();
        CellComponentServerState compState = state.getComponentServerState(
                JmeColladaCellComponentServerState.class);
        if (state != null) {
            originalInfo =
                    ((JmeColladaCellComponentServerState) compState).getModel();
            urlTF.setText(originalInfo);
View Full Code Here

Examples of org.jdesktop.wonderland.common.cell.state.CellServerState

    /**
     * @inheritDoc()
     */
    public void apply() {
        // Fetch the latest from the info text field and set it.
        CellServerState state = editor.getCellServerState();
        CellComponentServerState compState = state.getComponentServerState(
                JmeColladaCellComponentServerState.class);
        // Model is read only
//        ((JmeColladaCellComponentServerState)compState).setModel(urlTF.getText());
        editor.addToUpdateList(compState);
    }
View Full Code Here

Examples of org.jdesktop.wonderland.common.cell.state.CellServerState

    /**
     * @inheritDoc()
     */
    public void open() {
        CellServerState cellServerState = editor.getCellServerState();
    }
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.