|
||||||||||
| 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 org.apache.commons.logging.Log |
_log
|
protected java.util.Map |
_rvMap
|
protected java.util.List |
interceptors
|
| 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()
|
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 ThreadPool _executor
protected org.apache.commons.logging.Log _log
protected final java.util.Map _rvMap
protected final java.util.List 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 Dispatcherpublic void addInterceptor(EnvelopeInterceptor interceptor)
addInterceptor in interface Dispatcherpublic void removeInterceptor(EnvelopeInterceptor interceptor)
removeInterceptor in interface Dispatcherpublic void register(ServiceEndpoint msgDispatcher)
register in interface Dispatcher
public void unregister(ServiceEndpoint msgDispatcher,
int nbAttemp,
long delayMillis)
unregister in interface Dispatcherpublic final void onEnvelope(Envelope envelope)
onEnvelope in interface EnvelopeListenerprotected void doOnEnvelope(Envelope envelope)
public void addRendezVousEnvelope(Envelope envelope)
addRendezVousEnvelope in interface Dispatcherpublic Quipu newRendezVous(int numLlamas)
newRendezVous in interface Dispatcher
public Envelope attemptRendezVous(Quipu rv,
long timeout)
throws MessageExchangeException
attemptRendezVous in interface DispatcherMessageExchangeException
public java.util.Collection attemptMultiRendezVous(Quipu rv,
long timeout)
throws MessageExchangeException
attemptMultiRendezVous in interface DispatcherMessageExchangeException
public Envelope exchangeSend(Address to,
java.io.Serializable body,
long timeout)
throws MessageExchangeException
Dispatcher
exchangeSend in interface Dispatcherto - 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 DispatcherMessageExchangeException
public void reply(Envelope request,
Envelope reply)
throws MessageExchangeException
reply in interface DispatcherMessageExchangeException
public void send(Address to,
java.io.Serializable body)
throws MessageExchangeException
Dispatcher
send in interface Dispatcherto - 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 Dispatchertarget - 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 Dispatchersource - 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 Dispatchertarget - 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 Dispatchertarget - 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 DispatcherMessageExchangeException
public Envelope exchangeSend(Address target,
Envelope envelope,
long timeout,
java.lang.String targetCorrelationId)
throws MessageExchangeException
exchangeSend in interface DispatcherMessageExchangeException
public void reply(Address from,
Address to,
java.lang.String incomingCorrelationId,
java.io.Serializable body)
throws MessageExchangeException
reply in interface DispatcherMessageExchangeException
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
MessageExchangeExceptionprotected Envelope onOutboundEnvelope(Envelope envelope)
protected Envelope onInboundEnvelope(Envelope envelope)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||