org.mule.api
Interface MuleSession

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultMuleSession

public interface MuleSession
extends Serializable

MuleSession 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 MuleEventContext which is obtainable via the UMOManager or by implementing org.mule.api.lifecycle.Callable.


Method Summary
 FlowConstruct getFlowConstruct()
          Returns the Service associated with the session in its current execution
 String getId()
          Returns the unique id for this session
<T> T
getProperty(Object key)
          Will retrieve a session level property.
 Iterator getPropertyNames()
          Deprecated. Use getPropertyNamesAsSet() instead
 Set<String> getPropertyNamesAsSet()
           
 SecurityContext getSecurityContext()
          The security context for this session.
 boolean isValid()
          Determines if this session is valid.
 void merge(MuleSession updatedSession)
          Merge current session with an updated version Result session will contain all the properties from updatedSession plus those properties in the current session that couldn't be serialized In case updatedSession is null, then no change will be applied.
 Object removeProperty(Object key)
          Will retrieve a session level property and remove it from the session
 void setFlowConstruct(FlowConstruct flowConstruct)
          Sets the Service associated with the session in its current execution
 void setProperty(String key, Object value)
          Will set a session level property.
 void setSecurityContext(SecurityContext context)
          The security context for this session.
 void setValid(boolean value)
          Determines if this session is valid.
 

Method Detail

getFlowConstruct

FlowConstruct getFlowConstruct()
Returns the Service associated with the session in its current execution

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

setFlowConstruct

void setFlowConstruct(FlowConstruct flowConstruct)
Sets the Service associated with the session in its current execution

See Also:
FlowConstruct

isValid

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

Returns:
true if the service 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 service is functioning properly, false otherwise

getId

String getId()
Returns the unique id for this session

Returns:
the unique id for this session

setSecurityContext

void setSecurityContext(SecurityContext 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

SecurityContext 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(String 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

<T> T 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()
Deprecated. Use getPropertyNamesAsSet() instead

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

getPropertyNamesAsSet

Set<String> getPropertyNamesAsSet()
Returns:
property keys for all session properties

merge

void merge(MuleSession updatedSession)
Merge current session with an updated version Result session will contain all the properties from updatedSession plus those properties in the current session that couldn't be serialized In case updatedSession is null, then no change will be applied.

Parameters:
updatedSession - mule session with updated properties


Copyright © 2003-2011 MuleSoft, Inc.. All Rights Reserved.