## 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.)

  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.)

  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)

  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)

  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)

  Throws:
    `AxisFault`

### receive

    public void receive(MessageExchangeEventListener listener)
                 throws AxisFault

  Registers a listener for receiving messages (nonblocking)

  Throws:
    `AxisFault`

### receive

    public void receive(MessageExchangeCorrelator correlator,
                        MessageExchangeEventListener listener)
                 throws AxisFault

  Registers a listener for receiving messages (nonblocking)

  Throws:
    `AxisFault`

### sendAndReceive

    public MessageContext sendAndReceive(MessageContext context)
                                  throws AxisFault

  Synchronized send and receive

  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

  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)

### getOption

    public java.lang.Object getOption(java.lang.String OptionId)

  Returns:
    Object The value of the Option

### getOption

    public java.lang.Object getOption(java.lang.String OptionId,
                                      java.lang.Object defaultValue)

  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)

### clearOptions

    public void clearOptions()

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