org.mule.session
Class DefaultMuleSession

java.lang.Object
  extended by org.mule.session.DefaultMuleSession
All Implemented Interfaces:
java.io.Serializable, MuleSession, DeserializationPostInitialisable

public final class DefaultMuleSession
extends java.lang.Object
implements MuleSession, DeserializationPostInitialisable

DefaultMuleSession manages the interaction and distribution of events for Mule Services.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.mule.util.store.DeserializationPostInitialisable
DeserializationPostInitialisable.Implementation
 
Constructor Summary
DefaultMuleSession(FlowConstruct flowConstruct, MuleContext muleContext)
           
DefaultMuleSession(MuleContext muleContext)
           
DefaultMuleSession(MuleMessage message, SessionHandler requestSessionHandler, FlowConstruct flowConstruct, MuleContext muleContext)
          Deprecated. Use DefaultMuleSession(Service service, MuleContext muleContext) instead
DefaultMuleSession(MuleMessage message, SessionHandler requestSessionHandler, MuleContext muleContext)
          Deprecated. Use DefaultMuleSession(MuleContext muleContext) instead
DefaultMuleSession(MuleSession session, MuleContext muleContext)
           
 
Method Summary
 FlowConstruct getFlowConstruct()
          Returns the Service associated with the session in its current execution
 java.lang.String getId()
          Returns the unique id for this session
<T> T
getProperty(java.lang.Object key)
          Will retrieve a session level property.
 java.util.Iterator<java.lang.String> getPropertyNames()
          Deprecated. Use getPropertyNamesAsSet() instead
 java.util.Set<java.lang.String> getPropertyNamesAsSet()
           
 SecurityContext getSecurityContext()
          The security context for this session.
 void initAfterDeserialisation(MuleContext muleContext)
          Invoked after deserialization.
 boolean isValid()
          Determines if this session is valid.
 java.lang.Object removeProperty(java.lang.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(java.lang.String key, java.lang.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMuleSession

public DefaultMuleSession(MuleContext muleContext)

DefaultMuleSession

public DefaultMuleSession(FlowConstruct flowConstruct,
                          MuleContext muleContext)

DefaultMuleSession

@Deprecated
public DefaultMuleSession(MuleMessage message,
                                     SessionHandler requestSessionHandler,
                                     FlowConstruct flowConstruct,
                                     MuleContext muleContext)
                   throws MuleException
Deprecated. Use DefaultMuleSession(Service service, MuleContext muleContext) instead

Throws:
MuleException

DefaultMuleSession

@Deprecated
public DefaultMuleSession(MuleMessage message,
                                     SessionHandler requestSessionHandler,
                                     MuleContext muleContext)
                   throws MuleException
Deprecated. Use DefaultMuleSession(MuleContext muleContext) instead

Throws:
MuleException

DefaultMuleSession

public DefaultMuleSession(MuleSession session,
                          MuleContext muleContext)
Method Detail

getId

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

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

isValid

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

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

setValid

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

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

getFlowConstruct

public FlowConstruct getFlowConstruct()
Description copied from interface: MuleSession
Returns the Service associated with the session in its current execution

Specified by:
getFlowConstruct in interface MuleSession
Returns:
Returns the service.
See Also:
FlowConstruct

setFlowConstruct

public void setFlowConstruct(FlowConstruct flowConstruct)
Description copied from interface: MuleSession
Sets the Service associated with the session in its current execution

Specified by:
setFlowConstruct in interface MuleSession
See Also:
FlowConstruct

setSecurityContext

public 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

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

getSecurityContext

public SecurityContext 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 MuleSession
Returns:
the context for this session or null if the request is not secure.

setProperty

public void setProperty(java.lang.String key,
                        java.lang.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

Specified by:
setProperty in interface MuleSession
Parameters:
key - the key for the object data being stored on the session
value - the value of the session data

getProperty

public <T> T getProperty(java.lang.Object key)
Will retrieve a session level property.

Specified by:
getProperty in interface MuleSession
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

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

Specified by:
removeProperty in interface MuleSession
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

@Deprecated
public java.util.Iterator<java.lang.String> getPropertyNames()
Deprecated. Use getPropertyNamesAsSet() instead

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

Specified by:
getPropertyNames in interface MuleSession
Returns:
an iterater of property keys for the session properties on this session

getPropertyNamesAsSet

public java.util.Set<java.lang.String> getPropertyNamesAsSet()
Specified by:
getPropertyNamesAsSet in interface MuleSession
Returns:
property keys for all session properties

initAfterDeserialisation

public void initAfterDeserialisation(MuleContext muleContext)
                              throws MuleException
Invoked after deserialization. This is called when the marker interface DeserializationPostInitialisable is used. This will get invoked after the object has been deserialized passing in the current mulecontext when using either SerializationWireFormat, SerializedMuleMessageWireFormat, or the ByteArrayToSerializable transformer.

Parameters:
muleContext - the current muleContext instance
Throws:
MuleException - if there is an error initializing


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