org.codehaus.wadi.group
Interface Dispatcher

All Superinterfaces:
EnvelopeListener
All Known Implementing Classes:
AbstractDispatcher, SharedDispatcher, VMDispatcher

public interface Dispatcher
extends EnvelopeListener

Version:
$Revision: 1563 $
Author:
Jules Gosnell

Method Summary
 void addInterceptor(EnvelopeInterceptor interceptor)
           
 void addRendezVousEnvelope(Envelope envelope)
           
 java.util.Collection attemptMultiRendezVous(Quipu rv, long timeout)
           
 Envelope attemptRendezVous(Quipu rv, long timeout)
           
 Envelope createEnvelope()
           
 Envelope exchangeSend(Address target, Envelope envelope, long timeout)
           
 Envelope exchangeSend(Address target, Envelope envelope, long timeout, java.lang.String targetCorrelationId)
           
 Envelope exchangeSend(Address target, java.io.Serializable pojo, 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.
 Cluster getCluster()
           
 DispatcherContext getContext()
           
 java.lang.String getPeerName(Address address)
           
 Quipu newRendezVous(int numLlamas)
           
 void register(ServiceEndpoint internalDispatcher)
           
 void removeInterceptor(EnvelopeInterceptor interceptor)
           
 void reply(Address from, Address to, java.lang.String sourceCorrelationId, java.io.Serializable body)
           
 void reply(Envelope request, Envelope reply)
           
 void reply(Envelope request, 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 target, java.io.Serializable pojo)
          send a Serializable pojo to an Address - async - no reply expected
 void start()
           
 void stop()
           
 void unregister(ServiceEndpoint internalDispatcher, int nbAttemp, long delayMillis)
           
 
Methods inherited from interface org.codehaus.wadi.group.EnvelopeListener
onEnvelope
 

Method Detail

addInterceptor

void addInterceptor(EnvelopeInterceptor interceptor)

removeInterceptor

void removeInterceptor(EnvelopeInterceptor interceptor)

register

void register(ServiceEndpoint internalDispatcher)

unregister

void unregister(ServiceEndpoint internalDispatcher,
                int nbAttemp,
                long delayMillis)

send

void send(Address target,
          Envelope envelope)
          throws MessageExchangeException
Send a ready-made Message to the Peer at the 'target' Address.

Parameters:
target - The Address of the Peer to which the Message should be sent
envelope - The Message itself
Throws:
MessageExchangeException

send

void send(Address target,
          java.io.Serializable pojo)
          throws MessageExchangeException
send a Serializable pojo to an Address - async - no reply expected

Parameters:
target - The Address to which we are sending the Message
pojo - The Object that we want to send inside it
Throws:
MessageExchangeException

send

void send(Address target,
          Quipu quipu,
          java.io.Serializable pojo)
          throws MessageExchangeException
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. The code that calls this method assumes responsibility for coordinating this thread with the expected reply.

Parameters:
target - The Address of the Peer to which this message is to be sent
quipu - The quipu which will be used to match a response on the source Peer
pojo - The object to be sent in the Message
Throws:
MessageExchangeException

send

void send(Address source,
          Address target,
          Quipu quipu,
          java.io.Serializable pojo)
          throws MessageExchangeException
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. The code that calls this method assumes responsibility for coordinating this thread with the expected reply.

Parameters:
source - The Address of the Peer to which the reply should be sent
target - The Address of the Peer to which this message is to be sent
quipu - The correlationId which will be used to match a response on the source Peer
pojo - The object to be sent in the Message
Throws:
MessageExchangeException

exchangeSend

Envelope exchangeSend(Address target,
                      java.io.Serializable pojo,
                      long timeout)
                      throws MessageExchangeException
Send a Serializable 'pojo' to 'target' Address - sync - and wait for a reply. The outgoing message will be accompanied by a correlation id. An incoming message, carrying the same correlation id, arriving within the specified timeframe, will be taken as the response.

Parameters:
target - The address to which we are sending the Message
pojo - The object that we want to send inside it
timeout - The length of time that we are willing to wait for a reply
Returns:
a response in the form of a Message
Throws:
MessageExchangeException

exchangeSend

Envelope exchangeSend(Address target,
                      java.io.Serializable pojo,
                      long timeout,
                      java.lang.String targetCorrelationId)
                      throws MessageExchangeException
Send a Serializable 'pojo' to a 'target' Address - sync - and wait for a reply. This message will be accompanied by a 'targetCorrelationId' which will be used to match it at the target end, so that it may itself be interpreted as an incoming response to a previously outgoing request, thus allowing us to create 'message chains'.

Parameters:
target - The address to which we are sending the message
targetCorrelationId - Explicitly identifies the message to which we wish to reply
pojo - The object that we wish to send
timeout - The length of time that we are willing to wait for a reply
Returns:
a response in the form of a Message
Throws:
MessageExchangeException

exchangeSend

Envelope exchangeSend(Address target,
                      Envelope envelope,
                      long timeout)
                      throws MessageExchangeException
Throws:
MessageExchangeException

exchangeSend

Envelope exchangeSend(Address target,
                      Envelope envelope,
                      long timeout,
                      java.lang.String targetCorrelationId)
                      throws MessageExchangeException
Throws:
MessageExchangeException

reply

void reply(Address from,
           Address to,
           java.lang.String sourceCorrelationId,
           java.io.Serializable body)
           throws MessageExchangeException
Throws:
MessageExchangeException

reply

void reply(Envelope request,
           java.io.Serializable body)
           throws MessageExchangeException
Throws:
MessageExchangeException

reply

void reply(Envelope request,
           Envelope reply)
           throws MessageExchangeException
Throws:
MessageExchangeException

addRendezVousEnvelope

void addRendezVousEnvelope(Envelope envelope)

newRendezVous

Quipu newRendezVous(int numLlamas)

attemptRendezVous

Envelope attemptRendezVous(Quipu rv,
                           long timeout)
                           throws MessageExchangeException
Throws:
MessageExchangeException

attemptMultiRendezVous

java.util.Collection attemptMultiRendezVous(Quipu rv,
                                            long timeout)
                                            throws MessageExchangeException
Throws:
MessageExchangeException

start

void start()
           throws MessageExchangeException
Throws:
MessageExchangeException

stop

void stop()
          throws MessageExchangeException
Throws:
MessageExchangeException

createEnvelope

Envelope createEnvelope()

getCluster

Cluster getCluster()

getPeerName

java.lang.String getPeerName(Address address)

getContext

DispatcherContext getContext()


Copyright © 2011. All Rights Reserved.