Package com.sun.sgs.app

Examples of com.sun.sgs.app.DataManager


     */
    public void removingObject() {
        clear();

        // Remove the ManagedSerializable objects as well
        DataManager dm = AppContext.getDataManager();
        dm.removeObject(backingMap);
        dm.removeObject(headElement.get());
        dm.removeObject(headCounter.get());
        dm.removeObject(tailElement.get());
        dm.removeObject(tailCounter.get());
    }
View Full Code Here


                }
            }
        }

        Map<CellID, Integer> getIndexMap() {
            DataManager dm = AppContext.getDataManager();
            try {
                return (Map<CellID, Integer>) dm.getBinding(BINDING_NAME + id);
            } catch (NameNotBoundException nnbe) {
                logger.warning("No binding for " + id);
                return Collections.emptyMap();
            }
        }
View Full Code Here

        }

        public void viewEnterExit(boolean entered, CellID cell, CellID viewCellID,
                                  BoundingVolume proximityVolume, int proximityIndex)
        {
            DataManager dm = AppContext.getDataManager();

            try {
                ProximityListenerSrv listener = (ProximityListenerSrv)
                        dm.getBinding(BINDING_NAME + id);
                listener.viewEnterExit(entered, cell, viewCellID,
                                                proximityVolume, proximityIndex);
            } catch (ObjectNotFoundException onfe) {
                LOGGER.warning("[ManagedProximityListenerWrapper] Object " +
                               id + " not found");
View Full Code Here

        ChannelManager cm = AppContext.getChannelManager();
        Channel cellChannel = cm.createChannel("Cell "+cell.getCellID().toString(),
                                               null,
                                               Delivery.RELIABLE);

        DataManager dm = AppContext.getDataManager();
        cellChannelRef = dm.createReference(cellChannel);

        // cache the sender for sending to cell clients.  This saves a
        // Darkstar lookup for every cell we want to send to.
        cellSender = WonderlandContext.getCommsManager().getSender(CellChannelConnectionType.CLIENT_TYPE);
    }
View Full Code Here

    /**
     * Close the channel for this component.
     */
    protected void closeChannel() {
        DataManager dm = AppContext.getDataManager();
        Channel channel = cellChannelRef.get();
        dm.removeObject(channel);

        cellSender=null;
        cellChannelRef = null;
    }
View Full Code Here

      assert (e != null);

      ListNode<E> n = new ListNode<E>(this, bucketSize, e);
      size = n.size();
      childrenCount = 1;
      DataManager dm = AppContext.getDataManager();
      childRef = dm.createReference((Node<E>) n);
      parentRef = createReferenceIfNecessary(parent);
  }
View Full Code Here

  TreeNode(ScalableList<E> list, TreeNode<E> parent, boolean isSplit) {
      this(list);

      if (!isSplit) {
    ListNode<E> n = new ListNode<E>(this, bucketSize);
    DataManager dm = AppContext.getDataManager();
    size = n.size();
    childRef = dm.createReference((Node<E>) n);
      } else {
    size = 0;
    childRef = null;
      }
      parentRef = createReferenceIfNecessary(parent);
View Full Code Here

   *
   * @param root the root node of the entire tree structure
   */
  AsynchronousClearTask(ScalableList<E> list) {
      assert (list != null);
      DataManager dm = AppContext.getDataManager();
      current = dm.createReference(list.getHead());
  }
View Full Code Here

  /**
   * The entry point of the task to perform the clear.
   */
  public void run() {
      // Perform some work and check if we need to reschedule
      DataManager dm = AppContext.getDataManager();
      dm.markForUpdate(this);

      if (doWork()) {
    AppContext.getTaskManager().scheduleTask(this);
      } else {
    dm.removeObject(this);

    Runnable r = noteDoneRemoving;
    if (r != null) {
        r.run();
    }
View Full Code Here

    /**
     * Create an environment cell using the default creator.
     * @param creator the cell creator
     */
    protected EnvironmentCellMO createEnvironmentCell() {
        DataManager dm = AppContext.getDataManager();
        EnvironmentCellCreator creator =
                (EnvironmentCellCreator) dm.getBinding(ENV_CREATOR_BINDING_NAME);
        EnvironmentCellMO env = creator.createEnvironmentCell();
       
        try {
            insertCellInWorld(env);
        } catch (MultipleParentException mpe) {
View Full Code Here

TOP

Related Classes of com.sun.sgs.app.DataManager

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.