org.mule.umo
Interface UMOSession

All Superinterfaces:
Serializable
All Known Implementing Classes:
MuleSession

public interface UMOSession
extends Serializable

UMOSession is the context in which a request is executed. The session manages the marshalling of events to and from components This object is not usually referenced by client code directly. If needed Components should manage events via the UMOEventContext which is obtainable via the UMOManager or by implementing org.mule.umo.lifecycle.Callable.


Method Summary
 UMOEvent createOutboundEvent(UMOMessage message, UMOImmutableEndpoint 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, 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, UMOImmutableEndpoint 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
 String getId()
          Returns the unique id for this session
 Object getProperty(Object key)
          Will retrieve a session level property.
 Iterator getPropertyNames()
          Returns an iterater of property keys for the session properties on this session
 UMOSecurityContext getSecurityContext()
          The security context for this session.
 boolean isValid()
          Determines if this session is valid.
 UMOMessage receiveEvent(String endpointName, long timeout)
          Requests a synchronous receive of an event on the component
 UMOMessage receiveEvent(UMOImmutableEndpoint endpoint, long timeout)
          Requests a synchronous receive of an event on the component
 Object removeProperty(Object key)
          Will retrieve a session level property and remove it from the session
 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, 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, UMOImmutableEndpoint 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 setProperty(Object key, Object value)
          Will set a session level property.
 void setSecurityContext(UMOSecurityContext context)
          The security context for this session.
 void setValid(boolean value)
          Determines if this session is valid.
 

Method Detail

getComponent

UMOComponent getComponent()
Returns the UMOComponent associated with the session in its current execution

Returns:
the UMOComponent associated with the session in its current execution
See Also:
UMOComponent

sendEvent

UMOMessage sendEvent(UMOMessage message)
                     throws UMOException
This will send an event via the configured outbound endpoint on the component for this session

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

UMOMessage sendEvent(UMOEvent event)
                     throws UMOException
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

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

sendEvent

UMOMessage sendEvent(UMOMessage message,
                     UMOImmutableEndpoint endpoint)
                     throws UMOException
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

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

sendEvent

UMOMessage sendEvent(UMOMessage message,
                     String endpointName)
                     throws UMOException
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

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

dispatchEvent

void dispatchEvent(UMOMessage message)
                   throws UMOException
This will dispatch an event asynchronously via the configured outbound endpoint on the component for this session

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

void dispatchEvent(UMOEvent event)
                   throws UMOException
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

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

dispatchEvent

void dispatchEvent(UMOMessage message,
                   UMOImmutableEndpoint endpoint)
                   throws UMOException
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

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

dispatchEvent

void dispatchEvent(UMOMessage message,
                   String endpointName)
                   throws UMOException
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

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

receiveEvent

UMOMessage receiveEvent(UMOImmutableEndpoint endpoint,
                        long timeout)
                        throws UMOException
Requests a synchronous receive of an event on the component

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

receiveEvent

UMOMessage receiveEvent(String endpointName,
                        long timeout)
                        throws UMOException
Requests a synchronous receive of an event on the component

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

isValid

boolean isValid()
Determines if this session is valid. A session becomes invalid if an exception occurs while processing

Returns:
true if the component is functioning properly, false otherwise

setValid

void setValid(boolean value)
Determines if this session is valid. A session becomes invalid if an exception occurs while processing

Parameters:
value - true if the component is functioning properly, false otherwise

createOutboundEvent

UMOEvent createOutboundEvent(UMOMessage message,
                             UMOImmutableEndpoint endpoint,
                             UMOEvent previousEvent)
                             throws UMOException
Creates an outbound event for this session

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

getId

String getId()
Returns the unique id for this session

Returns:
the unique id for this session

setSecurityContext

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

Parameters:
context - the context for this session or null if the request is not secure.

getSecurityContext

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

Returns:
the context for this session or null if the request is not secure.

setProperty

void setProperty(Object key,
                 Object value)
Will set a session level property. These will either be stored and retrieved using the underlying transport mechanism of stored using a default mechanism

Parameters:
key - the key for the object data being stored on the session
value - the value of the session data

getProperty

Object getProperty(Object key)
Will retrieve a session level property.

Parameters:
key - the key for the object data being stored on the session
Returns:
the value of the session data or null if the property does not exist

removeProperty

Object removeProperty(Object key)
Will retrieve a session level property and remove it from the session

Parameters:
key - the key for the object data being stored on the session
Returns:
the value of the session data or null if the property does not exist

getPropertyNames

Iterator getPropertyNames()
Returns an iterater of property keys for the session properties on this session

Returns:
an iterater of property keys for the session properties on this session


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