|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectflex.messaging.FlexSession
The base for FlexSession implementations.
| Field Summary | |
protected Object |
mutex
Internal mutex to protect mutable members of a session instance (listeners/attributes/etc.). |
| Constructor Summary | |
FlexSession()
|
|
| Method Summary | |
void |
addSessionAttributeListener(FlexSessionAttributeListener listener)
Adds a session attribute listener that will be notified when an attribute is added, removed or changed. |
static void |
addSessionCreatedListener(FlexSessionListener listener)
Adds a session create listener that will be notified when new sessions are created. |
void |
addSessionDestroyedListener(FlexSessionListener listener)
Adds a session destroy listener that will be notified when the session is destroyed. |
protected void |
checkValid()
Ensures that the session has not been invalidated. |
void |
clearRemoteCredentials(String service,
String destination)
|
protected void |
destroy()
Invoked by subclass upon session destruction to notify all registered session destroy listeners of the event. |
Object |
getAttribute(String name)
Returns the attribute bound to the specified name in the session, or null if no attribute is bound under the name. |
Enumeration |
getAttributeNames()
Returns the names of all attributes bound to the session. |
abstract String |
getId()
Returns a unique identifier association with this session. |
flex.messaging.FlexRemoteCredentials |
getRemoteCredentials(String service,
String destination)
|
Principal |
getUserPrincipal()
Returns the principal associated with the session. |
abstract void |
invalidate()
Invalidate this FlexSession. |
boolean |
isUserInRole(String role)
Return whether the current user is in the specified role. |
boolean |
isValid()
Return whether the session is valid. |
protected void |
notifyAttributeAdded(String name,
Object value)
Notify attribute listeners that an attribute has been added. |
protected void |
notifyAttributeBound(String name,
Object value)
Notify binding listener that it has been bound to the session. |
protected void |
notifyAttributeRemoved(String name,
Object value)
Notify attribute listeners that an attribute has been removed. |
protected void |
notifyAttributeReplaced(String name,
Object value)
Notify attribute listeners that an attribute has been replaced. |
protected void |
notifyAttributeUnbound(String name,
Object value)
Notify binding listener that it has been unbound from the session. |
protected void |
notifyOfCreation()
Invoked by subclass upon session creation to notify all registered session create listeners of the event. |
void |
putRemoteCredentials(flex.messaging.FlexRemoteCredentials creds)
|
void |
removeAttribute(String name)
Removes the attribute bound to the specified name in the session. |
void |
removeSessionAttributeListener(FlexSessionAttributeListener listener)
Removes a session attribute listener. |
static void |
removeSessionCreatedListener(FlexSessionListener listener)
Removes a session create listener. |
void |
removeSessionDestroyedListener(FlexSessionListener listener)
Removes a session destroy listener. |
void |
setAttribute(String name,
Object value)
Binds an attribute value to the session under the specified name. |
void |
setUserPrincipal(Principal userPrincipal)
Sets the principal associated with the session. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected final Object mutex
| Constructor Detail |
public FlexSession()
| Method Detail |
public Principal getUserPrincipal()
public void setUserPrincipal(Principal userPrincipal)
userPrincipal - The principal to associate with the session.public static void addSessionCreatedListener(FlexSessionListener listener)
listener - The listener to add.FlexSessionListenerpublic static void removeSessionCreatedListener(FlexSessionListener listener)
listener - The listener to remove.FlexSessionListenerpublic void addSessionAttributeListener(FlexSessionAttributeListener listener)
listener - The listener to add.public void addSessionDestroyedListener(FlexSessionListener listener)
listener - The listener to add.FlexSessionListenerprotected void destroy()
public Object getAttribute(String name)
name - The name the target attribute is bound to.
public Enumeration getAttributeNames()
protected void notifyOfCreation()
public void removeAttribute(String name)
name - The name of the attribute to remove.public void removeSessionAttributeListener(FlexSessionAttributeListener listener)
listener - The listener to remove.public void removeSessionDestroyedListener(FlexSessionListener listener)
listener - The listener to remove.FlexSessionListener
public void setAttribute(String name,
Object value)
name - The name to bind the attribute under.value - The value of the attribute.public void putRemoteCredentials(flex.messaging.FlexRemoteCredentials creds)
public flex.messaging.FlexRemoteCredentials getRemoteCredentials(String service,
String destination)
public void clearRemoteCredentials(String service,
String destination)
public abstract void invalidate()
public abstract String getId()
public boolean isUserInRole(String role)
role -
public boolean isValid()
protected void checkValid()
protected void notifyAttributeAdded(String name,
Object value)
name - The name of the attribute.value - The new value of the attribute.
protected void notifyAttributeBound(String name,
Object value)
name - The attribute name.value - The attribute that has been bound.
protected void notifyAttributeRemoved(String name,
Object value)
name - The name of the attribute.value - The previous value of the attribute.
protected void notifyAttributeReplaced(String name,
Object value)
name - The name of the attribute.value - The previous value of the attribute.
protected void notifyAttributeUnbound(String name,
Object value)
name - The attribute name.value - The attribute that has been unbound.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||