|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.xbus.application.Router
public class Router
The Router
routes a message to one or more systems. Three
different strategies are implemented:
distribute
sends the data to one or more
systems and awaits no response data.
invoke
implements a chain of senders. This
means the response data of one sender is the request data of the following
sender.
invokeAndDistribute
is the
combination of the both. First the data goes through the chain of sender
invocations, then the response data of the last sender is distributed to one
or more systems.
Configuration:
Chapter | Section | Key | Content |
---|---|---|---|
Router | message.getSource() + "." + message.getFunction() |
Invoken | System where a message is sent to and from which a response is returned. |
Router | message.getSource() + "." + message.getFunction() |
Distributen | System where a message is sent to and from which no response is returned. |
Field Summary | |
---|---|
static java.lang.String |
CHAPTER
|
Constructor Summary | |
---|---|
Router()
|
Method Summary | |
---|---|
void |
distribute(Message message)
The Message is distributed to one or more systens. |
void |
invoke(Message message)
A chain of invocations of one or more senders. |
void |
invokeAndDistribute(Message message)
A combination of invoke and
distribute . |
void |
route(Message message)
The message will be routed depending on the entries of the configuration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CHAPTER
Constructor Detail |
---|
public Router()
Method Detail |
---|
public void route(Message message) throws XException
message
- the request data of this Message
is sent to
the first system. It's response data is empty afterwards
because the last step is the distribution without responses.
XException
public void distribute(Message message) throws XException
Message
is distributed to one or more systens. This
means, that the given Message
is sent to the systems (read
from the Configuration
) one after the other. Because
there is no response data from the systems awaited, the response data in
the Message
is empty after the distribution.
If an error occurs when calling one sender, the processing stops, a
rollback is done and the returncode of the Message
is set
to RC_NOK
.
message
- the request data of this Message
is sent to
the systems
XException
public void invokeAndDistribute(Message message) throws XException
invoke
and
distribute
. First the data goes through a
chain of sender invocations, then the response data of the last sender is
distributed to one or more systems.
If an error occurs when calling one sender, the processing stops, a
rollback is done and the returncode of the Message
is set
to RC_NOK
.
message
- the request data of this Message
is sent to
the first system. It's response data is empty afterwards
because the last step is the distribution without responses.
XException
public void invoke(Message message) throws XException
Message
for the next sender is created with
the response data of the previous sender. After the invocation of the
last sender, the response data of the initial Message
is
filled with the response data of the last sender.
If an error occurs when calling one sender, the processing stops, a
rollback is done and the returncode of the initial Message
is set to RC_NOK
.
message
- the initial Message
XException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |