Package omero.util
Class ServantHolder
- java.lang.Object
-
- omero.util.ServantHolder
-
public class ServantHolder extends java.lang.ObjectManager for all active servants in a single session. To reduce the need of usingUtil.stringToIdentity(String)andUtil.identityToString(Ice.Identity)the servant tries to make the two usages equivalent.- Since:
- 3.0-Beta4
-
-
Constructor Summary
Constructors Constructor Description ServantHolder(java.lang.String session)ServantHolder(java.lang.String session, int servantsPerSession)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacquireLock(java.lang.String key)Acquires the given lock or if necessary creates a new one.voidaddClientId(java.lang.String clientId)Ice.Objectget(Ice.Identity id)java.util.Set<java.lang.String>getClientIds()Ice.IdentitygetIdentity(java.lang.String idName)Constructs anIdentityfrom the current session and from the givenStringwhich for stateful services are defined by UUIDs.java.util.List<java.lang.String>getServantList()java.lang.StringgetSession()java.lang.StringgetStatefulServiceCount()java.lang.ObjectgetUntied(Ice.Identity id)voidput(Ice.Identity id, Ice.Object servant)voidreleaseLock(java.lang.String key)Releases the given lock if found, otherwise throws anInternalExceptionIce.Objectremove(Ice.Identity id)voidremoveClientId(java.lang.String clientId)
-
-
-
Field Detail
-
clientIds
protected final java.util.Map<java.lang.String,java.lang.Object> clientIds
An internal mapping to all client ids fromSessionIfor a given DB session since there is no method onObjectAdapterto retrieve all servants.
-
-
Method Detail
-
getSession
public java.lang.String getSession()
-
getIdentity
public Ice.Identity getIdentity(java.lang.String idName)
Constructs anIdentityfrom the current session and from the givenStringwhich for stateful services are defined by UUIDs.
-
addClientId
public void addClientId(java.lang.String clientId)
-
removeClientId
public void removeClientId(java.lang.String clientId)
-
getClientIds
public java.util.Set<java.lang.String> getClientIds()
-
acquireLock
public void acquireLock(java.lang.String key)
Acquires the given lock or if necessary creates a new one.- Parameters:
key- the lock's key
-
releaseLock
public void releaseLock(java.lang.String key)
Releases the given lock if found, otherwise throws anInternalException- Parameters:
key- the lock's key
-
get
public Ice.Object get(Ice.Identity id)
-
getUntied
public java.lang.Object getUntied(Ice.Identity id)
-
put
public void put(Ice.Identity id, Ice.Object servant) throws OverUsageException- Throws:
OverUsageException
-
remove
public Ice.Object remove(Ice.Identity id)
-
getServantList
public java.util.List<java.lang.String> getServantList()
-
getStatefulServiceCount
public java.lang.String getStatefulServiceCount()
-
-