|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.root1.simon.LookupTable
public class LookupTable
This class is "the brain" of SIMON. It saves all known
remote object <-> name relations, as well as hashcodes
for all the methods in the remote object.
If a object is getting unreferenced over the network connection,
it gets "informed" by the unreferenced()
method,
if SimonUnreferenced
is implemented.
Constructor Summary | |
---|---|
protected |
LookupTable(Dispatcher dispatcher)
Called via Dispatcher to create a lookup table. |
Method Summary | |
---|---|
protected void |
cleanup()
Clears the whole LookupTable |
protected java.util.HashMap<java.lang.Long,java.lang.reflect.Method> |
computeMethodHashMap(java.lang.Class<?> remoteClass)
Computes for each method of the given remote object a method has and save this in an internal map for later lookup |
protected Dispatcher |
getDispatcher()
TODO document me |
java.lang.reflect.Method |
getMethod(java.lang.String remoteObject,
long methodHash)
Gets a method according to the given remote object name and method hash value |
protected RemoteObjectContainer |
getRemoteObjectContainer(java.lang.String remoteObjectName)
Gets a already bind remote object according to the given remote object name |
protected RemoteObjectContainer |
getRemoteObjectContainerByInterface(java.lang.String interfaceName)
Gets a already bind remote object according to the given remote interface name |
protected boolean |
isSimonRemoteRegistered(java.lang.Object simonRemote)
TODO document me |
protected void |
putRemoteBinding(java.lang.String remoteObjectName,
java.lang.Object remoteObject)
Saves a remote object in the lookup table for later reference |
protected void |
putRemoteInstanceBinding(long sessionId,
java.lang.String remoteObjectName,
java.lang.Object remoteObject)
This method is used by the Dispatcher and the
ProcessMessageRunnable class. |
protected void |
releaseRemoteBinding(java.lang.String name)
Frees a saved remote object. |
protected void |
unreference(long sessionId)
Removes remote instance objects from LookupTable . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected LookupTable(Dispatcher dispatcher)
dispatcher
- Method Detail |
---|
protected void putRemoteBinding(java.lang.String remoteObjectName, java.lang.Object remoteObject)
remoteObjectName
- the name of the remote objectremoteObject
- a simon remote objectprotected void putRemoteInstanceBinding(long sessionId, java.lang.String remoteObjectName, java.lang.Object remoteObject)
Dispatcher
and the
ProcessMessageRunnable
class. Calling this method will store the
simon remote object for later GC along with the session This is necessary
for the DGC to release all remote instances which are related to a
specific IoSession
.
The object is also stored as a remote binding.
sessionId
- the id from IoSession.getId()
from the related
IoSession
remoteObjectName
- the related remote object nameremoteObject
- the remote object that has been found in a method argument or
method resultprotected RemoteObjectContainer getRemoteObjectContainer(java.lang.String remoteObjectName) throws LookupFailedException
remoteObjectName
- the name of the object we are interested in
LookupFailedException
- if remote object is not available in lookup tableprotected void releaseRemoteBinding(java.lang.String name)
name
- the remote object to freepublic java.lang.reflect.Method getMethod(java.lang.String remoteObject, long methodHash)
remoteObject
- the remote object which contains the methodmethodHash
- the hash of the method
protected java.util.HashMap<java.lang.Long,java.lang.reflect.Method> computeMethodHashMap(java.lang.Class<?> remoteClass)
remoteClass
- the class that contains the methods
protected void cleanup()
LookupTable
protected void unreference(long sessionId)
LookupTable
.
If the remote object implements the interface SimonUnreferenced
,
the SimonUnreferenced.unreferenced()
method is finally called.
sessionId
- the id from IoSession.getId()
from the related IoSession
protected Dispatcher getDispatcher()
protected boolean isSimonRemoteRegistered(java.lang.Object simonRemote)
simonRemote
-
protected RemoteObjectContainer getRemoteObjectContainerByInterface(java.lang.String interfaceName) throws LookupFailedException
interfaceName
- then name of the interface to query for
RemoteObjectContainer
LookupFailedException
- if nothing was found, or if the found result is not unique
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |