com.sleepycat.je.rep.utilint
Class ServiceDispatcher.ExecutingService

java.lang.Object
  extended by com.sleepycat.je.rep.utilint.ServiceDispatcher.ExecutingService
Direct Known Subclasses:
BinaryNodeStateService, GroupService, LDiffService, MonitorService, NodeStateService
Enclosing class:
ServiceDispatcher

public abstract static class ServiceDispatcher.ExecutingService
extends Object

A service that is run immediately in a thread allocated to it. Subtypes implement the getRunnable() method which provides the runnable object for the service. This service frees up the caller from managing the the threads associated with the service. The runnable must manage interrupts so that it can be shut down by the underlying thread pool.


Constructor Summary
ServiceDispatcher.ExecutingService(String serviceName, ServiceDispatcher dispatcher)
           
 
Method Summary
protected  void cancel()
          Cancel the service as part of the registration being canceled.
abstract  Runnable getRunnable(SocketChannel socketChannel)
           
(package private)  void requestDispatch(SocketChannel channel)
          Informs the service of a new request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceDispatcher.ExecutingService

public ServiceDispatcher.ExecutingService(String serviceName,
                                          ServiceDispatcher dispatcher)
Method Detail

getRunnable

public abstract Runnable getRunnable(SocketChannel socketChannel)

requestDispatch

void requestDispatch(SocketChannel channel)
Informs the service of a new request. The implementation of the method must not block.

Parameters:
channel - the channel on which the request was made

cancel

protected void cancel()
Cancel the service as part of the registration being canceled.



Copyright (c) 2004-2012 Oracle. All rights reserved.