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

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

#include <IceGrid/IceGrid.h>

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

Public Member Functions

::std::shared_ptr<::Ice::ObjectPrxallocateObjectById (const ::Ice::Identity &id, const ::Ice::Context &context=::Ice::noExplicitContext)
 Allocate an object. More...
 
::std::function< void()> allocateObjectByIdAsync (const ::Ice::Identity &id, ::std::function< void(::std::shared_ptr<::Ice::ObjectPrx >)> response, ::std::function< void(::std::exception_ptr)> ex=nullptr, ::std::function< void(bool)> sent=nullptr, const ::Ice::Context &context=::Ice::noExplicitContext)
 Allocate an object. More...
 
template<template< typename > class P = ::std::promise>
auto allocateObjectByIdAsync (const ::Ice::Identity &id, const ::Ice::Context &context=::Ice::noExplicitContext) -> decltype(::std::declval< P<::std::shared_ptr<::Ice::ObjectPrx >>>().get_future())
 Allocate an object. More...
 
::std::shared_ptr<::Ice::ObjectPrxallocateObjectByType (const ::std::string &type, const ::Ice::Context &context=::Ice::noExplicitContext)
 Allocate an object with the given type. More...
 
::std::function< void()> allocateObjectByTypeAsync (const ::std::string &type, ::std::function< void(::std::shared_ptr<::Ice::ObjectPrx >)> response, ::std::function< void(::std::exception_ptr)> ex=nullptr, ::std::function< void(bool)> sent=nullptr, const ::Ice::Context &context=::Ice::noExplicitContext)
 Allocate an object with the given type. More...
 
template<template< typename > class P = ::std::promise>
auto allocateObjectByTypeAsync (const ::std::string &type, const ::Ice::Context &context=::Ice::noExplicitContext) -> decltype(::std::declval< P<::std::shared_ptr<::Ice::ObjectPrx >>>().get_future())
 Allocate an object with the given type. More...
 
void keepAlive (const ::Ice::Context &context=::Ice::noExplicitContext)
 Keep the session alive. More...
 
::std::function< void()> keepAliveAsync (::std::function< void()> response, ::std::function< void(::std::exception_ptr)> ex=nullptr, ::std::function< void(bool)> sent=nullptr, const ::Ice::Context &context=::Ice::noExplicitContext)
 Keep the session alive. More...
 
template<template< typename > class P = ::std::promise>
auto keepAliveAsync (const ::Ice::Context &context=::Ice::noExplicitContext) -> decltype(::std::declval< P< void >>().get_future())
 Keep the session alive. More...
 
void releaseObject (const ::Ice::Identity &id, const ::Ice::Context &context=::Ice::noExplicitContext)
 Release an object that was allocated using allocateObjectById or allocateObjectByType. More...
 
::std::function< void()> releaseObjectAsync (const ::Ice::Identity &id, ::std::function< void()> response, ::std::function< void(::std::exception_ptr)> ex=nullptr, ::std::function< void(bool)> sent=nullptr, const ::Ice::Context &context=::Ice::noExplicitContext)
 Release an object that was allocated using allocateObjectById or allocateObjectByType. More...
 
template<template< typename > class P = ::std::promise>
auto releaseObjectAsync (const ::Ice::Identity &id, const ::Ice::Context &context=::Ice::noExplicitContext) -> decltype(::std::declval< P< void >>().get_future())
 Release an object that was allocated using allocateObjectById or allocateObjectByType. More...
 
void setAllocationTimeout (int timeout, const ::Ice::Context &context=::Ice::noExplicitContext)
 Set the allocation timeout. More...
 
::std::function< void()> setAllocationTimeoutAsync (int timeout, ::std::function< void()> response, ::std::function< void(::std::exception_ptr)> ex=nullptr, ::std::function< void(bool)> sent=nullptr, const ::Ice::Context &context=::Ice::noExplicitContext)
 Set the allocation timeout. More...
 
