org.mule.ra
Class DefaultMuleConnection

java.lang.Object
  extended byorg.mule.ra.DefaultMuleConnection
All Implemented Interfaces:
MuleConnection

public class DefaultMuleConnection
extends java.lang.Object
implements MuleConnection

MuleConnection TODO

Version:
$Revision: 1.3 $
Author:
Ross Mason

Constructor Summary
DefaultMuleConnection(MuleManagedConnection managedConnection, UMOManager manager, MuleCredentials credentials)
           
 
Method Summary
 void associateConnection(MuleManagedConnection newMc)
          Associates connection handle with new managed connection.
 void close()
          Closes the connection.
 void dispatch(java.lang.String url, java.lang.Object payload, java.util.Map messageProperties)
          Dispatches an event asynchronously to a endpointUri via a mule server.
protected  UMOEvent getEvent(UMOMessage message, UMOEndpointURI uri, boolean synchronous)
          Packages a mule event for the current request
 MuleManagedConnection getManagedConnection()
          Retrieves a ManagedConnection.
 UMOMessage receive(java.lang.String url, long timeout)
          Will receive an event from an endpointUri determined by the url
 
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,
                             UMOManager manager,
                             MuleCredentials credentials)
Method Detail

dispatch

public void dispatch(java.lang.String url,
                     java.lang.Object payload,
                     java.util.Map messageProperties)
              throws UMOException
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:
UMOException

receive

public UMOMessage receive(java.lang.String url,
                          long timeout)
                   throws UMOException
Will receive an event from an endpointUri determined by the url

Specified by:
receive 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:
UMOException

getEvent

protected UMOEvent getEvent(UMOMessage message,
                            UMOEndpointURI uri,
                            boolean synchronous)
                     throws UMOException
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 UMOEvent
Throws:
UMOException

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


Copyright © 2003-2005 SymphonySoft Limited. All Rights Reserved.