Top Description Fields Constructors Methods
sun.security.pkcs11

pack-priv final Class Session

Additional top-level class in compilation unit: SessionRef.

extends Object
implements Comparable<Session>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
Imports
java.lang.ref.*, java.util.*, java.util.concurrent.atomic.AtomicInteger, java.security.*, sun.security.pkcs11.wrapper.*

A session object. Sessions are obtained via the SessionManager, see there for details. Most code will only ever need one method in this class, the id() method to obtain the session id.
Author
Andreas Sterbenz
Since
1.5

Field Summary

Modifier and TypeField and Description
private final AtomicInteger
private final long
private long
private static final long
private final SessionRef
pack-priv final Token

Constructor Summary

AccessConstructor and Description
pack-priv
Session(Token token, long id)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv void
private void
close(boolean checkObjCtr)

public int
compareTo(Session
the object to be compared.
other
)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

pack-priv static boolean
pack-priv boolean
pack-priv long
id()

pack-priv boolean
isLive(long currentTime)

pack-priv void
kill()

pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

createdObjectsback to summary
private final AtomicInteger createdObjects
idback to summary
private final long id
lastAccessback to summary
private long lastAccess
MAX_IDLE_TIMEback to summary
private static final long MAX_IDLE_TIME
sessionRefback to summary
private final SessionRef sessionRef
tokenback to summary
pack-priv final Token token

Constructor Detail

Sessionback to summary
pack-priv Session(Token token, long id)

Method Detail

addObjectback to summary
pack-priv void addObject()
closeback to summary
pack-priv void close()
closeback to summary
private void close(boolean checkObjCtr)
compareToback to summary
public int compareTo(Session other)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Parameters
other:Session

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

drainRefQueueback to summary
pack-priv static boolean drainRefQueue()
hasObjectsback to summary
pack-priv boolean hasObjects()
idback to summary
pack-priv long id()
isLiveback to summary
pack-priv boolean isLive(long currentTime)
killback to summary
pack-priv void kill()
removeObjectback to summary
pack-priv void removeObject()