Package org.jdesktop.wonderland.server.cell

Examples of org.jdesktop.wonderland.server.cell.CellMO


            return children;
        }

        public void run() throws Exception {
            // resolve the cell ID into a cell
            CellMO cell = CellManagerMO.getCell(cellID);
            if (cell == null) {
                throw new IllegalArgumentException("No such cell " + cellID);
            }
           
            // now create a cell descriptor for the cell
            out = CellExporterUtils.getCellDescriptor(root, parentPath, cell, recordCellIDs);

            // if the output is null, it means the cell doesn't implement
            // the getCellServerState() method.  That's fine, just ignore any
            // children
            if (out != null) {
                // finally, get the list of all the cell's children
                // XXX TODO: can we do this without dereferencing each child? XXX
                for (ManagedReference<CellMO> childRef : cell.getAllChildrenRefs()) {
                    children.add(childRef.get().getCellID());
                }
            }
        }
View Full Code Here


            /*
             * 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.
             */
 
View Full Code Here

    @Override
    protected void setLive(boolean live) {
        super.setLive(live);

        CellMO cell = cellRef.getForUpdate();
        ChannelComponentMO channel = channelRef.getForUpdate();

        if (live) {
            channel.addMessageReceiver(PermissionsRequestMessage.class,
                                       new MessageReceiver(cell, this));
View Full Code Here

            return rsrc;
        }

        // if we didn't find the resource in the cache anywhere, recreate
        // it from the cell.
        CellMO cell = CellManagerMO.getCell(cellID);
        if (cell == null) {
            return null;
        }

        // find this cell's parent
        CellID parentID = null;
        if (cell.getParent() != null) {
            parentID = cell.getParent().getCellID();
        }

        // collect all the actions associated with this cell and its
        // components
        Set<Action> allActions = findActions(cell);

        // get the security compnent from the cell
        SecurityComponentMO sc = cell.getComponent(SecurityComponentMO.class);
        if (sc == null || !sc.isOwned()) {
            if (logger.isLoggable(Level.FINE)) {
                logger.log(Level.FINE, "No security component for cell " +
                           cellID);
            }
View Full Code Here

    private void handleTransformRequest(WonderlandClientSender sender,
      WonderlandClientID clientID, CellTransformRequestMessage message)
    {
        CellID cellID = ((CellTransformRequestMessage) message).getRequestCellID();
        CellMO cell = CellManagerMO.getCell(cellID);
        if (cell == null || !cell.isLive()) {
            sender.send(clientID, new ErrorMessage(message.getMessageID(),
                        "Cell " + cellID + " not found"));
        } else {
            sender.send(clientID,
                    new CellTransformResponseMessage(
                        message.getMessageID(), cell.getWorldTransform(null)));
        }
    }
View Full Code Here

    private static final String JOIN_SOUND = "joinBELL.au";

    private void placeCall(WonderlandClientID clientID, PlaceCallRequestMessage msg) {
        PresenceInfo info = msg.getPresenceInfo();

        CellMO cellMO = CellManagerMO.getCellManager().getCell(info.getCellID());

        AudioParticipantComponentMO audioParticipantComponentMO =
                cellMO.getComponent(AudioParticipantComponentMO.class);

        if (audioParticipantComponentMO == null) {
            logger.warning("Cell " + cellMO.getCellID() + " doesn't have an AudioParticipantComponent!");
            return;
        }

        CallSetup setup = new CallSetup();
View Full Code Here

  cellID = cellMO.getCellID();
    }

    private String getCallID(CellID viewCellID) {
  CellMO viewCellMO = CellManagerMO.getCell(viewCellID);

  if (viewCellMO instanceof OrbCellMO) {
      return ((OrbCellMO) viewCellMO).getCallID();
  }
View Full Code Here

     
  if (extent == 0) {
      extent = cellRadius;
  }

  CellMO cellMO = cellRef.get();

  BoundingVolume bounds = cellMO.getWorldBounds();

  if (useCellBounds) {
      audioBounds = bounds;

      if (bounds instanceof BoundingBox) {
View Full Code Here

    }

    private void cleanup() {
  treatmentCreated = false;

  CellMO parent = cellRef.get();

  while (parent != null) {
            ConeOfSilenceComponentMO coneOfSilenceComponentMO =
          parent.getComponent(ConeOfSilenceComponentMO.class);

      if (coneOfSilenceComponentMO != null) {
          coneOfSilenceComponentMO.removeAudioTreatmentComponentMO(cellRef.get(), this);
    break;
      }

      parent = parent.getParent();
  }

        VoiceManager vm = AppContext.getManager(VoiceManager.class);

        TreatmentGroup group = null;
View Full Code Here

  checkForParentWithCOS(cellMO, this);
    }

    private static void checkForParentWithCOS(CellMO cellMO, AudioTreatmentComponentMO audioTreatmentComponentMO) {
  CellMO child = cellMO;

  while (cellMO != null) {
            ConeOfSilenceComponentMO coneOfSilenceComponentMO =
          cellMO.getComponent(ConeOfSilenceComponentMO.class);
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.server.cell.CellMO

Copyright © 2018 www.massapicom. 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.