org.mule.impl
Class MuleSession

java.lang.Object
  extended byorg.mule.impl.MuleSession
All Implemented Interfaces:
java.io.Serializable, UMOSession

public final class MuleSession
extends java.lang.Object
implements UMOSession

MuleSession manages the interaction and distribution of events for Mule UMOs.

Version:
$Revision: 1.4 $
Author:
Ross Mason
See Also:
Serialized Form

Constructor Summary
MuleSession()
           
MuleSession(UMOComponent component, UMOTransaction transaction)
           
 
Method Summary
 UMOEvent createOutboundEvent(UMOMessage message, UMOEndpoint endpoint, UMOEvent previousEvent)
          Creates an outbound event for this session
 void dispatchEvent(UMOEvent event)
          Depending on the session state this methods either Passes an event asynchronously to the next available Mule UMO in the pool or via the endpoint configured for the event
 void dispatchEvent(UMOMessage message)
          This will dispatch an event asynchronously via the configured outbound endpoint on the component for this session
 void dispatchEvent(UMOMessage message, java.lang.String endpointName)
          Depending on the session state this methods either Passes an event asynchronously to the next available Mule UMO in the pool or via the endpoint configured for the event
 void dispatchEvent(UMOMessage message, UMOEndpoint endpoint)
          Depending on the session state this methods either Passes an event asynchronously to the next available Mule UMO in the pool or via the endpoint configured for the event
 UMOComponent getComponent()
          Returns the UMOComponent associated with the session in its current execution
 java.lang.String getId()
          Returns the unique id for this session
 UMOSecurityContext getSecurityContext()
          The security context for this session.
 boolean isValid()
          Determines if this session is valid.
 UMOMessage receiveEvent(java.lang.String endpointName, long timeout)
          Requests a synchronous receive of an event on the component
 UMOMessage receiveEvent(UMOEndpoint endpoint, long timeout)
          Requests a synchronous receive of an event on the component
 UMOMessage sendEvent(UMOEvent event)
          Depending on the session state this methods either Passes an event synchronously to the next available Mule UMO in the pool or via the endpoint configured for the event
 UMOMessage sendEvent(UMOMessage message)
          This will send an event via the configured outbound endpoint on the component for this session
 UMOMessage sendEvent(UMOMessage message, java.lang.String endpointName)
          Depending on the session state this methods either Passes an event synchronously to the next available Mule UMO in the pool or via the endpoint configured for the event
 UMOMessage sendEvent(UMOMessage message, UMOEndpoint endpoint)
          Depending on the session state this methods either Passes an event synchronously to the next available Mule UMO in the pool or via the endpoint configured for the event
 void setSecurityContext(UMOSecurityContext context)
          The security context for this session.
 void setValid(boolean value)
          Determines if this session is valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MuleSession

public MuleSession()

MuleSession

public MuleSession(UMOComponent component,
                   UMOTransaction transaction)
Method Detail

dispatchEvent

public void dispatchEvent(UMOMessage message)
                   throws UMOException
Description copied from interface: UMOSession
This will dispatch an event asynchronously via the configured outbound endpoint on the component for this session

Specified by:
dispatchEvent in interface UMOSession
Parameters:
message - the message to send
Throws:
UMOException - if there is no outbound endpoint configured on the component or the events fails during dispatch

dispatchEvent

public void dispatchEvent(UMOMessage message,
                          java.lang.String endpointName)
                   throws UMOException
Description copied from interface: UMOSession
Depending on the session state this methods either Passes an event asynchronously to the next available Mule UMO in the pool or via the endpoint configured for the event

Specified by:
dispatchEvent in interface UMOSession
Parameters:
message - the event message payload to send
endpointName - The endpoint name to disptch the event through. This will be looked up first on the component configuration and then on the mule manager configuration
Throws:
UMOException - if the event fails to be processed by the component or the transport for the endpoint

dispatchEvent

public void dispatchEvent(UMOMessage message,
                          UMOEndpoint endpoint)
                   throws UMOException
Description copied from interface: UMOSession
Depending on the session state this methods either Passes an event asynchronously to the next available Mule UMO in the pool or via the endpoint configured for the event

Specified by:
dispatchEvent in interface UMOSession
Parameters:
message - the event message payload to send
endpoint - The endpoint name to disptch the event through
Throws:
UMOException - if the event fails to be processed by the component or the transport for the endpoint

sendEvent

public UMOMessage sendEvent(UMOMessage message,
                            java.lang.String endpointName)
                     throws UMOException
Description copied from interface: UMOSession
Depending on the session state this methods either Passes an event synchronously to the next available Mule UMO in the pool or via the endpoint configured for the event

Specified by:
sendEvent in interface UMOSession
Parameters:
message - the event message payload to send
endpointName - The endpoint name to disptch the event through. This will be looked up first on the component configuration and then on the mule manager configuration
Returns:
the return Message from the call or null if there was no result
Throws:
UMOException - if the event fails to be processed by the component or the transport for the endpoint

