Methods Summary |
---|
public void | expire()
SimpleTcpReplicationManager mgr =(SimpleTcpReplicationManager)getManager();
mgr.sessionInvalidated(getIdInternal());
setIsDirty(true);
super.expire();
|
public int | getAccessCount()
return accessCount.get();
|
public long | getLastAccessWasDistributed()
return lastAccessWasDistributed;
|
public long | getLastAccessedTime()
return lastAccessedTime;
|
public long | getThisAccessedTime()
return thisAccessedTime;
|
public void | invalidate()
SimpleTcpReplicationManager mgr =(SimpleTcpReplicationManager)getManager();
mgr.sessionInvalidated(getIdInternal());
setIsDirty(true);
super.invalidate();
|
public boolean | isDirty()
return isDirty;
|
public boolean | isPrimarySession()returns true if this session is the primary session, if that is the
case, the manager can expire it upon timeout.
return isPrimarySession;
|
protected void | log(java.lang.String message)Implements a log method to log through the manager
if ((mManager != null) && (mManager instanceof SimpleTcpReplicationManager)) {
((SimpleTcpReplicationManager) mManager).log.debug("ReplicatedSession: " + message);
} else {
System.out.println("ReplicatedSession: " + message);
}
|
protected void | log(java.lang.String message, java.lang.Throwable x)
if ((mManager != null) && (mManager instanceof SimpleTcpReplicationManager)) {
((SimpleTcpReplicationManager) mManager).log.error("ReplicatedSession: " + message,x);
} else {
System.out.println("ReplicatedSession: " + message);
x.printStackTrace();
}
|
public void | readObjectData(java.io.ObjectInputStream stream)Read a serialized version of the contents of this session object from
the specified object input stream, without requiring that the
StandardSession itself have been serialized.
super.readObjectData(stream);
|
public void | removeAttribute(java.lang.String name)
setIsDirty(true);
super.removeAttribute(name);
|
public void | removeAttribute(java.lang.String name, boolean notify)see parent description,
plus we also notify other nodes in the cluster
setIsDirty(true);
super.removeAttribute(name,notify);
|
public void | setAccessCount(int accessCount)
this.accessCount.set(accessCount);
|
public void | setAttribute(java.lang.String name, java.lang.Object value)Sets an attribute and notifies the other nodes in the cluster
if ( value == null ) {
removeAttribute(name);
return;
}
if (!(value instanceof java.io.Serializable))
throw new java.lang.IllegalArgumentException("Value for attribute "+name+" is not serializable.");
setIsDirty(true);
super.setAttribute(name,value);
|
public void | setId(java.lang.String id, boolean tellNew)
if ((this.id != null) && (manager != null))
manager.remove(this);
this.id = id;
if (manager != null)
manager.add(this);
if (tellNew) tellNew();
|
public void | setIsDirty(boolean dirty)
isDirty = dirty;
|
public void | setLastAccessWasDistributed(long time)
lastAccessWasDistributed = time;
|
public void | setLastAccessedTime(long lastAccessedTime)
this.lastAccessedTime = lastAccessedTime;
|
public void | setManager(SimpleTcpReplicationManager mgr)Sets the manager for this session
mManager = mgr;
super.setManager(mgr);
|
public void | setMaxInactiveInterval(int interval)
setIsDirty(true);
super.setMaxInactiveInterval(interval);
|
public void | setPrimarySession(boolean primarySession)Sets whether this is the primary session or not.
this.isPrimarySession=primarySession;
|
public void | setPrincipal(java.security.Principal principal)Set the authenticated Principal that is associated with this Session.
This provides an Authenticator with a means to cache a
previously authenticated Principal, and avoid potentially expensive
Realm.authenticate() calls on every request.
super.setPrincipal(principal);
setIsDirty(true);
|
public void | setThisAccessedTime(long thisAccessedTime)
this.thisAccessedTime = thisAccessedTime;
|
public java.lang.String | toString()
StringBuffer buf = new StringBuffer("ReplicatedSession id=");
buf.append(getIdInternal()).append(" ref=").append(super.toString()).append("\n");
java.util.Enumeration e = getAttributeNames();
while ( e.hasMoreElements() ) {
String name = (String)e.nextElement();
Object value = getAttribute(name);
buf.append("\tname=").append(name).append("; value=").append(value).append("\n");
}
buf.append("\tLastAccess=").append(getLastAccessedTime()).append("\n");
return buf.toString();
|
public void | writeObjectData(java.io.ObjectOutputStream stream)Write a serialized version of the contents of this session object to
the specified object output stream, without requiring that the
StandardSession itself have been serialized.
super.writeObjectData(stream);
|