| Method from org.apache.catalina.cluster.session.ReplicatedSession Detail: |
public void expire() {
SimpleTcpReplicationManager mgr =(SimpleTcpReplicationManager)getManager();
mgr.sessionInvalidated(getIdInternal());
setIsDirty(true);
super.expire();
}
|
public int getAccessCount() {
return accessCount;
}
|
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() {
return isPrimarySession;
}
returns true if this session is the primary session, if that is the
case, the manager can expire it upon timeout. |
protected void log(String message) {
if ((mManager != null) && (mManager instanceof SimpleTcpReplicationManager)) {
((SimpleTcpReplicationManager) mManager).log.debug("ReplicatedSession: " + message);
} else {
System.out.println("ReplicatedSession: " + message);
}
}
Implements a log method to log through the manager |
protected void log(String message,
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(ObjectInputStream stream) throws IOException, ClassNotFoundException {
super.readObjectData(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. |
public void removeAttribute(String name) {
setIsDirty(true);
super.removeAttribute(name);
}
|
public void removeAttribute(String name,
boolean notify) {
setIsDirty(true);
super.removeAttribute(name,notify);
}
see parent description,
plus we also notify other nodes in the cluster |
public void setAccessCount(int accessCount) {
this.accessCount = accessCount;
}
|
public void setAttribute(String name,
Object value) {
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);
}
Sets an attribute and notifies the other nodes in the cluster |
public void setId(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) {
mManager = mgr;
super.setManager(mgr);
}
Sets the manager for this session |
public void setMaxInactiveInterval(int interval) {
setIsDirty(true);
super.setMaxInactiveInterval(interval);
}
|
public void setPrimarySession(boolean primarySession) {
this.isPrimarySession=primarySession;
}
Sets whether this is the primary session or not. |
public void setPrincipal(Principal principal) {
super.setPrincipal(principal);
setIsDirty(true);
}
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. |
public void setThisAccessedTime(long thisAccessedTime) {
this.thisAccessedTime = thisAccessedTime;
}
|
public 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(ObjectOutputStream stream) throws IOException {
super.writeObjectData(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. |