## org.apache.axis.ime.internal
Class MessageExchangeImpl

    java.lang.Object
      |
      +--org.apache.axis.ime.internal.MessageExchangeImpl

All Implemented Interfaces:
  MessageExchange, MessageExchangeLifecycle

public class MessageExchangeImpl
extends java.lang.Object
implements MessageExchange, MessageExchangeLifecycle

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

Nested Class Summary
`class` `MessageExchangeImpl.Listener`

Field Summary
`static long` `DEFAULT_TIMEOUT`
`protected org.apache.axis.ime.internal.MessageExchangeImpl.Holder` `holder`
`protected static org.apache.commons.logging.Log` `log`
`static long` `NO_TIMEOUT`

Constructor Summary
`MessageExchangeImpl(MessageExchangeProvider provider)`

Method Summary
`void` `awaitShutdown()` Block indefinitely until shutdown is complete.
`void` `awaitShutdown(long timeout)` Block for the specified amount of time or until shutdown is complete
`void` `cleanup()` Cleanup
`void` `clearOptions()` Unsupported for now
`MessageExchangeEventListener` `getMessageExchangeEventListener()` see org.apache.axis.ime.MessageExchange#getMessageExchangeStatusListener()
`java.lang.Object` `getOption(java.lang.String OptionId)` Unsupported for now
`java.lang.Object` `getOption(java.lang.String OptionId, java.lang.Object defaultValue)` Unsupported for now
`java.util.Hashtable` `getOptions()` Unsupported for now
`void` `init()` Initialize the lifecycle.
`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)` see org.apache.axis.ime.MessageExchange#setMessageExchangeFaultListener(MessageExchangeFaultListener)
`void` `setOption(java.lang.String OptionId, java.lang.Object OptionValue)` Unsupported for now
`void` `setOptions(java.util.Hashtable options)` Unsupported for now
`void` `shutdown()` Performs a "safe shutdown", allowing all current activities to complete.
`void` `shutdown(boolean force)` Performs an "unsafe shutdown", interrupting all current activities without letting them complete

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### log

    protected static org.apache.commons.logging.Log log

### NO_TIMEOUT

    public static final long NO_TIMEOUT

See Also:
  Constant Field Values

### DEFAULT_TIMEOUT

    public static final long DEFAULT_TIMEOUT

See Also:
  Constant Field Values

### holder

    protected org.apache.axis.ime.internal.MessageExchangeImpl.Holder holder

Constructor Detail

### MessageExchangeImpl

    public MessageExchangeImpl(MessageExchangeProvider provider)

Method Detail

### send

    public MessageExchangeCorrelator send(MessageContext context)
                                   throws AxisFault

  Description copied from interface: `MessageExchange`
  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.)

  Specified by:
    `send` in interface `MessageExchange`
  Returns:
    MessageExchangeCorrelator The correlator for the sent MessageContext
  Throws:
    `AxisFault`
  See Also:
    `MessageExchange.send(MessageContext)`

### send

    public MessageExchangeCorrelator send(MessageContext context,
                                          MessageExchangeEventListener listener)
                                   throws AxisFault

  Description copied from interface: `MessageExchange`
  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.)

  Specified by:
    `send` in interface `MessageExchange`
  Returns:
    MessageExchangeCorrelator The correlator for the sent MessageContext
  Throws:
    `AxisFault`
  See Also:
    `MessageExchange.send(MessageContext)`

### receive

    public MessageContext receive()
                           throws AxisFault

  Description copied from interface: `MessageExchange`
  Waits indefinitely for a message to be received (blocking)

  Specified by:
    `receive` in interface `MessageExchange`
  Returns:
    MessageContext The received MessageContext
  Throws:
    `AxisFault`
  See Also:
    `MessageExchange.receive()`

### receive

    public MessageContext receive(long timeout)
                           throws AxisFault

  Description copied from interface: `MessageExchange`
  Waits the specified amount of time for a message to be received (blocking)

  Specified by:
    `receive` in interface `MessageExchange`
  Returns:
    MessageContext The received MessageContext
  Throws:
    `AxisFault`
  See Also:
    `MessageExchange.receive(long)`

### receive

    public MessageContext receive(MessageExchangeCorrelator correlator)
                           throws AxisFault

  Description copied from interface: `MessageExchange`
  Waits indefinitely for a message matching the specified correlator (blocking)

  Specified by:
    `receive` in interface `MessageExchange`
  Returns:
    MessageContext
  Throws:
    `AxisFault`
  See Also:
    `MessageExchange.receive(MessageExchangeCorrelator)`

### receive

    public MessageContext receive(MessageExchangeCorrelator correlator,
                                  long timeout)
                           throws AxisFault

  Description copied from interface: `MessageExchange`
  Waits the specified amount of time for a message matching the specified correlator (blocking)

  Specified by:
    `receive` in interface `MessageExchange`
  Throws:
    `AxisFault`
  See Also:
    `MessageExchange.receive(MessageExchangeCorrelator,long)`

### receive

    public void receive(MessageExchangeEventListener listener)
                 throws AxisFault

  Description copied from interface: `MessageExchange`
  Registers a listener for receiving messages (nonblocking)

  Specified by:
    `receive` in interface `MessageExchange`
  Throws:
    `AxisFault`
  See Also:
    `org.apache.axis.ime.MessageExchange#receive(MessageContextListener)`

