public class SessionHelper
extends java.lang.Object
| Constructor and Description |
|---|
SessionHelper(SessionCallback callback,
Ice.InitializationData initData,
java.lang.String finderStr,
boolean useCallbacks)
Creates a Glacier2 session.
|
| Modifier and Type | Method and Description |
|---|---|
Ice.ObjectPrx |
addWithUUID(Ice.Object servant)
Adds a servant to the callback object adapter's Active Servant Map with a UUID.
|
java.lang.String |
categoryForClient()
Returns the category to be used in the identities of all of the client's
callback objects.
|
Ice.Communicator |
communicator()
Returns the session's communicator object.
|
protected void |
connect(java.util.Map<java.lang.String,java.lang.String> context)
Connects to the Glacier2 router using the associated SSL credentials.
|
protected void |
connect(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> context)
Connects a Glacier2 session using user name and password credentials.
|
void |
destroy()
Destroys the Glacier2 session.
|
boolean |
isConnected()
Returns true if there is an active session, otherwise returns false.
|
Ice.ObjectAdapter |
objectAdapter()
Creates an object adapter for callback objects.
|
SessionPrx |
session()
Returns the Glacier2 session proxy.
|
public SessionHelper(SessionCallback callback, Ice.InitializationData initData, java.lang.String finderStr, boolean useCallbacks)
callback - The callback for notifications about session establishment.initData - The InitializationData for initializing the communicator.finderStr - The stringified Ice.RouterFinder proxy.useCallbacks - True if the session should create an object adapter for receiving callbacks.public void destroy()
SessionCallback.disconnected(Glacier2.SessionHelper) is called on
the associated callback object.public Ice.Communicator communicator()
public java.lang.String categoryForClient()
throws SessionNotExistException
SessionNotExistException - No session exists.public Ice.ObjectPrx addWithUUID(Ice.Object servant) throws SessionNotExistException
servant - The servant to add.SessionNotExistException - No session exists.public SessionPrx session() throws SessionNotExistException
SessionNotExistException - No session exists.public boolean isConnected()
trueif session exists or false if no session exists.public Ice.ObjectAdapter objectAdapter() throws SessionNotExistException
SessionNotExistException - No session exists.protected void connect(java.util.Map<java.lang.String,java.lang.String> context)
SessionCallback.connected(Glacier2.SessionHelper) is called on the callback object;
upon failure, SessionCallback.connectFailed(Glacier2.SessionHelper, java.lang.Throwable) is called with the exception.context - The request context to use when creating the session.protected void connect(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> context)
SessionCallback.connected(Glacier2.SessionHelper) is called on the callback object;
upon failure SessionCallback.connectFailed(Glacier2.SessionHelper, java.lang.Throwable) is called with the exception.username - The user name.password - The password.context - The request context to use when creating the session.