template<template< typename > class P = ::std::promise>
auto setAllocationTimeoutAsync (int timeout, const ::Ice::Context &context=::Ice::noExplicitContext) -> decltype(::std::declval< P< void >>().get_future())
 Set the allocation timeout. More...
 
- Public Member Functions inherited from Ice::Proxy< SessionPrx, ::Glacier2::SessionPrx >
::std::shared_ptr< SessionPrx > ice_adapterId (const ::std::string &id) const
 Obtains a proxy that is identical to this proxy, except for the adapter ID. More...
 
::std::shared_ptr< SessionPrx > ice_batchDatagram () const
 Obtains a proxy that is identical to this proxy, but uses batch datagram invocations. More...
 
::std::shared_ptr< SessionPrx > ice_batchOneway () const
 Obtains a proxy that is identical to this proxy, but uses batch oneway invocations. More...
 
::std::shared_ptr< SessionPrx > ice_collocationOptimized (bool b) const
 Obtains a proxy that is identical to this proxy, except for collocation optimization. More...
 
::std::shared_ptr< SessionPrx > ice_compress (bool b) const
 Obtains a proxy that is identical to this proxy, except for its compression setting which overrides the compression setting from the proxy endpoints. More...
 
::std::shared_ptr< SessionPrx > ice_connectionCached (bool b) const
 Obtains a proxy that is identical to this proxy, except for connection caching. More...
 
::std::shared_ptr< SessionPrx > ice_connectionId (const ::std::string &id) const
 Obtains a proxy that is identical to this proxy, except for its connection ID. More...
 
::std::shared_ptr< SessionPrx > ice_context (const ::Ice::Context &context) const
 Obtains a proxy that is identical to this proxy, except for the per-proxy context. More...
 
::std::shared_ptr< SessionPrx > ice_datagram () const
 Obtains a proxy that is identical to this proxy, but uses datagram invocations. More...
 
::std::shared_ptr< SessionPrx > ice_encodingVersion (const ::Ice::EncodingVersion &version) const
 Obtains a proxy that is identical to this proxy, except for the encoding used to marshal parameters. More...
 
::std::shared_ptr< SessionPrx > ice_endpoints (const ::Ice::EndpointSeq &endpoints) const
 Obtains a proxy that is identical to this proxy, except for the endpoints. More...
 
::std::shared_ptr< SessionPrx > ice_endpointSelection (::Ice::EndpointSelectionType type) const
 Obtains a proxy that is identical to this proxy, except for the endpoint selection policy. More...
 
::std::shared_ptr< SessionPrx > ice_fixed (const ::std::shared_ptr<::Ice::Connection > &connection) const
 Obtains a proxy that is identical to this proxy, except it's a fixed proxy bound the given connection. More...
 
::std::shared_ptr< SessionPrx > ice_invocationTimeout (int timeout) const
 Obtains a proxy that is identical to this proxy, except for the invocation timeout. More...
 
::std::shared_ptr< SessionPrx > ice_locator (const ::std::shared_ptr<::Ice::LocatorPrx > &locator) const
 Obtains a proxy that is identical to this proxy, except for the locator. More...
 
::std::shared_ptr< SessionPrx > ice_locatorCacheTimeout (int timeout) const
 Obtains a proxy that is identical to this proxy, except for the locator cache timeout. More...
 
::std::shared_ptr< SessionPrx > ice_oneway () const
 Obtains a proxy that is identical to this proxy, but uses oneway invocations. More...
 
::std::shared_ptr< SessionPrx > ice_preferSecure (bool b) const
 Obtains a proxy that is identical to this proxy, except for its endpoint selection policy. More...
 
::std::shared_ptr< SessionPrx > ice_router (const ::std::shared_ptr<::Ice::RouterPrx > &router) const
 Obtains a proxy that is identical to this proxy, except for the router. More...
 
::std::shared_ptr< SessionPrx > ice_secure (bool b) const
 Obtains a proxy that is identical to this proxy, except for how it selects endpoints. More...
 
