***  This class provides Binary Compatibility only, not Source Compatibility  ***

com.sas.services.session
Class SessionContextStateChangedEvent

com.sas.services.session.SessionContextStateChangedEvent
All Implemented Interfaces:
java.io.Serializable

public class SessionContextStateChangedEvent
implements java.io.Serializable

Sent to an object that implements RemoteSessionContextStateChangedListener when the object's state changes within the session context; currently, this is when the object is removed from the session context or when the session context is destroyed.

The session context binds the object by a call to SessionContextInterface.setAttribute(Object) and removes the object by a call to SessionContextInterface.removeAttribute(String) or SessionContextInterface.destroy.

Since:
1.0
See Also:
Serialized Form

Field Summary
static int OBJECT_REMOVED
          Object removed.
static long serialVersionUID
          Serial version ID.
static int SESSION_CONTEXT_DESTROYED
          Session context destroyed.
 
Constructor Summary
SessionContextStateChangedEvent(SessionContextInterface sessionContext, java.lang.String name, java.lang.Object object, int stateChange)
          Constructs an event that notifies an object that its state has changed within the session context; currently, this is when the object is removed from the session context.
 
Method Summary
 java.lang.String getName()
          Returns the name with which the object is bound in the session context.
 java.lang.Object getObject()
          Returns the object that was bound to the session context.
 SessionContextInterface getSessionContext()
          Returns the session context from which the object is removed.
 java.lang.Object getSource()
          Returns the object that originated the event.
 int getStateChange()
          Returns the type of state change that occurred.
 java.lang.String toString()
          Returns a String representation of this SessionContextStateChangedEvent.
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Serial version ID. This value should be changed if backward compatibility with previosly serialized versions is no longer desired.

See Also:
Constant Field Values

OBJECT_REMOVED

public static final int OBJECT_REMOVED
Object removed.

See Also:
Constant Field Values

SESSION_CONTEXT_DESTROYED

public static final int SESSION_CONTEXT_DESTROYED
Session context destroyed.

See Also:
Constant Field Values
Constructor Detail

SessionContextStateChangedEvent

public SessionContextStateChangedEvent(SessionContextInterface sessionContext,
                                       java.lang.String name,
                                       java.lang.Object object,
                                       int stateChange)
Constructs an event that notifies an object that its state has changed within the session context; currently, this is when the object is removed from the session context.

If an object added to a session context with SessionContextInterface.setAttribute(Object) implements RemoteSessionContextStateChangedListener, the session context will invoke RemoteSessionContextStateChangedListener.contextStateChanged(SessionContextStateChangedEvent) when the session context is destroyed or when the object is removed from the session context. This notification will allow the object to cleanup any resources that are necessary.

Parameters:
sessionContext - The session context to which the object is bound.
name - The name with which the object is bound in the session context.
object - The bound object.
stateChange - The type of state change, either SESSION_CONTEXT_DESTROYEDor OBJECT_REMOVED.
Method Detail

getName

public java.lang.String getName()
Returns the name with which the object is bound in the session context.

Returns:
String The name with which the object is bound in the session context.

getSessionContext

public SessionContextInterface getSessionContext()
Returns the session context from which the object is removed.

Returns:
SessionContextInterface The session context from which the object is unbound.

getObject

public java.lang.Object getObject()
Returns the object that was bound to the session context.

Returns:
Object The object that was bound to the session context..

getSource

public java.lang.Object getSource()
Returns the object that originated the event. In this case, the object is the session context.

Overrides:
getSource in class java.util.EventObject
Returns:
Object The object that originated the event

toString

public java.lang.String toString()
Returns a String representation of this SessionContextStateChangedEvent.

Overrides:
toString in class java.util.EventObject
Returns:
String The String represenation of this SessionContextStateChangedEvent.

getStateChange

public int getStateChange()
Returns the type of state change that occurred. Supported state changes include OBJECT_REMOVEDand SESSION_CONTEXT_DESROYED.

Returns:
int The type of state change.

***  This class provides Binary Compatibility only, not Source Compatibility  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.