org.objectweb.dream.router
Class AbstractRouterImpl
java.lang.Object
org.objectweb.dream.AbstractComponent
org.objectweb.dream.router.AbstractRouterImpl
- All Implemented Interfaces:
- ContextualBindingController, NeedAsyncStartController, PrepareStopLifeCycleController, Loggable, Push, BindingController, LifeCycleController
- Direct Known Subclasses:
- AbstractRouterKeyBasedImpl, RouterRandomImpl, RouterRoundRobinImpl
public abstract class AbstractRouterImpl
- extends AbstractComponent
- implements Push
Abstract implementation of a basic Push/Push router. A Push/Push router
routes messages received on its Push input to one of its Push outputs. A
Push/Push router has also a defaultOutPushItf
that can be
bound to route messages for which no routes are found.
Outputs are stored in the outPushMap
Map. The output
corresponding to an incoming message is retrieved using the abstract
getOutput(Message)
method. To avoid unnecessary building of routes
the getOutput(Message)
can test the boolean
initialized
which is set to false
each time the
router is bound to a new output.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
initialized
protected boolean initialized
true
if the route table is initialized.
DEFAULT_OUT_PUSH_ITF_NAME
public static final String DEFAULT_OUT_PUSH_ITF_NAME
- The name of the default
Push
client interface.
- See Also:
- Constant Field Values
defaultOutPushItf
protected Push defaultOutPushItf
- Default Push interface to be used if no Push interface can be found in
outPushTable
.
outPushMap
protected Map<String,Push> outPushMap
- Map of out-push interfaces binded to this router
messageManagerItf
protected MessageManager messageManagerItf
- the message manager client interface of this component
AbstractRouterImpl
public AbstractRouterImpl()
getOutput
protected abstract Push getOutput(Message message)
throws PushException
- Throws:
PushException
push
public void push(Message message)
throws PushException
- Sends the incoming message to one of the router's output. The appropriate
output is retrieved using the
getOutput(Message)
method. If this
method returns null
, the defaultOutPushItf
is used if it is bound.
- Specified by:
push
in interface Push
- Parameters:
message
- the pushed message
- Throws:
PushException
- if no route can be found, or thrown by client push.- See Also:
Push.push(Message)
listFc
public String[] listFc()
- Specified by:
listFc
in interface BindingController
- See Also:
BindingController.listFc()
bindFc
public void bindFc(String clientItfName,
Object serverItf)
throws NoSuchInterfaceException,
IllegalBindingException,
IllegalLifeCycleException
- Specified by:
bindFc
in interface BindingController
- Overrides:
bindFc
in class AbstractComponent
- Throws:
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
- See Also:
BindingController.bindFc(String,
Object)
unbindFc
public void unbindFc(String clientItfName)
throws NoSuchInterfaceException,
IllegalBindingException,
IllegalLifeCycleException
- Specified by:
unbindFc
in interface BindingController
- Overrides:
unbindFc
in class AbstractComponent
- Throws:
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
- See Also:
BindingController.unbindFc(String)
Copyright © 2003, 2005 - INRIA Rhone-Alpes - All Rights Reserved.