Apache CXF API

org.apache.cxf.ws.eventing.backend.notification
Class NotificatorService

java.lang.Object
  extended by org.apache.cxf.ws.eventing.backend.notification.NotificatorService
Direct Known Subclasses:
EventSinkInterfaceNotificatorService

public abstract class NotificatorService
extends Object

The service which takes care of notifying subscribers about events. Has access to the subscription database. Receives events from compliant Emitters, eg. EmitterServlet / EmitterMBean,.. Don't forget to use the 'stop' method, especially if running inside a servlet container!! Suggested approach for a web container is to instantiate this class in a ServletContextListener and then have it stopped using the same listener. If you don't call 'stop' upon undeployment, the underlying ExecutorService will not be shut down, leaking resources.


Field Summary
static int CORE_POOL_SIZE
           
protected static Logger LOG
           
protected  ExecutorService service
           
 
Constructor Summary
NotificatorService()
           
 
Method Summary
 void dispatchEvent(Object event)
           
protected abstract  SubscriptionManagerInterfaceForNotificators obtainManager()
           
 void start()
          Starts this NotificatorService.
 void stop()
          Shuts down the NotificatorService.
protected abstract  void submitNotificationTask(SubscriptionTicket ticket, Object event)
           
 void subscriptionEnd(SubscriptionTicket ticket, String reason, SubscriptionEndStatus status)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CORE_POOL_SIZE

public static final int CORE_POOL_SIZE
See Also:
Constant Field Values

LOG

protected static final Logger LOG

service

protected ExecutorService service
Constructor Detail

NotificatorService

public NotificatorService()
Method Detail

obtainManager

protected abstract SubscriptionManagerInterfaceForNotificators obtainManager()

dispatchEvent

public void dispatchEvent(Object event)

submitNotificationTask

protected abstract void submitNotificationTask(SubscriptionTicket ticket,
                                               Object event)

subscriptionEnd

public void subscriptionEnd(SubscriptionTicket ticket,
                            String reason,
                            SubscriptionEndStatus status)

start

public void start()
Starts this NotificatorService. You MUST run this method on every instance before starting to pass any events to it. Run it only once.


stop

public void stop()
Shuts down the NotificatorService. This method is a MUST if you are running it inside a servlet container, because it will shutdown the underlying ExecutorService.


Apache CXF API

Apache CXF