::std::shared_ptr< SessionPrx > ice_timeout (int timeout) const
 Obtains a proxy that is identical to this proxy, except for its connection timeout setting which overrides the timeot setting from the proxy endpoints. More...
 
::std::shared_ptr< SessionPrx > ice_twoway () const
 Obtains a proxy that is identical to this proxy, but uses twoway invocations. More...
 

Static Public Member Functions

static const ::std::string & ice_staticId ()
 Obtains the Slice type ID of this interface. 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 Function Documentation

◆ allocateObjectById()

::std::shared_ptr<::Ice::ObjectPrx> IceGrid::SessionPrx::allocateObjectById ( const ::Ice::Identity id,
const ::Ice::Context context = ::Ice::noExplicitContext 
)
inline

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.
contextThe Context map to send with the invocation.
Returns
The proxy of the allocated object.
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

◆ allocateObjectByIdAsync() [1/2]

::std::function<void()> IceGrid::SessionPrx::allocateObjectByIdAsync ( const ::Ice::Identity id,
::std::function< void(::std::shared_ptr<::Ice::ObjectPrx >)>  response,
::std::function< void(::std::exception_ptr)>  ex = nullptr,
::std::function< void(bool)>  sent = nullptr,
const ::Ice::Context context = ::Ice::noExplicitContext 
)
inline

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.
exThe exception callback.
sentThe sent callback.
contextThe Context map to send with the invocation.
Returns
A function that can be called to cancel the invocation locally.
See also
setAllocationTimeout
releaseObject

◆ allocateObjectByIdAsync() [2/2]

template<template< typename > class P = ::std::promise>
auto IceGrid::SessionPrx::allocateObjectByIdAsync ( const ::Ice::Identity id,
const ::Ice::Context context = ::Ice::noExplicitContext 
) -> decltype(::std::declval<P<::std::shared_ptr<::Ice::ObjectPrx>>>().get_future())
inline

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.
contextThe Context map to send with the invocation.
Returns
The future object for the invocation.
See also
setAllocationTimeout
releaseObject

◆ allocateObjectByType()

::std::shared_ptr<::Ice::ObjectPrx> IceGrid::SessionPrx::allocateObjectByType ( const ::std::string &  type,
const ::Ice::Context context = ::Ice::noExplicitContext 
)
inline

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.
contextThe Context map to send with the invocation.
Returns
The proxy of the allocated object.
Exceptions
IceGrid::AllocationExceptionRaised if the object could not be allocated.
See also
setAllocationTimeout
releaseObject

◆ allocateObjectByTypeAsync() [1/2]

::std::function<void()> IceGrid::SessionPrx::allocateObjectByTypeAsync ( const ::std::string &  type,
::std::function< void(::std::shared_ptr<::Ice::ObjectPrx >)>  response,
::std::function< void(::std::exception_ptr)>  ex = nullptr,
::std::function< void(bool)>  sent = nullptr,
const ::Ice::Context context = ::Ice::noExplicitContext 
)
inline

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.
exThe exception callback.
sentThe sent callback.
contextThe Context map to send with the invocation.
Returns
A function that can be called to cancel the invocation locally.
See also
setAllocationTimeout
releaseObject

◆ allocateObjectByTypeAsync() [2/2]

template<template< typename > class P = ::std::promise>
auto IceGrid::SessionPrx::allocateObjectByTypeAsync ( const ::std::string &  type,
const ::Ice::Context context = ::Ice::noExplicitContext 
) -> decltype(::std::declval<P<::std::shared_ptr<::Ice::ObjectPrx>>>().get_future())
inline

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.
contextThe Context map to send with the invocation.
Returns
The future object for the invocation.
See also
setAllocationTimeout
releaseObject

◆ ice_staticId()

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

Obtains the Slice type ID of this interface.

Returns
The fully-scoped type ID.

◆ keepAlive()

void IceGrid::SessionPrx::keepAlive ( const ::Ice::Context context = ::Ice::noExplicitContext)
inline

