Package com.sun.sgs.service

Examples of com.sun.sgs.service.TaskService


  implements RecoveryListener
    {
  /** {@inheritDoc} */
  public void recover(Node node, SimpleCompletionHandler handler) {
      final long nodeId = node.getId();
      final TaskService taskService = getTaskService();
      try {
    if (logger.isLoggable(Level.INFO)) {
        logger.log(Level.INFO, "Node:{0} recovering for node:{1}",
             localNodeId, nodeId);
    }

    /*
     * Schedule persistent tasks to perform recovery.
     */
    transactionScheduler.runTask(
        new AbstractKernelRunnable("ScheduleRecoveryTasks") {
      public void run() {
          /*
           * Reassign each failed coordinator to a new node.
           */
          taskService.scheduleTask(
        new ChannelImpl.ReassignCoordinatorsTask(
            nodeId));
          /*
           * Remove binding to channel server proxy for
           * failed node, and remove proxy's wrapper.
           */
          taskService.scheduleTask(
        new RemoveChannelServerProxyTask(nodeId));
      }
        },
        taskOwner);
   
View Full Code Here


                return;
            }

      final long nodeId = node.getId();
      channelServerCache.remove(nodeId);
      final TaskService taskService = getTaskService();
      try {
    if (logger.isLoggable(Level.INFO)) {
        logger.log(Level.INFO,
             "Node:{0} handling nodeFailed:{1}",
             localNodeId, nodeId);
    }

    /*
     * Schedule persistent task to remove the failed server's node
     * ID from locally coordinated channels.
     */
    transactionScheduler.runTask(
        new AbstractKernelRunnable(
      "ScheduleRemoveFailedNodeFromLocalChannelsTask")
        {
      public void run() {
          taskService.scheduleTask(
        new ChannelImpl.
            RemoveFailedNodeFromLocalChannelsTask(
          localNodeId, nodeId));
      }
        }, taskOwner);
View Full Code Here

      DataService dataService =
    ClientSessionServiceImpl.getInstance().getDataService();
      // TBD: this could use a BindingKeyedMap.
      String key = dataService.nextServiceBoundName(lastKey);
      if (key != null && key.startsWith(nodePrefix)) {
    TaskService taskService =
        ClientSessionServiceImpl.getTaskService();
    taskService.scheduleTask(
        new CleanupDisconnectedSessionTask(key));
    lastKey = key;
    taskService.scheduleTask(this);
      }
  }
View Full Code Here

  implements RecoveryListener
    {
  /** {@inheritDoc} */
  public void recover(Node node, SimpleCompletionHandler handler) {
      final long nodeId = node.getId();
      final TaskService taskService = getTaskService();
      try {
    if (logger.isLoggable(Level.INFO)) {
        logger.log(Level.INFO, "Node:{0} recovering for node:{1}",
             localNodeId, nodeId);
    }

    /*
     * Schedule persistent tasks to perform recovery.
     */
    transactionScheduler.runTask(
        new AbstractKernelRunnable("ScheduleRecoveryTasks") {
      public void run() {
          /*
           * Reassign each failed coordinator to a new node.
           */
          taskService.scheduleTask(
        new ChannelImpl.ReassignCoordinatorsTask(
            nodeId));
          /*
           * Remove binding to channel server proxy for
           * failed node, and remove proxy's wrapper.
           */
          taskService.scheduleTask(
        new RemoveChannelServerProxyTask(nodeId));
      }
        },
        taskOwner);
   
View Full Code Here

                return;
            }

      final long nodeId = node.getId();
      channelServerCache.remove(nodeId);
      final TaskService taskService = getTaskService();
      try {
    if (logger.isLoggable(Level.INFO)) {
        logger.log(Level.INFO,
             "Node:{0} handling nodeFailed:{1}",
             localNodeId, nodeId);
    }

    /*
     * Schedule persistent task to remove the failed server's node
     * ID from locally coordinated channels.
     */
    transactionScheduler.runTask(
        new AbstractKernelRunnable(
      "ScheduleRemoveFailedNodeFromLocalChannelsTask")
        {
      public void run() {
          taskService.scheduleTask(
        new ChannelImpl.
            RemoveFailedNodeFromLocalChannelsTask(
          localNodeId, nodeId));
      }
        }, taskOwner);
View Full Code Here

  implements RecoveryListener
    {
  /** {@inheritDoc} */
  public void recover(final Node node, SimpleCompletionHandler handler) {
      final long nodeId = node.getId();
      final TaskService taskService = getTaskService();
     
      try {
    if (logger.isLoggable(Level.INFO)) {
        logger.log(Level.INFO, "Node:{0} recovering for node:{1}",
             localNodeId, nodeId);
    }

    /*
     * Schedule persistent tasks to perform recovery.
     */
    transactionScheduler.runTask(
        new AbstractKernelRunnable("ScheduleRecoveryTasks") {
      public void run() {
          /*
           * For each session on the failed node, notify
           * the session's ClientSessionListener and
           * clean up the session's persistent data and
           * bindings.
           */
          taskService.scheduleTask(
        new HandleNextDisconnectedSessionTask(nodeId));
       
          /*
           * Remove client session server proxy and
           * associated binding for failed node, as
           * well as protocol descriptors for the
           * failed node.
           */
          taskService.scheduleTask(
        new RemoveNodeSpecificDataTask(nodeId));
      } },
        taskOwner);
              
    handler.completed();
View Full Code Here

  implements RecoveryListener
    {
  /** {@inheritDoc} */
  public void recover(Node node, SimpleCompletionHandler handler) {
      final long nodeId = node.getId();
      final TaskService taskService = getTaskService();
      try {
    if (logger.isLoggable(Level.INFO)) {
        logger.log(Level.INFO, "Node:{0} recovering for node:{1}",
             localNodeId, nodeId);
    }

    /*
     * Schedule persistent tasks to perform recovery.
     */
    transactionScheduler.runTask(
        new AbstractKernelRunnable("ScheduleRecoveryTasks") {
      public void run() {
          /*
           * Reassign each failed coordinator to a new node.
           */
          taskService.scheduleTask(
        new ChannelImpl.ReassignCoordinatorsTask(
            nodeId));
          /*
           * Remove binding to channel server proxy for
           * failed node, and remove proxy's wrapper.
           */
          taskService.scheduleTask(
        new RemoveChannelServerProxyTask(nodeId));
      }
        },
        taskOwner);
   
View Full Code Here

                return;
            }

      final long nodeId = node.getId();
      channelServerCache.remove(nodeId);
      final TaskService taskService = getTaskService();
      try {
    if (logger.isLoggable(Level.INFO)) {
        logger.log(Level.INFO,
             "Node:{0} handling nodeFailed:{1}",
             localNodeId, nodeId);
    }

    /*
     * Schedule persistent task to remove the failed server's node
     * ID from locally coordinated channels.
     */
    transactionScheduler.runTask(
        new AbstractKernelRunnable(
      "ScheduleRemoveFailedNodeFromLocalChannelsTask")
        {
      public void run() {
          taskService.scheduleTask(
        new ChannelImpl.
            RemoveFailedNodeFromLocalChannelsTask(
          localNodeId, nodeId));
      }
        }, taskOwner);
View Full Code Here

  implements RecoveryListener
    {
  /** {@inheritDoc} */
  public void recover(Node node, SimpleCompletionHandler handler) {
      final long nodeId = node.getId();
      final TaskService taskService = getTaskService();
      try {
    if (logger.isLoggable(Level.INFO)) {
        logger.log(Level.INFO, "Node:{0} recovering for node:{1}",
             localNodeId, nodeId);
    }

    /*
     * Schedule persistent tasks to perform recovery.
     */
    transactionScheduler.runTask(
        new AbstractKernelRunnable("ScheduleRecoveryTasks") {
      public void run() {
          /*
           * Reassign each failed coordinator to a new node.
           */
          taskService.scheduleTask(
        new ChannelImpl.ReassignCoordinatorsTask(
            nodeId));
          /*
           * Remove binding to channel server proxy for
           * failed node, and remove proxy's wrapper.
           */
          taskService.scheduleTask(
        new RemoveChannelServerProxyTask(nodeId));
      }
        },
        taskOwner);
   
View Full Code Here

                return;
            }

      final long nodeId = node.getId();
      channelServerCache.remove(nodeId);
      final TaskService taskService = getTaskService();
      try {
    if (logger.isLoggable(Level.INFO)) {
        logger.log(Level.INFO,
             "Node:{0} handling nodeFailed:{1}",
             localNodeId, nodeId);
    }

    /*
     * Schedule persistent task to remove the failed server's node
     * ID from locally coordinated channels.
     */
    transactionScheduler.runTask(
        new AbstractKernelRunnable(
      "ScheduleRemoveFailedNodeFromLocalChannelsTask")
        {
      public void run() {
          taskService.scheduleTask(
        new ChannelImpl.
            RemoveFailedNodeFromLocalChannelsTask(
          localNodeId, nodeId));
      }
        }, taskOwner);
View Full Code Here

TOP

Related Classes of com.sun.sgs.service.TaskService

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.