### receive

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

  Description copied from interface: `MessageExchange`
  Registers a listener for receiving messages (nonblocking)

  Specified by:
    `receive` in interface `MessageExchange`
  Throws:
    `AxisFault`
  See Also:
    `org.apache.axis.ime.MessageExchange#receive(MessageExchangeCorrelator,MessageContextListener)`

### sendAndReceive

    public MessageContext sendAndReceive(MessageContext context)
                                  throws AxisFault

  Description copied from interface: `MessageExchange`
  Synchronized send and receive

  Specified by:
    `sendAndReceive` in interface `MessageExchange`
  Returns:
    MessageContext The received MessageContext (not guaranteed to be the same object instance as the sent MessageContext)
  Throws:
    `AxisFault`
  See Also:
    `MessageExchange.sendAndReceive(MessageContext)`

### sendAndReceive

    public MessageContext sendAndReceive(MessageContext context,
                                         long timeout)
                                  throws AxisFault

  Description copied from interface: `MessageExchange`
  Synchronized send and receive with timeout

  Specified by:
    `sendAndReceive` in interface `MessageExchange`
  Returns:
    MessageContext The received MessageContext (not guaranteed to be the same object instance as the sent MessageContext)
  Throws:
    `AxisFault`
  See Also:
    `MessageExchange.sendAndReceive(MessageContext,long)`

### setMessageExchangeEventListener

    public void setMessageExchangeEventListener(MessageExchangeEventListener listener)

  see org.apache.axis.ime.MessageExchange#setMessageExchangeFaultListener(MessageExchangeFaultListener)

  Specified by:
    `setMessageExchangeEventListener` in interface `MessageExchange`

### getMessageExchangeEventListener

    public MessageExchangeEventListener getMessageExchangeEventListener()

  see org.apache.axis.ime.MessageExchange#getMessageExchangeStatusListener()

  Specified by:
    `getMessageExchangeEventListener` in interface `MessageExchange`

### setOption

    public void setOption(java.lang.String OptionId,
                          java.lang.Object OptionValue)

  Unsupported for now

  Specified by:
    `setOption` in interface `MessageExchange`
  See Also:

### getOption

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

  Unsupported for now

  Specified by:
    `getOption` in interface `MessageExchange`
  Returns:
    Object The value of the Option
  See Also:

### getOption

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

  Unsupported for now

  Specified by:
    `getOption` in interface `MessageExchange`
  Returns:
    Object The value of the Option
  See Also:

### getOptions

    public java.util.Hashtable getOptions()

  Unsupported for now

  Specified by:
    `getOptions` in interface `MessageExchange`
  Returns:
    java.lang.Hashtable The collection of properties
  See Also:

### setOptions

    public void setOptions(java.util.Hashtable options)

  Unsupported for now

  Specified by:
    `setOptions` in interface `MessageExchange`
  See Also:

### clearOptions

    public void clearOptions()

  Unsupported for now

  Specified by:
    `clearOptions` in interface `MessageExchange`
  See Also:

### awaitShutdown

    public void awaitShutdown()
                       throws java.lang.InterruptedException

  Description copied from interface: `MessageExchangeLifecycle`
  Block indefinitely until shutdown is complete.

  Specified by:
    `awaitShutdown` in interface `MessageExchangeLifecycle`
    `java.lang.InterruptedException`
  See Also:
    `MessageExchangeLifecycle.awaitShutdown()`

### cleanup

    public void cleanup()
                 throws java.lang.InterruptedException

  Description copied from interface: `MessageExchangeLifecycle`
  Cleanup

  Specified by:
    `cleanup` in interface `MessageExchangeLifecycle`
    `java.lang.InterruptedException`
  See Also:
    `MessageExchangeLifecycle.cleanup()`

### awaitShutdown

    public void awaitShutdown(long timeout)
                       throws java.lang.InterruptedException

  Description copied from interface: `MessageExchangeLifecycle`
  Block for the specified amount of time or until shutdown is complete

  Specified by:
    `awaitShutdown` in interface `MessageExchangeLifecycle`
    `java.lang.InterruptedException`
  See Also:
    `MessageExchangeLifecycle.awaitShutdown(long)`

### init

    public void init()

  Description copied from interface: `MessageExchangeLifecycle`
  Initialize the lifecycle. (Create threads, etc)

  Specified by:
    `init` in interface `MessageExchangeLifecycle`
  See Also:
    `MessageExchangeLifecycle.init()`

### shutdown

    public void shutdown()

  Description copied from interface: `MessageExchangeLifecycle`
  Performs a "safe shutdown", allowing all current activities to complete.

  Specified by:
    `shutdown` in interface `MessageExchangeLifecycle`
  See Also:
    `MessageExchangeLifecycle.shutdown()`

### shutdown

    public void shutdown(boolean force)

  Description copied from interface: `MessageExchangeLifecycle`
  Performs an "unsafe shutdown", interrupting all current activities without letting them complete

  Specified by:
    `shutdown` in interface `MessageExchangeLifecycle`
  See Also:
    `MessageExchangeLifecycle.shutdown(boolean)`

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