Ice 3.7 Slice API Reference
Operations | List of all members
IceGrid::Session Interface Reference

A session object is used by IceGrid clients to allocate and release objects. More...

defined in <IceGrid/Session.ice>

interface Session extends Glacier2::Session { ... }

Inheritance diagram for IceGrid::Session:
Inheritance graph
[legend]
Collaboration diagram for IceGrid::Session:
Collaboration graph
[legend]

Operations

Object * allocateObjectById (Ice::Identity id) throws ObjectNotRegisteredException, AllocationException
 Allocate an object. More...
 
Object * allocateObjectByType (string type) throws AllocationException
 Allocate an object with the given type. More...
 
idempotent void keepAlive ()
 Keep the session alive. More...
 
void releaseObject (Ice::Identity id) throws ObjectNotRegisteredException, AllocationException
 Release an object that was allocated using allocateObjectById or allocateObjectByType. More...
 
idempotent void setAllocationTimeout (int timeout)
 Set the allocation timeout. More...
 
- Operations inherited from Glacier2::Session
void destroy ()
 Destroy the session. More...
 

Detailed Description

A session object is used by IceGrid clients to allocate and release objects.

Client sessions are created either via the Registry object or via the registry client SessionManager object.

See also
Registry

Operation Documentation

◆ allocateObjectById()

["amd"]
Object* allocateObjectById ( Ice::Identity  id) throws ObjectNotRegisteredException, AllocationException

Allocate an object.

Depending on the allocation timeout, this operation might hang until the object is available or until the timeout is reached.

Parameters
idThe identity of the object to allocate.
Returns
The proxy of the allocated object.
Exceptions
ObjectNotRegisteredExceptionRaised if the object with the given identity is not registered with the registry.
AllocationExceptionRaised if the object can't be allocated.
See also
setAllocationTimeout
releaseObject

◆ allocateObjectByType()

["amd"]
Object* allocateObjectByType ( string  type) throws AllocationException

Allocate an object with the given type.

Depending on the allocation timeout, this operation can block until an object becomes available or until the timeout is reached.

Parameters
typeThe type of the object.
Returns
The proxy of the allocated object.
Exceptions
AllocationExceptionRaised if the object could not be allocated.
See also
setAllocationTimeout
releaseObject

◆ keepAlive()

idempotent void keepAlive ( )

Keep the session alive.

Clients should call this operation regularly to prevent the server from reaping the session.

See also
Registry::getSessionTimeout

◆ releaseObject()

Release an object that was allocated using allocateObjectById or allocateObjectByType.

Parameters
idThe identity of the object to release.
Exceptions
ObjectNotRegisteredExceptionRaised if the object with the given identity is not registered with the registry.
AllocationExceptionRaised if the given object can't be released. This might happen if the object isn't allocatable or isn't allocated by the session.

◆ setAllocationTimeout()

idempotent void setAllocationTimeout ( int  timeout)

Set the allocation timeout.

If no objects are available for an allocation request, a call to allocateObjectById or allocateObjectByType will block for the duration of this timeout.

Parameters
timeoutThe timeout in milliseconds.

The documentation for this interface was generated from the following file: