Package com.sun.sgs.impl.util

Examples of com.sun.sgs.impl.util.AbstractKernelRunnable


      }
  }

  if (sessionRefId != null && isTerminating()) {
      scheduleTask(
        new AbstractKernelRunnable("NotifyListenerAndRemoveSession") {
          public void run() {
        ClientSessionImpl sessionImpl =
      ClientSessionImpl.getSession(dataService, sessionRefId);
        sessionImpl.notifyListenerAndRemoveSession(
      dataService, graceful, true);
    }
      });
      // TBD: Due to the scheduler's behavior, this notification
      // may happen out of order with respect to the
      // 'notifyLoggedIn' callback.  Also, this notification may
      // also happen even though 'notifyLoggedIn' was not invoked.
      // Are these behaviors okay?  -- ann (3/19/07)
      scheduleTask(new AbstractKernelRunnable("NotifyLoggedOut") {
        public void run() {
      identity.notifyLoggedOut();
        } });
  }
    }
View Full Code Here


            if (state != State.DISCONNECTED) {
                state = State.DISCONNECTING;
      }
        }
  scheduleNonTransactionalTask(
    new AbstractKernelRunnable("HandleDisconnect") {
      public void run() {
    handleDisconnect(graceful, closeConnection);
      } });
    }
View Full Code Here

     */
    private void enqueueCompletionNotification(
  final RequestCompletionFuture future)
    {
  taskQueue.addTask(
      new AbstractKernelRunnable("ScheduleCompletionNotification") {
    public void run() {
        future.done();
    } }, identity);
    }
View Full Code Here

      if (loggingIn) {
    scheduleTask(new LoginTask());
      } else {
    try {
        sessionService.runTransactionalTask(
       new AbstractKernelRunnable("SetSessionRelocated") {
          public void run() {
        ClientSessionImpl sessionImpl =
            ClientSessionImpl.getSession(
                 dataService, sessionRefId);
        sessionImpl.relocationComplete();
          } }, identity);
        setupSuccess();
    } catch (Exception e) {
        logger.logThrow(
            Level.WARNING, e,
      "Relocating ClientSession for identity:{0} " +
      "to local node:{1} throws",
      identity, sessionService.getLocalNodeId());
        notifySetupFailureAndDisconnect(
      new RelocateFailureException(
          RELOCATE_REFUSED_REASON, e));
        return;
    }
      }
     
  } else {
      /*
       * Redirect login to assigned (non-local) node.
       */
      if (logger.isLoggable(Level.FINE)) {
    logger.log(
        Level.FINE,
        "redirecting login for identity:{0} " +
        "from nodeId:{1} to node:{2}",
        identity, sessionService.getLocalNodeId(), assignedNodeId);
      }

      final long nodeId = assignedNodeId;
      scheduleNonTransactionalTask(
          new AbstractKernelRunnable("SendLoginRedirectMessage") {
        public void run() {
      try {
                            try {
                                loginRedirect(nodeId);
                            } catch (Exception ex) {
View Full Code Here

      localNodeId = dataService.getLocalNodeId();
      watchdogService.addRecoveryListener(
    new ClientSessionServiceRecoveryListener());
     
      transactionScheduler.runTask(
    new AbstractKernelRunnable("CheckServiceVersion") {
        public void run() {
      checkServiceVersion(
          VERSION_KEY, MAJOR_VERSION, MINOR_VERSION);
        } },  taskOwner);
     
      /* Store the ClientSessionServer proxy in the data store. */
      transactionScheduler.runTask(
    new AbstractKernelRunnable("StoreClientSessionServiceProxy") {
        public void run() {
      // TBD: this could use a BindingKeyedMap.
      dataService.setServiceBinding(
          getClientSessionServerKey(localNodeId),
          new ManagedSerializable<ClientSessionServer>(
View Full Code Here

      }
      throw e;
  }
 
  transactionScheduler.runTask(
            new AbstractKernelRunnable("AddProtocolDescriptorMapping") {
    public void run() {
        getProtocolDescriptorsMap().
      put(localNodeId,
          Collections.singleton(
        protocolAcceptor.getDescriptor()));
View Full Code Here

        if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.FINE, "Reporting change in health to " + health);
        }
        taskScheduler.scheduleTask(
            new AbstractKernelRunnable("ReportHealth") {
                public void run() {
                   watchdogService.reportHealth(health, CLASSNAME);
                }
            }, taskOwner);
    }
View Full Code Here

      if (taskQueue == null) {
    taskQueue = newTaskQueue;
      }
  }
  taskQueue.addTask(
      new AbstractKernelRunnable("ServiceEventQueue") {
    public void run() {
        if (getHandler(sessionRefId) != null) {
      ClientSessionImpl.serviceEventQueue(sessionId);
        }
    } }, taskOwner);
View Full Code Here

      handler.completed();
      return;
        }
         
        transactionScheduler.scheduleTask(
          new AbstractKernelRunnable("AddMoveEvent") {
      public void run() {
          ClientSessionImpl session =
        ClientSessionImpl.getSession(
            dataService, sessionHandler.sessionRefId);
          if (session != null) {
View Full Code Here

      msgTimestamps[i] = memberInfo.msgTimestamp;
      i++;
        }
    }
    taskScheduler.scheduleTask(
        new AbstractKernelRunnable("relocateMemberships") {
      public void run() {
          runIoTask(new IoRunnable() {
              public void run() throws IOException {
            getChannelServer(newNodeId).
          relocateChannelMemberships(
View Full Code Here

TOP

Related Classes of com.sun.sgs.impl.util.AbstractKernelRunnable

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.