org.resilientedge.jockey.peer
Interface MessageBroker

All Known Implementing Classes:
MessageBrokerImpl

public interface MessageBroker

The MessageBroker enables an application to send messages, requests and replies to other apps.

Version:
$Revision: 1.1.1.1 $
Author:
John Gardner

Method Summary
 void addMessageListener(AppToken app, MessageListener listener)
          Add a listener that wishes to receive message notifications.
 void removeMessageListener(AppToken app, MessageListener listener)
          Remove an entity from the list of those interested in messages notifications.
 ResponseMarker sendAsyncRequest(AppToken app, PeerMessage request, int timeout)
          Sends an asynchronous request to an app, informing the registered MessageListener when the response is received or the timeout has been exceeded.
 SendMarker sendMessage(AppToken app, PeerMessage message)
          Sends a message asynchronously, returning a SendMarker for tracking the progress of the message transmission.
 PeerMessage sendRequest(AppToken app, PeerMessage request, int timeout)
          Sends a request to an app, waiting until the response is received or until the timeout is exceeded.
 SendMarker sendResponse(PeerMessage request, PeerMessage message)
          Sends an asynchronous reply to an app's request, informing the registered MessageListener when the send has completed.
 

Method Detail

sendRequest

public PeerMessage sendRequest(AppToken app,
                               PeerMessage request,
                               int timeout)
                        throws java.io.IOException
Sends a request to an app, waiting until the response is received or until the timeout is exceeded.
Parameters:
app - Description of Parameter
request - Description of Parameter
timeout - Description of Parameter
Returns:
Description of the Returned Value

sendMessage

public SendMarker sendMessage(AppToken app,
                              PeerMessage message)
                       throws java.io.IOException
Sends a message asynchronously, returning a SendMarker for tracking the progress of the message transmission.
Parameters:
app - Description of Parameter
message - Description of Parameter
Returns:
Description of the Returned Value

sendAsyncRequest

public ResponseMarker sendAsyncRequest(AppToken app,
                                       PeerMessage request,
                                       int timeout)
                                throws java.io.IOException
Sends an asynchronous request to an app, informing the registered MessageListener when the response is received or the timeout has been exceeded.
Parameters:
app - Description of Parameter
request - Description of Parameter
timeout - Description of Parameter
Returns:
Description of the Returned Value

sendResponse

public SendMarker sendResponse(PeerMessage request,
                               PeerMessage message)
                        throws java.io.IOException
Sends an asynchronous reply to an app's request, informing the registered MessageListener when the send has completed.
Parameters:
request - Description of Parameter
message - Description of Parameter
Returns:
Description of the Returned Value

addMessageListener

public void addMessageListener(AppToken app,
                               MessageListener listener)
Add a listener that wishes to receive message notifications.
Parameters:
app - the app that this entity represents; message destination
listener - entity to add

removeMessageListener

public void removeMessageListener(AppToken app,
                                  MessageListener listener)
Remove an entity from the list of those interested in messages notifications.
Parameters:
app - the app that this entity represents; message destination
listener - entity to remove


Copyright © 2001 Resilient Edge, Inc. All Rights Reserved.