org.apache.axis.ime
Interface MessageExchange

All Known Implementing Classes:
MessageExchangeImpl

public interface MessageExchange

Represents the boundary interface through which messages are exchanged. This interface supports both push and pull models for receiving inbound messages.

Author:
James M Snell (jasnell@us.ibm.com), Ray Chun (rchun@sonicsoftware.com)

Method Summary
 void clearOptions()
           
 MessageExchangeEventListener getMessageExchangeEventListener()
           
 java.lang.Object getOption(java.lang.String OptionId)
           
 java.lang.Object getOption(java.lang.String OptionId, java.lang.Object defaultValue)
           
 java.util.Hashtable getOptions()
           
 MessageContext receive()
          Waits indefinitely for a message to be received (blocking)
 MessageContext receive(long timeout)
          Waits the specified amount of time for a message to be received (blocking)
 MessageContext receive(MessageExchangeCorrelator correlator)
          Waits indefinitely for a message matching the specified correlator (blocking)
 MessageContext receive(MessageExchangeCorrelator correlator, long timeout)
          Waits the specified amount of time for a message matching the specified correlator (blocking)
 void receive(MessageExchangeCorrelator correlator, MessageExchangeEventListener listener)
          Registers a listener for receiving messages (nonblocking)
 void receive(MessageExchangeEventListener listener)
          Registers a listener for receiving messages (nonblocking)
 MessageExchangeCorrelator send(MessageContext context)
          Send an outbound message.
 MessageExchangeCorrelator send(MessageContext context, MessageExchangeEventListener listener)
          Send an outbound message.
 MessageContext sendAndReceive(MessageContext context)
          Synchronized send and receive
 MessageContext sendAndReceive(MessageContext context, long timeout)
          Synchronized send and receive with timeout
 void setMessageExchangeEventListener(MessageExchangeEventListener listener)
           
 void setOption(java.lang.String OptionId, java.lang.Object OptionValue)
           
 void setOptions(java.util.Hashtable options)
           
 

Method Detail

send

public MessageExchangeCorrelator send(MessageContext context)
                               throws AxisFault
Send an outbound message. (Impl's of this method need to create a new MessageExchangeCorrelator and put it into the MessageContext if one does not already exist.)
Parameters:
MessageContext - The Axis MessageContext being sent
Returns:
MessageExchangeCorrelator The correlator for the sent MessageContext
Throws:
AxisFault -  

send

public MessageExchangeCorrelator send(MessageContext context,
                                      MessageExchangeEventListener listener)
                               throws AxisFault
Send an outbound message. (Impl's of this method need to create a new MessageExchangeCorrelator and put it into the MessageContext if one does not already exist.)
Parameters:
MessageContext - The Axis MessageContext being sent
MessageContextListener - The listener to which responses, faults, and status updates should be delivered
Returns:
MessageExchangeCorrelator The correlator for the sent MessageContext
Throws:
AxisFault -  

receive

public MessageContext receive()
                       throws AxisFault
Waits indefinitely for a message to be received (blocking)
Returns:
MessageContext The received MessageContext
Throws:
AxisFault -  

receive

public MessageContext receive(long timeout)
                       throws AxisFault
Waits the specified amount of time for a message to be received (blocking)
Parameters:
long - The amount of time (ms) to wait
Returns:
MessageContext The received MessageContext
Throws:
AxisFault -  

receive

public MessageContext receive(MessageExchangeCorrelator correlator)
                       throws AxisFault
Waits indefinitely for a message matching the specified correlator (blocking)
Parameters:
MessageExchangeCorrelator -  
Returns:
MessageContext
Throws:
AxisFault -  

receive

public MessageContext receive(MessageExchangeCorrelator correlator,
                              long timeout)
                       throws AxisFault
Waits the specified amount of time for a message matching the specified correlator (blocking)
Parameters:
MessageExchangeCorrelator -  
long - timeout
Throws:
AxisFault -  

receive

public void receive(MessageExchangeEventListener listener)
             throws AxisFault
Registers a listener for receiving messages (nonblocking)
Parameters:
MessageContextListener -  
Throws:
AxisFault -  

receive

public void receive(MessageExchangeCorrelator correlator,
                    MessageExchangeEventListener listener)
             throws AxisFault
Registers a listener for receiving messages (nonblocking)
Parameters:
MessageExchangeCorrelator -  
MessageContextListener -  
Throws:
AxisFault -  

sendAndReceive

public MessageContext sendAndReceive(MessageContext context)
                              throws AxisFault
Synchronized send and receive
Parameters:
MessageContext - The MessageContext to send
Returns:
MessageContext The received MessageContext (not guaranteed to be the same object instance as the sent MessageContext)
Throws:
AxisFault -  

sendAndReceive

public MessageContext sendAndReceive(MessageContext context,
                                     long timeout)
                              throws AxisFault
Synchronized send and receive with timeout
Parameters:
MessageContext - The MessageContext to send
long - The length of time (ms) to wait for a response. If a response is not received within the specified amount of time, an AxisFault indicating timeout must be thrown
Returns:
MessageContext The received MessageContext (not guaranteed to be the same object instance as the sent MessageContext)
Throws:
AxisFault -  

setMessageExchangeEventListener

public void setMessageExchangeEventListener(MessageExchangeEventListener listener)

getMessageExchangeEventListener

public MessageExchangeEventListener getMessageExchangeEventListener()

setOption

public void setOption(java.lang.String OptionId,
                      java.lang.Object OptionValue)
Parameters:
String - The id of the property
Object - The value of the Option

getOption

public java.lang.Object getOption(java.lang.String OptionId)
Parameters:
String - The id of the Option
Returns:
Object The value of the Option

getOption

public java.lang.Object getOption(java.lang.String OptionId,
                                  java.lang.Object defaultValue)
Parameters:
String - The id of the Option
Object - The default value of the Option
Returns:
Object The value of the Option

getOptions

public java.util.Hashtable getOptions()
Returns:
java.lang.Hashtable The collection of properties

setOptions

public void setOptions(java.util.Hashtable options)
Parameters:
java.lang.Hashtable - The collection of properties

clearOptions

public void clearOptions()


Copyright © 2003 Apache Web Services Project. All Rights Reserved.