public class SessionFactoryHelper
extends java.lang.Object
connect(). The callback object is
notified of the various life cycle events. Once the session is torn down for whatever reason, the application
can use the session factory to create another connection.| Constructor and Description |
|---|
SessionFactoryHelper(Ice.InitializationData initData,
SessionCallback callback)
Creates a SessionFactory object.
|
SessionFactoryHelper(Ice.Properties properties,
SessionCallback callback)
Creates a SessionFactory object.
|
SessionFactoryHelper(SessionCallback callback)
Creates a SessionFactory object.
|
| Modifier and Type | Method and Description |
|---|---|
SessionHelper |
connect()
Connects to the Glacier2 router using the associated SSL credentials.
|
SessionHelper |
connect(java.lang.String username,
java.lang.String password)
Connect the Glacier2 session using user name and password credentials.
|
Ice.InitializationData |
getInitializationData()
Returns the initialization data used to initialize the communicator.
|
int |
getPort()
Returns the Glacier2 router port to connect to.
|
java.lang.String |
getProtocol()
Returns the protocol that will be used by the session factory to establish the connection.
|
java.lang.String |
getRouterHost()
Returns the host on which the Glacier2 router runs.
|
Ice.Identity |
getRouterIdentity()
Returns the object identity of the Glacier2 router.
|
boolean |
getSecure()
Deprecated.
deprecated, use SessionFactoryHelper.getProtocol instead
|
int |
getTimeout()
Returns the connect and connection timeout associated with the Glacier2 router.
|
boolean |
getUseCallbacks()
Indicates whether a newly-created session will also create an object adapter that
the client can use for receiving callbacks.
|
void |
setConnectContext(java.util.Map<java.lang.String,java.lang.String> context)
Sets the request context to use while establishing a connection to the Glacier2 router.
|
void |
setPort(int port)
Sets the Glacier2 router port to connect to.
|
void |
setProtocol(java.lang.String protocol)
Sets the protocol that will be used by the session factory to establish the connection.
|
void |
setRouterHost(java.lang.String hostname)
Sets the host on which the Glacier2 router runs.
|
void |
setRouterIdentity(Ice.Identity identity)
Set the router object identity.
|
void |
setSecure(boolean secure)
Deprecated.
deprecated, use SessionFactoryHelper.setProtocol instead
|
void |
setTimeout(int timeoutMillisecs)
Sets the connect and connection timeout for the Glacier2 router.
|
void |
setUseCallbacks(boolean useCallbacks)
Determines whether the session should create an object adapter that the client
can use for receiving callbacks.
|
public SessionFactoryHelper(SessionCallback callback) throws Ice.InitializationException
callback - The callback object for notifications.Ice.InitializationException - If a failure occurred while initializing the communicator.public SessionFactoryHelper(Ice.InitializationData initData, SessionCallback callback) throws Ice.InitializationException
initData - The initialization data to use when creating the communicator.callback - The callback object for notifications.Ice.InitializationException - If a failure occurred while initializing the communicator.public SessionFactoryHelper(Ice.Properties properties, SessionCallback callback) throws Ice.InitializationException
properties - The properties to use when creating the communicator.callback - The callback object for notifications.Ice.InitializationException - If a failure occurred while initializing the communicator.public void setRouterIdentity(Ice.Identity identity)
identity - The Glacier2 router's identity.public Ice.Identity getRouterIdentity()
public void setRouterHost(java.lang.String hostname)
hostname - The host name (or IP address) of the router host.public java.lang.String getRouterHost()
@Deprecated public void setSecure(boolean secure)
secure - If true, the client connects to the router
via SSL; otherwise, the client connects via TCP.@Deprecated public boolean getSecure()
public void setProtocol(java.lang.String protocol)
protocol - The communication protocol.public java.lang.String getProtocol()
public void setTimeout(int timeoutMillisecs)
timeoutMillisecs - The timeout in milliseconds. A zero
or negative timeout value indicates that the router proxy has no associated timeout.public int getTimeout()
public void setPort(int port)
port - The port. If 0, then the default port (4063 for TCP or 4064 for SSL) is used.public int getPort()
public Ice.InitializationData getInitializationData()
public void setConnectContext(java.util.Map<java.lang.String,java.lang.String> context)
context - The request context.public void setUseCallbacks(boolean useCallbacks)
useCallbacks - True if the session should create an object adapter.public boolean getUseCallbacks()
public SessionHelper connect()
SessionCallback.connected(Glacier2.SessionHelper) is called on the callback object;
upon failure, SessionCallback.connectFailed(Glacier2.SessionHelper, java.lang.Throwable) is called with the exception.public SessionHelper connect(java.lang.String username, java.lang.String password)
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.