public class ProxiedSession extends Object implements Session
Session implementation that immediately delegates all corresponding calls to an
underlying proxied session instance.
This class is mostly useful for framework subclassing to intercept certain Session calls
and perform additional logic.| Modifier and Type | Field and Description |
|---|---|
protected Session |
delegate
The proxied instance
|
| Constructor and Description |
|---|
ProxiedSession(Session target)
Constructs an instance that proxies the specified
target. |
| Modifier and Type | Method and Description |
|---|---|
Object |
getAttribute(Object key)
Immediately delegates to the underlying proxied session.
|
Collection<Object> |
getAttributeKeys()
Immediately delegates to the underlying proxied session.
|
String |
getHost()
Immediately delegates to the underlying proxied session.
|
Serializable |
getId()
Immediately delegates to the underlying proxied session.
|
Date |
getLastAccessTime()
Immediately delegates to the underlying proxied session.
|
Date |
getStartTimestamp()
Immediately delegates to the underlying proxied session.
|
long |
getTimeout()
Immediately delegates to the underlying proxied session.
|
Object |
removeAttribute(Object key)
Immediately delegates to the underlying proxied session.
|
void |
setAttribute(Object key,
Object value)
Immediately delegates to the underlying proxied session.
|
void |
setTimeout(long maxIdleTimeInMillis)
Immediately delegates to the underlying proxied session.
|
void |
stop()
Immediately delegates to the underlying proxied session.
|
void |
touch()
Immediately delegates to the underlying proxied session.
|
protected final Session delegate
public ProxiedSession(Session target)
target. Subclasses may access this
target via the protected final 'delegate' attribute, i.e. this.delegate.target - the specified target Session to proxy.public Serializable getId()
public Date getStartTimestamp()
getStartTimestamp in interface Sessionpublic Date getLastAccessTime()
getLastAccessTime in interface SessionSession.touch()public long getTimeout()
throws InvalidSessionException
getTimeout in interface SessionInvalidSessionException - if the session has been stopped or expired prior to calling this method.public void setTimeout(long maxIdleTimeInMillis)
throws InvalidSessionException
setTimeout in interface SessionmaxIdleTimeInMillis - the time in milliseconds that the session may remain idle before expiring.InvalidSessionException - if the session has been stopped or expired prior to calling this method.public String getHost()
public void touch()
throws InvalidSessionException
touch in interface SessionInvalidSessionException - if this session has stopped or expired prior to calling this method.public void stop()
throws InvalidSessionException
stop in interface SessionInvalidSessionException - if this session has stopped or expired prior to calling this method.public Collection<Object> getAttributeKeys() throws InvalidSessionException
getAttributeKeys in interface SessionInvalidSessionException - if this session has stopped or expired prior to calling this method.public Object getAttribute(Object key) throws InvalidSessionException
getAttribute in interface Sessionkey - the unique name of the object bound to this sessionkey name or null if there is
no object bound under that name.InvalidSessionException - if this session has stopped or expired prior to calling
this method.public void setAttribute(Object key, Object value) throws InvalidSessionException
setAttribute in interface Sessionkey - the name under which the value object will be bound in this sessionvalue - the object to bind in this session.InvalidSessionException - if this session has stopped or expired prior to calling
this method.public Object removeAttribute(Object key) throws InvalidSessionException
removeAttribute in interface Sessionkey - the name uniquely identifying the object to removenull if there was no object bound under the name
key.InvalidSessionException - if this session has stopped or expired prior to calling
this method.Copyright © 2004-2016 The Apache Software Foundation. All Rights Reserved.