xsul.dispatcher.msg.postmail
Class MailBoxImpl

java.lang.Object
  extended byxsul.dispatcher.msg.postmail.MailBoxImpl
All Implemented Interfaces:
MailBox

public class MailBoxImpl
extends java.lang.Object
implements MailBox

Implementation of MailBox.

This implementation uses 2 ConcurrentReaderHashMap to stock responses and waiting responses.

Actualy, there is no data persitence and it is not an independant process or thread from the Dispatcher.

Author:
Alexandre di Costanzo
See Also:
MailBox, EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap

Constructor Summary
MailBoxImpl()
          Construst a new PO Mail Box
 
Method Summary
 java.net.URI getReplyToOf(java.lang.String logicalPath)
          Get the WS-Addressing element Reply To from the original client message.
 boolean isWaitingResponse(java.lang.String path)
          Test if the path is a logical path and is waiting response from a WS.
 void putForWaitingResponse(java.lang.String logicalPath, java.net.URI replyTo)
          Put the java.net.URI of the WS-Addressing element Reply To from the original message from the client.
 void putResponse(java.lang.String logicalPath, XmlElement el)
          Put response from WS in the PO Mail Box Service to keep it.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailBoxImpl

public MailBoxImpl()
Construst a new PO Mail Box

Method Detail

putForWaitingResponse

public void putForWaitingResponse(java.lang.String logicalPath,
                                  java.net.URI replyTo)
Description copied from interface: MailBox
Put the java.net.URI of the WS-Addressing element Reply To from the original message from the client.

Specified by:
putForWaitingResponse in interface MailBox
Parameters:
logicalPath - the key of the forwarded message.
replyTo - WS-Addressing element Reply To from the client message.
See Also:
MailBox.putForWaitingResponse(java.lang.String, java.net.URI)

isWaitingResponse

public boolean isWaitingResponse(java.lang.String path)
Description copied from interface: MailBox
Test if the path is a logical path and is waiting response from a WS.

Specified by:
isWaitingResponse in interface MailBox
Parameters:
path - the path.
Returns:
true if is waiting response from WS, else false.
See Also:
MailBox.isWaitingResponse(java.lang.String)

putResponse

public void putResponse(java.lang.String logicalPath,
                        XmlElement el)
Description copied from interface: MailBox
Put response from WS in the PO Mail Box Service to keep it.

Specified by:
putResponse in interface MailBox
Parameters:
logicalPath - the key of the forwarded message.
el - the message to keep.
See Also:
xsul.dispatcher.msg.postmail.MailBox#putResponse(java.lang.String, org.xmlpull.v1.builder.XmlElement)

getReplyToOf

public java.net.URI getReplyToOf(java.lang.String logicalPath)
Description copied from interface: MailBox
Get the WS-Addressing element Reply To from the original client message.

Specified by:
getReplyToOf in interface MailBox
Parameters:
logicalPath - the key of the message.
Returns:
the URI from client message element Reply To .
See Also:
MailBox.getReplyToOf(java.lang.String)


IU Extreme! Lab (http://www.extreme.indiana.edu)