Ice 3.7 C++11 API Reference
Public Types | Public Member Functions | Static Public Member Functions | List of all members
IceGrid::Session Class Referenceabstract

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

#include <IceGrid/IceGrid.h>

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

Public Types

using ProxyType = SessionPrx
 
- Public Types inherited from Glacier2::Session
using ProxyType = SessionPrx
 

Public Member Functions

virtual void allocateObjectByIdAsync (::Ice::Identity id, ::std::function< void(const ::std::shared_ptr<::Ice::ObjectPrx > &returnValue)> response, ::std::function< void(::std::exception_ptr)> exception, const ::Ice::Current &current)=0
 Allocate an object. More...
 
virtual void allocateObjectByTypeAsync (::std::string type, ::std::function< void(const ::std::shared_ptr<::Ice::ObjectPrx > &returnValue)> response, ::std::function< void(::std::exception_ptr)> exception, const ::Ice::Current &current)=0
 Allocate an object with the given type. More...
 
virtual ::std::string ice_id (const ::Ice::Current &current) const override
 Obtains a Slice type ID representing the most-derived interface supported by this object. More...
 
virtual ::std::vector<::std::string > ice_ids (const ::Ice::Current &current) const override
 Obtains a list of the Slice type IDs representing the interfaces supported by this object. More...
 
virtual bool ice_isA (::std::string id, const ::Ice::Current &current) const override
 Determines whether this object supports an interface with the given Slice type ID. More...
 
virtual void keepAlive (const ::Ice::Current &current)=0
 Keep the session alive. More...
 
virtual void releaseObject (::Ice::Identity id, const ::Ice::Current &current)=0
 Release an object that was allocated using allocateObjectById or allocateObjectByType. More...
 
virtual void setAllocationTimeout (int timeout, const ::Ice::Current &current)=0
 Set the allocation timeout. More...
 
- Public Member Functions inherited from Glacier2::Session
virtual void destroy (const ::Ice::Current &current)=0
 Destroy the session. More...
 
virtual ::std::string ice_id (const ::Ice::Current &current) const override
 Obtains a Slice type ID representing the most-derived interface supported by this object. More...
 
virtual ::std::vector<::std::string > ice_ids (const ::Ice::Current &current) const override
 Obtains a list of the Slice type IDs representing the interfaces supported by this object. More...
 
- Public Member Functions inherited from Ice::Object
virtual bool ice_dispatch (Ice::Request &request, std::function< bool()> response=nullptr, std::function< bool(std::exception_ptr)> error=nullptr)
 Dispatches an invocation to a servant. More...
 
virtual std::string ice_id (const Current &current) const
 Returns the Slice type ID of the most-derived interface supported by this object. More...
 
virtual std::vector< std::string > ice_ids (const Current &current) const
 Returns the Slice type IDs of the interfaces supported by this object. More...
 
virtual bool ice_isA (std::string s, const Current &current) const
 Tests whether this object supports a specific Slice interface. More...
 
virtual void ice_ping (const Current &current) const
 Tests whether this object can be reached. More...
 
virtual ~Object ()=default
 

Static Public Member Functions

static const ::std::string & ice_staticId ()
 Obtains the Slice type ID corresponding to this class. More...
 
- Static Public Member Functions inherited from Glacier2::Session
static const ::std::string & ice_staticId ()
 Obtains the Slice type ID corresponding to this class. More...
 
- Static Public Member Functions inherited from Ice::Object
static const std::string & ice_staticId ()
 Obtains the Slice type ID of this type. 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

Member Typedef Documentation

◆ ProxyType

Member Function Documentation

◆ allocateObjectByIdAsync()

virtual void IceGrid::Session::allocateObjectByIdAsync ( ::Ice::Identity  id,
::std::function< void(const ::std::shared_ptr<::Ice::ObjectPrx > &returnValue)>  response,
::std::function< void(::std::exception_ptr)>  exception,
const ::Ice::Current current 
)
pure virtual

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.
responseThe response callback.
exceptionThe exception callback.
currentThe Current object for the invocation.
Exceptions
IceGrid::AllocationExceptionRaised if the object can't be allocated.
IceGrid::ObjectNotRegisteredExceptionRaised if the object with the given identity is not registered with the registry.
See also
setAllocationTimeout
releaseObject

◆ allocateObjectByTypeAsync()

virtual void IceGrid::Session::allocateObjectByTypeAsync ( ::std::string  type,
::std::function< void(const ::std::shared_ptr<::Ice::ObjectPrx > &returnValue)>  response,
::std::function< void(::std::exception_ptr)>  exception,
const ::Ice::Current current 
)
pure virtual

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.
responseThe response callback.
exceptionThe exception callback.
currentThe Current object for the invocation.
Exceptions
IceGrid::AllocationExceptionRaised if the object could not be allocated.
See also
setAllocationTimeout
releaseObject

◆ ice_id()

virtual ::std::string IceGrid::Session::ice_id ( const ::Ice::Current current) const
override

Obtains a Slice type ID representing the most-derived interface supported by this object.

Parameters
currentThe Current object for the invocation.
Returns
A fully-scoped type ID.

◆ ice_ids()

virtual ::std::vector<::std::string> IceGrid::Session::ice_ids ( const ::Ice::Current current) const
override

Obtains a list of the Slice type IDs representing the interfaces supported by this object.

Parameters
currentThe Current object for the invocation.
Returns
A list of fully-scoped type IDs.

◆ ice_isA()

virtual bool IceGrid::Session::ice_isA ( ::std::string  id,
const ::Ice::Current current 
) const
overridevirtual

Determines whether this object supports an interface with the given Slice type ID.

Parameters
idThe fully-scoped Slice type ID.
currentThe Current object for the invocation.
Returns
True if this object supports the interface, false, otherwise.

Reimplemented from Glacier2::Session.

◆ ice_staticId()

static const ::std::string& IceGrid::Session::ice_staticId ( )
static

Obtains the Slice type ID corresponding to this class.

Returns
A fully-scoped type ID.

◆ keepAlive()

virtual void IceGrid::Session::keepAlive ( const ::Ice::Current current)
pure virtual

Keep the session alive.

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

Parameters
currentThe Current object for the invocation.
See also
Registry::getSessionTimeout

◆ releaseObject()

virtual void IceGrid::Session::releaseObject ( ::Ice::Identity  id,
const ::Ice::Current current 
)
pure virtual

Release an object that was allocated using allocateObjectById or allocateObjectByType.

Parameters
idThe identity of the object to release.
currentThe Current object for the invocation.
Exceptions
IceGrid::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.
IceGrid::ObjectNotRegisteredExceptionRaised if the object with the given identity is not registered with the registry.

◆ setAllocationTimeout()

virtual void IceGrid::Session::setAllocationTimeout ( int  timeout,
const ::Ice::Current current 
)
pure virtual

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.
currentThe Current object for the invocation.

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