This base token implementation can be used when the server stores the passed objects using a reference, and the token is returned to the client to store.
The weak reference used during the construction of the object should be stored in a collection on the server, and an instance of this token should be returned to the client. Once the client releases all references to this token, the server will be able to garbage collect the strongly referenced object, as there are only weak references pointing to it.
It may be useful to extend this class and provide additional functions to the client to manually uninstall the token reference from the server.
|protected final T|
The strong reference to the object.
|protected final WeakReference<|
The weak reference to the object.
Constructs a new token with the given weak reference.