DefaultMuleConnection (Mule ESB 2.2.1 API)
Keywords: org.mule.module.jca.DefaultMuleConnection class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.module.jca
Class DefaultMuleConnection

    java.lang.Object
      org.mule.module.jca.DefaultMuleConnection

All Implemented Interfaces:
  MuleConnection

    public class DefaultMuleConnection

extends Object
implements MuleConnection

`MuleConnection` TODO

Constructor Summary
`DefaultMuleConnection(MuleManagedConnection managedConnection, MuleContext muleContext, MuleCredentials credentials)`

Method Summary
`void` | `associateConnection(MuleManagedConnection newMc)` Associates connection handle with new managed connection.
`void` | `close()` Closes the connection.
`void` | `dispatch(String url, Object payload, Map messageProperties)` Dispatches an event asynchronously to a endpointUri via a mule server.
`protected MuleEvent` | `getEvent(MuleMessage message, String uri, boolean synchronous)` Packages a mule event for the current request
`MuleManagedConnection` | `getManagedConnection()` Retrieves a ManagedConnection.
`MuleMessage` | `request(String url, long timeout)` Will receive an event from an endpointUri determined by the url
`MuleMessage` | `send(String url, Object payload, Map messageProperties)` Sends an object (payload) synchronous to the given url and returns a MuleMessage response back.

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

Constructor Detail

### DefaultMuleConnection

    public DefaultMuleConnection(MuleManagedConnection managedConnection,
                                 MuleContext muleContext,
                                 MuleCredentials credentials)

Method Detail

### dispatch

    public void dispatch(String url,
                         Object payload,
                         Map messageProperties)
                  throws MuleException

  Dispatches an event asynchronously to a endpointUri via a mule server. the Url determines where to dispathc the event to, this can be in the form of

  Specified by:
    `dispatch` in interface `MuleConnection`
  Parameters:
    `url` - the Mule url used to determine the destination and transport of the message
    `payload` - the object that is the payload of the event
    `messageProperties` - any properties to be associated with the payload. In the case of Jms you could set the JMSReplyTo property in these properties.
  Throws:
    `MuleException`

### send

    public MuleMessage send(String url,
                            Object payload,
                            Map messageProperties)
                     throws MuleException

  Sends an object (payload) synchronous to the given url and returns a MuleMessage response back.

  Specified by:
    `send` in interface `MuleConnection`
  Parameters:
    `url` - the Mule url used to determine the destination and transport of the message
    `payload` - the object that is the payload of the event
    `messageProperties` - any properties to be associated with the payload. In the case of Jms you could set the JMSReplyTo property in these properties.
  Returns:
    a response.
  Throws:
    `MuleException`

### request

    public MuleMessage request(String url,
                               long timeout)
                        throws MuleException

  Will receive an event from an endpointUri determined by the url

  Specified by:
    `request` in interface `MuleConnection`
  Parameters:
    `url` - the Mule url used to determine the destination and transport of the message
    `timeout` - how long to block waiting to receive the event, if set to 0 the receive will not wait at all and if set to -1 the receive will wait forever
  Returns:
    the message received or null if no message was received
  Throws:
    `MuleException`

### getEvent

    protected MuleEvent getEvent(MuleMessage message,
                                 String uri,
                                 boolean synchronous)
                          throws MuleException

  Packages a mule event for the current request

  Parameters:
    `message` - the event payload
    `uri` - the destination endpointUri
    `synchronous` - whether the event will be synchronously processed
  Returns:
    the MuleEvent
  Throws:
    `MuleException` - in case of Mule error

### getManagedConnection

    public MuleManagedConnection getManagedConnection()

  Retrieves a ManagedConnection.

  Specified by:
    `getManagedConnection` in interface `MuleConnection`
  Returns:
    a ManagedConnection instance representing the physical connection to the EIS

### close

    public void close()
               throws ResourceException

  Closes the connection.

  Specified by:
    `close` in interface `MuleConnection`
  Throws:
    `ResourceException`

### associateConnection

    public void associateConnection(MuleManagedConnection newMc)
                             throws ResourceException

  Associates connection handle with new managed connection.

  Specified by:
    `associateConnection` in interface `MuleConnection`
  Parameters:
    `newMc` - new managed connection
  Throws:
    `ResourceException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.