sendEvent

public UMOMessage sendEvent(UMOMessage message)
                     throws UMOException
Description copied from interface: UMOSession
This will send an event via the configured outbound endpoint on the component for this session

Specified by:
sendEvent in interface UMOSession
Parameters:
message - the message to send
Returns:
the result of the send if any
Throws:
UMOException - if there is no outbound endpoint configured on the component or the events fails during dispatch

sendEvent

public UMOMessage sendEvent(UMOMessage message,
                            UMOEndpoint endpoint)
                     throws UMOException
Description copied from interface: UMOSession
Depending on the session state this methods either Passes an event synchronously to the next available Mule UMO in the pool or via the endpoint configured for the event

Specified by:
sendEvent in interface UMOSession
Parameters:
message - the event message payload to send
endpoint - The endpoint to disptch the event through
Returns:
the return Message from the call or null if there was no result
Throws:
UMOException - if the event fails to be processed by the component or the transport for the endpoint

dispatchEvent

public void dispatchEvent(UMOEvent event)
                   throws UMOException
Description copied from interface: UMOSession
Depending on the session state this methods either Passes an event asynchronously to the next available Mule UMO in the pool or via the endpoint configured for the event

Specified by:
dispatchEvent in interface UMOSession
Parameters:
event - the event message payload to send first on the component configuration and then on the mule manager configuration
Throws:
UMOException - if the event fails to be processed by the component or the transport for the endpoint

getId

public java.lang.String getId()
Description copied from interface: UMOSession
Returns the unique id for this session

Specified by:
getId in interface UMOSession
Returns:
the unique id for this session

sendEvent

public UMOMessage sendEvent(UMOEvent event)
                     throws UMOException
Description copied from interface: UMOSession
Depending on the session state this methods either Passes an event synchronously to the next available Mule UMO in the pool or via the endpoint configured for the event

Specified by:
sendEvent in interface UMOSession
Parameters:
event - the event to process
Returns:
the return Message from the call or null if there was no result
Throws:
UMOException - if the event fails to be processed by the component or the transport for the endpoint

isValid

public boolean isValid()
Description copied from interface: UMOSession
Determines if this session is valid. A session becomes invalid if an exception occurs while processing

Specified by:
isValid in interface UMOSession
Returns:
true if the component is functioning properly, false otherwise

setValid

public void setValid(boolean value)
Description copied from interface: UMOSession
Determines if this session is valid. A session becomes invalid if an exception occurs while processing

Specified by:
setValid in interface UMOSession
Parameters:
value - true if the component is functioning properly, false otherwise

receiveEvent

public UMOMessage receiveEvent(java.lang.String endpointName,
                               long timeout)
                        throws UMOException
Description copied from interface: UMOSession
Requests a synchronous receive of an event on the component

Specified by:
receiveEvent in interface UMOSession
Parameters:
endpointName - the endpoint name identifing the endpointUri on ewhich the event will be received
timeout - time in milliseconds before the request timesout
Returns:
The requested event or null if the request times out
Throws:
UMOException - if the request operation fails

receiveEvent

public UMOMessage receiveEvent(UMOEndpoint endpoint,
                               long timeout)
                        throws UMOException
Description copied from interface: UMOSession
Requests a synchronous receive of an event on the component

Specified by:
receiveEvent in interface UMOSession
Parameters:
endpoint - the endpoint identifing the endpointUri on ewhich the event will be received
timeout - time in milliseconds before the request timesout
Returns:
The requested event or null if the request times out
Throws:
UMOException - if the request operation fails

createOutboundEvent

public UMOEvent createOutboundEvent(UMOMessage message,
                                    UMOEndpoint endpoint,
                                    UMOEvent previousEvent)
                             throws UMOException
Description copied from interface: UMOSession
Creates an outbound event for this session

Specified by:
createOutboundEvent in interface UMOSession
Parameters:
message - the event messgae payload
endpoint - the endpoint to send/dispatch through
previousEvent - the previous event (if any) on this session
Returns:
the event to send/dispatch
Throws:
UMOException - if the evnet cannot be created

getComponent

public UMOComponent getComponent()
Description copied from interface: UMOSession
Returns the UMOComponent associated with the session in its current execution

Specified by:
getComponent in interface UMOSession
Returns:
Returns the component.
See Also:
UMOComponent

setSecurityContext

public void setSecurityContext(UMOSecurityContext context)
The security context for this session. If not null outbound, inbound and/or method invocations will be authenticated using this context

Specified by:
setSecurityContext in interface UMOSession
Parameters:
context - the context for this session or null if the request is not secure.

getSecurityContext

public UMOSecurityContext getSecurityContext()
The security context for this session. If not null outbound, inbound and/or method invocations will be authenticated using this context

Specified by:
getSecurityContext in interface UMOSession
Returns:
the context for this session or null if the request is not secure.


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