nl.justobjects.pushlet.core
Class Dispatcher

java.lang.Object
  extended by nl.justobjects.pushlet.core.Dispatcher
All Implemented Interfaces:
ConfigDefs, Protocol

public class Dispatcher
extends java.lang.Object
implements Protocol, ConfigDefs

Routes Events to Subscribers.

Version:
$Id: Dispatcher.java,v 1.9 2007/12/04 13:55:53 justb Exp $
Author:
Just van den Broecke - Just Objects ©

Nested Class Summary
private  class Dispatcher.SessionManagerVisitor
          Supplies Visitor methods for callbacks from SessionManager.
 
Field Summary
private static Dispatcher instance
          Singleton pattern: single instance.
protected  Dispatcher.SessionManagerVisitor sessionManagerVisitor
           
 
Fields inherited from interface nl.justobjects.pushlet.core.Protocol
DEFAULT_SERVLET_URI, E_ABORT, E_DATA, E_HEARTBEAT, E_HEARTBEAT_ACK, E_JOIN, E_JOIN_ACK, E_JOIN_LISTEN, E_JOIN_LISTEN_ACK, E_LEAVE, E_LEAVE_ACK, E_LISTEN, E_LISTEN_ACK, E_NACK, E_PUBLISH, E_PUBLISH_ACK, E_REFRESH, E_REFRESH_ACK, E_SUBSCRIBE, E_SUBSCRIBE_ACK, E_UNSUBSCRIBE, E_UNSUBSCRIBE_ACK, FORMAT_JAVASCRIPT, FORMAT_SERIALIZED_JAVA_OBJECT, FORMAT_XML, FORMAT_XML_STRICT, MODE_POLL, MODE_PULL, MODE_STREAM, P_EVENT, P_FORMAT, P_FROM, P_ID, P_MODE, P_REASON, P_SEQ, P_SUBJECT, P_SUBSCRIPTION_ID, P_SUBSCRIPTION_LABEL, P_TIME, P_TO, P_URL, P_WAIT, SUBJECT_META, SUBJECT_META_JOINS, SUBJECT_META_SUBS
 
Fields inherited from interface nl.justobjects.pushlet.core.ConfigDefs
CONTROLLER_CLASS, DISPATCHER_CLASS, LISTEN_FORCE_PULL_AGENTS, LISTEN_FORCE_PULL_ALL, LOG_LEVEL, LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_INFO, LOG_LEVEL_TRACE, LOG_LEVEL_WARN, LOGGER_CLASS, POLL_REFRESH_TIMEOUT_MILLIS, POLL_REFRESH_WAIT_MAX_MILLIS, POLL_REFRESH_WAIT_MIN_MILLIS, PULL_REFRESH_TIMEOUT_MILLIS, PULL_REFRESH_WAIT_MAX_MILLIS, PULL_REFRESH_WAIT_MIN_MILLIS, QUEUE_READ_TIMEOUT_MILLIS, QUEUE_SIZE, QUEUE_WRITE_TIMEOUT_MILLIS, SESSION_CLASS, SESSION_ID_GENERATION, SESSION_ID_GENERATION_RANDOMSTRING, SESSION_ID_GENERATION_UUID, SESSION_ID_SIZE, SESSION_MANAGER_CLASS, SESSION_TIMEOUT_MINS, SOURCES_ACTIVATE, SUBSCRIBER_CLASS, SUBSCRIPTION_CLASS
 
Constructor Summary
protected Dispatcher()
          Singleton pattern with factory method: protected constructor.
 
Method Summary
 void broadcast(Event anEvent)
          Send event to all subscribers.
static Dispatcher getInstance()
          Singleton pattern: get single instance.
 void multicast(Event anEvent)
          Send event to subscribers matching Event subject.
 void start()
          Start Dispatcher.
 void stop()
          Stop Dispatcher.
 void unicast(Event event, java.lang.String aSessionId)
          Send event to specific subscriber.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static Dispatcher instance
Singleton pattern: single instance.


sessionManagerVisitor

protected Dispatcher.SessionManagerVisitor sessionManagerVisitor
Constructor Detail

Dispatcher

protected Dispatcher()
Singleton pattern with factory method: protected constructor.

Method Detail

getInstance

public static Dispatcher getInstance()
Singleton pattern: get single instance.


broadcast

public void broadcast(Event anEvent)
Send event to all subscribers.


multicast

public void multicast(Event anEvent)
Send event to subscribers matching Event subject.


unicast

public void unicast(Event event,
                    java.lang.String aSessionId)
Send event to specific subscriber.


start

public void start()
           throws PushletException
Start Dispatcher.

Throws:
PushletException

stop

public void stop()
Stop Dispatcher.



Copyright 2000-2003 - Just Objects B.V.