|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.wadi.group.impl.AbstractDispatcher
public abstract class AbstractDispatcher
The portable aspects of a Dispatcher implementation
Field Summary | |
---|---|
protected ThreadPool |
_executor
|
protected org.codehaus.wadi.group.impl.AbstractDispatcher.SimpleCorrelationIDFactory |
_factory
|
protected java.util.List<EnvelopeInterceptor> |
interceptors
|
protected org.apache.commons.logging.Log |
log
|
protected java.util.Map<java.lang.String,Quipu> |
rvMap
|
Constructor Summary | |
---|---|
AbstractDispatcher()
|
|
AbstractDispatcher(ThreadPool executor)
|
Method Summary | |
---|---|
void |
addInterceptor(EnvelopeInterceptor interceptor)
|
void |
addRendezVousEnvelope(Envelope envelope)
|
java.util.Collection |
attemptMultiRendezVous(Quipu rv,
long timeout)
|
Envelope |
attemptRendezVous(Quipu rv,
long timeout)
|
protected void |
doOnEnvelope(Envelope envelope)
|
protected abstract void |
doSend(Address target,
Envelope envelope)
|
Envelope |
exchangeSend(Address target,
Envelope envelope,
long timeout)
|
Envelope |
exchangeSend(Address target,
Envelope envelope,
long timeout,
java.lang.String targetCorrelationId)
|
Envelope |
exchangeSend(Address to,
java.io.Serializable body,
long timeout)
Send a Serializable 'pojo' to 'target' Address - sync - and wait for a reply. |
Envelope |
exchangeSend(Address target,
java.io.Serializable pojo,
long timeout,
java.lang.String targetCorrelationId)
Send a Serializable 'pojo' to a 'target' Address - sync - and wait for a reply. |
DispatcherContext |
getContext()
|
ThreadPool |
getExecutor()
|
java.util.List<EnvelopeInterceptor> |
getInterceptors()
|
protected void |
hook()
|
Quipu |
newRendezVous(int numLlamas)
|
void |
onEnvelope(Envelope envelope)
|
protected Envelope |
onInboundEnvelope(Envelope envelope)
|
protected Envelope |
onOutboundEnvelope(Envelope envelope)
|
void |
register(ServiceEndpoint msgDispatcher)
|
void |
removeInterceptor(EnvelopeInterceptor interceptor)
|
void |
reply(Address from,
Address to,
java.lang.String incomingCorrelationId,
java.io.Serializable body)
|
void |
reply(Envelope request,
Envelope reply)
|
void |
reply(Envelope envelope,
java.io.Serializable body)
|
void |
send(Address source,
Address target,
Quipu quipu,
java.io.Serializable pojo)
send a Serializable 'pojo' to a 'target' Address, with the Message's replyTo field containing the 'source' Address - async - although we are expecting a reply, which will be matched with the sourceCorrelationId. |
void |
send(Address target,
Envelope envelope)
Send a ready-made Message to the Peer at the 'target' Address. |
void |
send(Address target,
Quipu quipu,
java.io.Serializable pojo)
send a Serializable 'pojo' to a 'target' Address, with the Message's replyTo field containing the local cluster Address - async - although we are expecting a reply, which will be matched with the sourceCorrelationId. |
void |
send(Address to,
java.io.Serializable body)
send a Serializable pojo to an Address - async - no reply expected |
protected Quipu |
setRendezVous(java.lang.String correlationId,
int numLlamas)
|
void |
unregister(ServiceEndpoint msgDispatcher,
int nbAttemp,
long delayMillis)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.codehaus.wadi.group.Dispatcher |
---|
createEnvelope, getCluster, getPeerName, start, stop |
Field Detail |
---|
protected final org.apache.commons.logging.Log log
protected final ThreadPool _executor
protected final java.util.Map<java.lang.String,Quipu> rvMap
protected final java.util.List<EnvelopeInterceptor> interceptors
protected final org.codehaus.wadi.group.impl.AbstractDispatcher.SimpleCorrelationIDFactory _factory
Constructor Detail |
---|
public AbstractDispatcher(ThreadPool executor)
public AbstractDispatcher()
Method Detail |
---|
public DispatcherContext getContext()
getContext
in interface Dispatcher
public void addInterceptor(EnvelopeInterceptor interceptor)
addInterceptor
in interface Dispatcher
public void removeInterceptor(EnvelopeInterceptor interceptor)
removeInterceptor
in interface Dispatcher
public java.util.List<EnvelopeInterceptor> getInterceptors()
getInterceptors
in interface Dispatcher
public void register(ServiceEndpoint msgDispatcher)
register
in interface Dispatcher
public void unregister(ServiceEndpoint msgDispatcher, int nbAttemp, long delayMillis)
unregister
in interface Dispatcher
public final void onEnvelope(Envelope envelope)
onEnvelope
in interface EnvelopeListener
protected void doOnEnvelope(Envelope envelope)
public void addRendezVousEnvelope(Envelope envelope)
addRendezVousEnvelope
in interface Dispatcher
public Quipu newRendezVous(int numLlamas)
newRendezVous
in interface Dispatcher
public Envelope attemptRendezVous(Quipu rv, long timeout) throws MessageExchangeException
attemptRendezVous
in interface Dispatcher
MessageExchangeException
public java.util.Collection attemptMultiRendezVous(Quipu rv, long timeout) throws MessageExchangeException
attemptMultiRendezVous
in interface Dispatcher
MessageExchangeException
public Envelope exchangeSend(Address to, java.io.Serializable body, long timeout) throws MessageExchangeException
Dispatcher
exchangeSend
in interface Dispatcher
to
- The address to which we are sending the Messagebody
- The object that we want to send inside ittimeout
- The length of time that we are willing to wait for a reply
MessageExchangeException
public void reply(Envelope envelope, java.io.Serializable body) throws MessageExchangeException
reply
in interface Dispatcher
MessageExchangeException
public void reply(Envelope request, Envelope reply) throws MessageExchangeException
reply
in interface Dispatcher
MessageExchangeException
public void send(Address to, java.io.Serializable body) throws MessageExchangeException
Dispatcher
send
in interface Dispatcher
to
- The Address to which we are sending the Messagebody
- The Object that we want to send inside it
MessageExchangeException
public void send(Address target, Quipu quipu, java.io.Serializable pojo) throws MessageExchangeException
Dispatcher
send
in interface Dispatcher
target
- The Address of the Peer to which this message is to be sentquipu
- The quipu which will be used to match a response on
the source Peerpojo
- The object to be sent in the Message
MessageExchangeException
public void send(Address source, Address target, Quipu quipu, java.io.Serializable pojo) throws MessageExchangeException
Dispatcher
send
in interface Dispatcher
source
- The Address of the Peer to which the reply should be senttarget
- The Address of the Peer to which this message is to be sentquipu
- The correlationId which will be used to match a response on
the source Peerpojo
- The object to be sent in the Message
MessageExchangeException
public final void send(Address target, Envelope envelope) throws MessageExchangeException
Dispatcher
send
in interface Dispatcher
target
- The Address of the Peer to which the Message should be sentenvelope
- The Message itself
MessageExchangeException
public Envelope exchangeSend(Address target, java.io.Serializable pojo, long timeout, java.lang.String targetCorrelationId) throws MessageExchangeException
Dispatcher
exchangeSend
in interface Dispatcher
target
- The address to which we are sending the messagepojo
- The object that we wish to sendtimeout
- The length of time that we are willing to wait for a replytargetCorrelationId
- Explicitly identifies the message to which we wish to reply
MessageExchangeException
public Envelope exchangeSend(Address target, Envelope envelope, long timeout) throws MessageExchangeException
exchangeSend
in interface Dispatcher
MessageExchangeException
public Envelope exchangeSend(Address target, Envelope envelope, long timeout, java.lang.String targetCorrelationId) throws MessageExchangeException
exchangeSend
in interface Dispatcher
MessageExchangeException
public void reply(Address from, Address to, java.lang.String incomingCorrelationId, java.io.Serializable body) throws MessageExchangeException
reply
in interface Dispatcher
MessageExchangeException
protected Quipu setRendezVous(java.lang.String correlationId, int numLlamas)
protected void hook()
public ThreadPool getExecutor()
protected abstract void doSend(Address target, Envelope envelope) throws MessageExchangeException
MessageExchangeException
protected Envelope onOutboundEnvelope(Envelope envelope) throws MessageExchangeException
MessageExchangeException
protected Envelope onInboundEnvelope(Envelope envelope) throws MessageExchangeException
MessageExchangeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |