org.resilientedge.jockey.peerbridge
Interface PBMessenger

All Known Implementing Classes:
LoopbackMessenger, SimpSockMessenger, PBAbstractMessenger

public interface PBMessenger

The PBMessenger is responsible for transmitting messages (generic, requests, replies) from the peer network.

Version:
$Revision: 1.1.1.1 $
Author:
John Gardner

Method Summary
 void addMessageObserver(PBMessageObserver observer)
          Add a receiver that wishes to receive message notifications.
 PBMessage createMessage()
          Creates a new peer message instance to be sent.
 void removeMessageObserver(PBMessageObserver observer)
          Remove an entity from the list of those interested in messages notifications.
 PBResponseMarker sendAsyncRequest(PBApplication app, PBMessage request, int timeout)
          Transmits a message over the peer network to the target peer
 PBSendMarker sendMessage(PBApplication app, PBMessage message)
          Transmits a message over the peer network to the target app
 PBMessage sendRequest(PBApplication app, PBMessage request, int timeout)
          Transmits a request over the peer network to the target app
 PBSendMarker sendResponse(PBMessage request, PBMessage response)
          Transmits a response over the peer network to the target peer
 

Method Detail

createMessage

public PBMessage createMessage()
Creates a new peer message instance to be sent.
Returns:
new empty, message

sendMessage

public PBSendMarker sendMessage(PBApplication app,
                                PBMessage message)
                         throws java.io.IOException
Transmits a message over the peer network to the target app
Parameters:
app - app to receive message
message - message to send
Returns:
marker to represent send status

sendRequest

public PBMessage sendRequest(PBApplication app,
                             PBMessage request,
                             int timeout)
                      throws java.io.IOException
Transmits a request over the peer network to the target app
Parameters:
app - app to receive message
request - request to send
timeout - how long to wait for a response (in sec)
Returns:
response message resulting from request

sendAsyncRequest

public PBResponseMarker sendAsyncRequest(PBApplication app,
                                         PBMessage request,
                                         int timeout)
                                  throws java.io.IOException
Transmits a message over the peer network to the target peer
Parameters:
app - app to receive message
request - request to send
timeout - how long to wait for a response (in sec)
Returns:
marker to represent response status

sendResponse

public PBSendMarker sendResponse(PBMessage request,
                                 PBMessage response)
                          throws java.io.IOException
Transmits a response over the peer network to the target peer
Parameters:
request - request which was received
response - response to send back
Returns:
marker to represent send status

addMessageObserver

public void addMessageObserver(PBMessageObserver observer)
Add a receiver that wishes to receive message notifications.
Parameters:
receiver - entity to add

removeMessageObserver

public void removeMessageObserver(PBMessageObserver observer)
Remove an entity from the list of those interested in messages notifications.
Parameters:
reciever - entity to remove


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