com.infoscape.proteus.router
Class SwitchedRouter

java.lang.Object
  |
  +--com.infoscape.proteus.router.Router
        |
        +--com.infoscape.proteus.router.SwitchedRouter
All Implemented Interfaces:
MessageHandler, MessageSink, java.lang.Runnable, Transactional
Direct Known Subclasses:
RegexSwitch, SubstringSwitch, XMLSwitch

public abstract class SwitchedRouter
extends Router

A SwitchedRouter has multiple sinks, and routes messages based on the value returned by an abstract method called getMatch() which takes the incoming message as argument.


Constructor Summary
SwitchedRouter(org.jdom.Element elt)
           
 
Method Summary
protected abstract  java.lang.String getMatch(java.lang.Object msg)
           
 void route(java.lang.Object msg)
           
 
Methods inherited from class com.infoscape.proteus.router.Router
addSink, commit, disconnect, getConnection, log, log, putMessage, reconnect, rollback, routeMessage, run, setSyncPoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwitchedRouter

public SwitchedRouter(org.jdom.Element elt)
               throws java.lang.Exception
Parameters:
elt -
Throws:
java.lang.Exception
Method Detail

route

public void route(java.lang.Object msg)
           throws java.lang.Exception
Specified by:
route in class Router
Parameters:
msg -
Throws:
java.lang.Exception

getMatch

protected abstract java.lang.String getMatch(java.lang.Object msg)
                                      throws java.lang.Exception
Parameters:
msg -
Throws:
java.lang.Exception