public interface ContextHandle extends Handle
Allocator.newContextHandle()
Modifier and Type | Method and Description |
---|---|
int |
createSessionForHandle(SessionHandle in_out_sessionHandle,
java.lang.String[] properties,
MessageCallback messageCallback,
SessionEventCallback sessionEventCallback)
Allocates a new session instance which will be bound to an unbound
SessionHandle
within a specified Context. |
int createSessionForHandle(SessionHandle in_out_sessionHandle, java.lang.String[] properties, MessageCallback messageCallback, SessionEventCallback sessionEventCallback) throws SolclientException
SessionHandle
within a specified Context. The "session properties"
are supplied as an array of name/value pointer pairs, where the name and value are both strings.
Only configuration property names that are members of SessionHandle.PROPERTIES
are processed; other property names
are ignored. Any values not supplied are set to default values.
When the Session is created, the SessionHandle
is considered bound (see SessionHandle.isBound()
) , and the
SessionHandle
is then used for any Session-level operations (for example, sending a message).
The passed-in object MessageCallback
provides information on the message receive callback
method. The passed-in object SessionEventCallback
provides information on the Session event method
which the application has provided for this Session.
Both of these objects are mandatory. The message receive callback is invoked for each received message on this Session. The Session event callback is invoked when Session events occur, such as the Session going up or down. Both callbacks are invoked in the context of the Context thread to which this Session belongs.
in_out_sessionHandle
- an unbound SessionHandle which will be bound to the newly
created Sessionproperties
- an array of property names and values
([propName1,propValue1,propNam2,propValue2,...]) where
property names is defined in SessionHandle.PROPERTIES
messageCallback
- sessionEventCallback
- SolEnum.ReturnCode
SolclientException
Copyright 2004-2024 Solace Corporation. All rights reserved.