Used by a Requestor to begin a session with an indefinite duration (equivalent to specifying a timeout of
DOF.TIMEOUT_NEVER
).
A session is an object provided exclusively for a requestor. No other requestor is allowed to access the session object.
Use
Session.waitSession(int)
to ensure that the session object is available.
Use
DOFSystem.waitProvider(DOFInterfaceID, int)
to make sure there's a route to the provider. The session ends when its timeout
expires or when the session operation is cancelled. Attempting to open a session on a "session object" (an object
returned by
Session.waitSession(int)
) is not supported.
NOTE: It is not necessary to call on the session object. The library will destroy
the session object when the operation completes or is cancelled.
NOTE: Interest is required (through
DOFSystem.beginInterest(DOFObjectID, DOFInterestLevel)
for this operation in order to determine the primary provider.
If no interest is specified, then this operation will result in a
DOFErrorException.TIMEOUT
exception.
NOTE: If the primary provider changes during the lifetime of this operation, and the
Control
response level
includes exceptions, then see
SessionOperationListener.complete(DOFOperation, DOFException)
.
destroy()
Namespace: org.opendof.core.oal
Assembly: dof-oal (in dof-oal.dll) Version: 7.0.1.2
Syntax
C#
public DOFOperationSession beginSession( DOFInterface iface, DOFInterfaceID sessionType, DOFObjectSessionOperationListener operationListener )
Parameters
- iface
- Type: org.opendof.core.oalDOFInterface
Any interface being currently provided by the target provider of this session. The system uses this interface to locate the correct provider. Also, if a DOFProviderException is thrown by the Provider, the system uses iface to decode the exception. This must not be null. - sessionType
- Type: org.opendof.core.oalDOFInterfaceID
The session type. This is a hint to the provider that this interface should be provided on the session object (possibly in addition to others), and defines the purpose and contract for the session. Must not be null. - operationListener
- Type: org.opendof.core.oalDOFObjectSessionOperationListener
The listener to receive notification of the session being opened. If null, the session may be obtained by calling Session.waitSession(int) .
Return Value
Type: DOFOperationSessionThe session operation. You may call DOFOperation.cancel() on this operation to end the session. Will not be null.
See Also