Keep the session alive.

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

Parameters
contextThe Context map to send with the invocation.
See also
Registry::getSessionTimeout

◆ keepAliveAsync() [1/2]

::std::function<void()> IceGrid::SessionPrx::keepAliveAsync ( ::std::function< void()>  response,
::std::function< void(::std::exception_ptr)>  ex = nullptr,
::std::function< void(bool)>  sent = nullptr,
const ::Ice::Context context = ::Ice::noExplicitContext 
)
inline

Keep the session alive.

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

Parameters
responseThe response callback.
exThe exception callback.
sentThe sent callback.
contextThe Context map to send with the invocation.
Returns
A function that can be called to cancel the invocation locally.
See also
Registry::getSessionTimeout

◆ keepAliveAsync() [2/2]

template<template< typename > class P = ::std::promise>
auto IceGrid::SessionPrx::keepAliveAsync ( const ::Ice::Context context = ::Ice::noExplicitContext) -> decltype(::std::declval<P<void>>().get_future())
inline

Keep the session alive.

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

Parameters
contextThe Context map to send with the invocation.
Returns
The future object for the invocation.
See also
Registry::getSessionTimeout

◆ releaseObject()

void IceGrid::SessionPrx::releaseObject ( const ::Ice::Identity id,
const ::Ice::Context context = ::Ice::noExplicitContext 
)
inline

Release an object that was allocated using allocateObjectById or allocateObjectByType.

Parameters
idThe identity of the object to release.
contextThe Context map to send with 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.

◆ releaseObjectAsync() [1/2]

::std::function<void()> IceGrid::SessionPrx::releaseObjectAsync ( const ::Ice::Identity id,
::std::function< void()>  response,
::std::function< void(::std::exception_ptr)>  ex = nullptr,
::std::function< void(bool)>  sent = nullptr,
const ::Ice::Context context = ::Ice::noExplicitContext 
)
inline

Release an object that was allocated using allocateObjectById or allocateObjectByType.

Parameters
idThe identity of the object to release.
responseThe response callback.
exThe exception callback.
sentThe sent callback.
contextThe Context map to send with the invocation.
Returns
A function that can be called to cancel the invocation locally.

◆ releaseObjectAsync() [2/2]

template<template< typename > class P = ::std::promise>
auto IceGrid::SessionPrx::releaseObjectAsync ( const ::Ice::Identity id,
const ::Ice::Context context = ::Ice::noExplicitContext 
) -> decltype(::std::declval<P<void>>().get_future())
inline

Release an object that was allocated using allocateObjectById or allocateObjectByType.

Parameters
idThe identity of the object to release.
contextThe Context map to send with the invocation.
Returns
The future object for the invocation.

◆ setAllocationTimeout()

void IceGrid::SessionPrx::setAllocationTimeout ( int  timeout,
const ::Ice::Context context = ::Ice::noExplicitContext 
)
inline

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.
contextThe Context map to send with the invocation.

◆ setAllocationTimeoutAsync() [1/2]

::std::function<void()> IceGrid::SessionPrx::setAllocationTimeoutAsync ( int  timeout,
::std::function< void()>  response,
::std::function< void(::std::exception_ptr)>  ex = nullptr,
::std::function< void(bool)>  sent = nullptr,
const ::Ice::Context context = ::Ice::noExplicitContext 
)
inline

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.
responseThe response callback.
exThe exception callback.
sentThe sent callback.
contextThe Context map to send with the invocation.
Returns
A function that can be called to cancel the invocation locally.

◆ setAllocationTimeoutAsync() [2/2]

template<template< typename > class P = ::std::promise>
auto IceGrid::SessionPrx::setAllocationTimeoutAsync ( int  timeout,
const ::Ice::Context context = ::Ice::noExplicitContext 
) -> decltype(::std::declval<P<void>>().get_future())
inline

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.
contextThe Context map to send with the invocation.
Returns
The future object for the invocation.

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