org.objectweb.dream.router
Class AbstractKeyBasedRouterImpl
java.lang.Object
org.objectweb.dream.AbstractComponent
org.objectweb.dream.router.AbstractBasicRouterImpl
org.objectweb.dream.router.AbstractKeyBasedRouterImpl
- All Implemented Interfaces:
- BindingController, LifeCycleController, Loggable, Push
- public abstract class AbstractKeyBasedRouterImpl
- extends AbstractBasicRouterImpl
Abstract implementation of a key-based Push/Push router. A key-based
Push/Push router associates each of its outputs (except the default one) to a
key. These mappings (key,outputs) are stored in the
outPushRouteTable
Map. The key corresponding to an incoming
message is retrieved using the abstract
getOutputKey(Message)
method.
The outPushRouteTable
Map is intended to be built by the
initRouteTable()
method. To avoid
unnecessary building of the outPushRouteTable
Map, the
initRouteTable()
should test the
initialized
boolean which is set to false
each
time the router is bound to a new output.
Field Summary |
protected Map |
outPushRouteTable
Route table that associates keys with Push output
interfaces. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
outPushRouteTable
protected Map outPushRouteTable
- Route table that associates keys with
Push
output
interfaces.
AbstractKeyBasedRouterImpl
public AbstractKeyBasedRouterImpl()
- Constructor.
getOutput
protected Push getOutput(Message message,
Map context)
throws PushException
- Specified by:
getOutput
in class AbstractBasicRouterImpl
- Throws:
PushException
- See Also:
AbstractBasicRouterImpl.getOutput(org.objectweb.dream.message.Message,
java.util.Map)
getOutputKey
protected abstract Object getOutputKey(Message message)
- Returns the key associated with the output on which the specified message
must be routed.
- Parameters:
message
- the message that must be routed.
- Returns:
- the key associated with the output on which the specified message
must be routed.
initRouteTable
protected void initRouteTable()
throws PushException
- This method initializes the
outPushRouteTable
route table.
It is called by the getOutput
method. To avoid unnecessary
route table, this method should test the initialized
boolean
which is set to false
each time the router is bound to a new
output.
- Throws:
PushException
Copyright © 2003, 2004 - INRIA Rhone-Alpes - All Rights Reserved.