Examples of DataService


Examples of com.sun.sgs.service.DataService

      lastKey = nodePrefix;
  }

  /** {@inheritDoc} */
  public void run() {
      DataService dataService =
    ClientSessionServiceImpl.getDataService();
      String key = dataService.nextServiceBoundName(lastKey);
      if (key != null && key.startsWith(nodePrefix)) {
    TaskService taskService =
        ClientSessionServiceImpl.getTaskService();
    taskService.scheduleTask(
        new CleanupDisconnectedSessionTask(key));
View Full Code Here

Examples of com.sun.sgs.service.DataService

      super(null);
  }

  /** {@inheritDoc} */
  public void run() {
      DataService dataService = txnProxy.getService(DataService.class);
      State state;
      try {
    state = (State) dataService.getServiceBinding(name);
      } catch (NameNotBoundException e) {
    state = new State(0);
    dataService.setServiceBinding(name, state);
      }
      dataService.markForUpdate(state);
      firstId = state.lastId + 1;
      lastId = state.reserve(blockSize);
  }
View Full Code Here

Examples of com.sun.sgs.service.DataService

      this.key = key;
  }

  /** {@inheritDoc} */
  public void run() {
      DataService dataService =
    ClientSessionServiceImpl.getDataService();
      ClientSessionImpl sessionImpl =
    (ClientSessionImpl) dataService.getServiceBinding(key);
      sessionImpl.notifyListenerAndRemoveSession(
    dataService, false, true);
  }
View Full Code Here

Examples of com.sun.sgs.service.DataService

                    "unable to convert version:" + oldVersion +
                    " to current version:" + currentVersion);
    }

    public WonderlandClientID getClientID(BigInteger sessionID) {
  DataService ds = txnProxy.getService(DataService.class);

  ManagedReference<ClientSession> sessionRef;

  try {
      sessionRef = (ManagedReference<ClientSession>)
          ds.createReferenceForId(sessionID);
  } catch (ObjectNotFoundException e) {
            logger.log(Level.WARNING, e.getMessage());
      return null;
  }
View Full Code Here

Examples of com.sun.sgs.service.DataService

     * within a transaction.
     */
    private static Map<Long, Set<ProtocolDescriptor>>
  getProtocolDescriptorsMap()
    {
  DataService dataService = getDataService();
  Map<Long, Set<ProtocolDescriptor>> protocolDescriptorsMap;
  try {
      protocolDescriptorsMap = Objects.uncheckedCast(
    dataService.getServiceBinding(PROTOCOL_DESCRIPTORS_MAP_KEY));
  } catch (NameNotBoundException e) {
      protocolDescriptorsMap =
    new ScalableHashMap<Long, Set<ProtocolDescriptor>>();
      dataService.setServiceBinding(PROTOCOL_DESCRIPTORS_MAP_KEY,
            protocolDescriptorsMap);
  }
  return protocolDescriptorsMap;
    }
View Full Code Here

Examples of com.sun.sgs.service.DataService

   
    /** {@inheritDoc} */
    @SuppressWarnings("unchecked")
    public V remove(Object key) {
  checkKey("key", key);
  DataService dataService = BindingKeyedCollectionsImpl.getDataService();
  String bindingName = getBindingName((String) key);
  V value = null;
  try {
      ManagedObject v = dataService.getServiceBinding(bindingName);
      if (v instanceof Wrapper) {
    value = (V) ((Wrapper) v).get();
    dataService.removeObject(v);
      } else {
    value = (V) v;
      }
      dataService.removeServiceBinding(bindingName);
  } catch (NameNotBoundException e) {
  }
  return value;
    }
View Full Code Here

Examples of com.sun.sgs.service.DataService

     * @param  keyPrefix a key prefix
     * @returns  {@code true} if the {@code keyPrefix} corresponds to an
     *    empty map
     */
    private static boolean isEmptyInternal(String keyPrefix) {
  DataService dataService = BindingKeyedCollectionsImpl.getDataService();
  String key = dataService.nextServiceBoundName(keyPrefix);
  return key == null || !key.startsWith(keyPrefix);
    }
View Full Code Here

Examples of com.sun.sgs.service.DataService

    /**
     * Returns {@code true} if a service binding with the specified
     * {@code bindingName} exists.
     */
    private static boolean containsKeyInternal(String bindingName) {
  DataService dataService = BindingKeyedCollectionsImpl.getDataService();
  boolean containsKey = false;
  try {
      dataService.getServiceBinding(bindingName);
      containsKey = true;
  } catch (NameNotBoundException e) {
  } catch (ObjectNotFoundException e) {
      containsKey = true;
  }
View Full Code Here

Examples of com.sun.sgs.service.DataService

     * {@code false}.
     */
    private static boolean removeOverrideInternal(String bindingName) {
  boolean previouslyMapped = containsKeyInternal(bindingName);
  if (previouslyMapped) {
      DataService dataService =
    BindingKeyedCollectionsImpl.getDataService();
      try {
    removeValue(bindingName);
      } catch (ObjectNotFoundException ignore) {
      }
      dataService.removeServiceBinding(bindingName);
  }
  return previouslyMapped;
    }
View Full Code Here

Examples of com.sun.sgs.service.DataService

     * @throws  NameNotBoundException if the service binding does not exist
     * @throws  ObjectNotFoundException if the value associated with the
     *    specified {@code bindingName} has been removed
     */
    private static void removeValue(String bindingName) {
  DataService dataService =
      BindingKeyedCollectionsImpl.getDataService();
  ManagedObject v = dataService.getServiceBinding(bindingName);
  if (v instanceof Wrapper) {
      dataService.removeObject(v);
  }
    }
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.