Ice 3.7 C++98 API Reference
Loading...
Searching...
No Matches
Ice::ObjectAdapter Class Referenceabstract

The object adapter provides an up-call interface from the Ice run time to the implementation of Ice objects. More...

#include <Ice/Ice.h>

Inheritance diagram for Ice::ObjectAdapter:
Collaboration diagram for Ice::ObjectAdapter:

Public Types

typedef ObjectAdapterPtr PointerType

Public Member Functions

virtual void activate ()=0
 Activate all endpoints that belong to this object adapter.
virtual ObjectPrx add (const ObjectPtr &servant, const Identity &id)=0
 Add a servant to this object adapter's Active Servant Map.
virtual void addDefaultServant (const ObjectPtr &servant, const ::std::string &category)=0
 Add a default servant to handle requests for a specific category.
virtual ObjectPrx addFacet (const ObjectPtr &servant, const Identity &id, const ::std::string &facet)=0
 Like add, but with a facet.
virtual ObjectPrx addFacetWithUUID (const ObjectPtr &servant, const ::std::string &facet)=0
 Like addWithUUID, but with a facet.
virtual void addServantLocator (const ServantLocatorPtr &locator, const ::std::string &category)=0
 Add a Servant Locator to this object adapter.
virtual ObjectPrx addWithUUID (const ObjectPtr &servant)=0
 Add a servant to this object adapter's Active Servant Map, using an automatically generated UUID as its identity.
virtual ObjectPrx createDirectProxy (const Identity &id) const =0
 Create a direct proxy for the object with the given identity.
virtual ObjectPrx createIndirectProxy (const Identity &id) const =0
 Create an indirect proxy for the object with the given identity.
virtual ObjectPrx createProxy (const Identity &id) const =0
 Create a proxy for the object with the given identity.
virtual void deactivate () throw () =0
 Deactivate all endpoints that belong to this object adapter.
virtual void destroy () throw () =0
 Destroys the object adapter and cleans up all resources held by the object adapter.
virtual ObjectPtr find (const Identity &id) const =0
 Look up a servant in this object adapter's Active Servant Map by the identity of the Ice object it implements.
virtual FacetMap findAllFacets (const Identity &id) const =0
 Find all facets with the given identity in the Active Servant Map.
virtual ObjectPtr findByProxy (const ObjectPrx &proxy) const =0
 Look up a servant in this object adapter's Active Servant Map, given a proxy.
virtual ObjectPtr findDefaultServant (const ::std::string &category) const =0
 Find the default servant for a specific category.
virtual ObjectPtr findFacet (const Identity &id, const ::std::string &facet) const =0
 Like find, but with a facet.
virtual ServantLocatorPtr findServantLocator (const ::std::string &category) const =0
 Find a Servant Locator installed with this object adapter.
virtual CommunicatorPtr getCommunicator () const throw () =0
 Get the communicator this object adapter belongs to.
virtual EndpointSeq getEndpoints () const throw () =0
 Get the set of endpoints configured with this object adapter.
virtual LocatorPrx getLocator () const throw () =0
 Get the Ice locator used by this object adapter.
virtual::std::string getName () const throw () =0
 Get the name of this object adapter.
virtual EndpointSeq getPublishedEndpoints () const throw () =0
 Get the set of endpoints that proxies created by this object adapter will contain.
virtual void hold ()=0
 Temporarily hold receiving and dispatching requests.
virtual bool isDeactivated () const throw () =0
 Check whether object adapter has been deactivated.
virtual void refreshPublishedEndpoints ()=0
 Refresh the set of published endpoints.
virtual ObjectPtr remove (const Identity &id)=0
 Remove a servant (that is, the default facet) from the object adapter's Active Servant Map.
virtual FacetMap removeAllFacets (const Identity &id)=0
 Remove all facets with the given identity from the Active Servant Map.
virtual ObjectPtr removeDefaultServant (const ::std::string &category)=0
 Remove the default servant for a specific category.
virtual ObjectPtr removeFacet (const Identity &id, const ::std::string &facet)=0
 Like remove, but with a facet.
virtual ServantLocatorPtr removeServantLocator (const ::std::string &category)=0
 Remove a Servant Locator from this object adapter.
virtual void setLocator (const LocatorPrx &loc)=0
 Set an Ice locator for this object adapter.
virtual void setPublishedEndpoints (const EndpointSeq &newEndpoints)=0
 Set of the endpoints that proxies created by this object adapter will contain.
virtual void waitForDeactivate () throw () =0
 Wait until the object adapter has deactivated.
virtual void waitForHold ()=0
 Wait until the object adapter holds requests.
virtual ~ObjectAdapter ()
Public Member Functions inherited from Ice::LocalObject
virtual bool operator< (const LocalObject &) const
virtual bool operator== (const LocalObject &) const
Public Member Functions inherited from IceUtil::Shared
void __clearFlag (unsigned char flag)
virtual void __decRef ()
virtual int __getRef () const
bool __hasFlag (unsigned char flag)
virtual void __incRef ()
void __setFlag (unsigned char flag)
virtual void __setNoDelete (bool)
Sharedoperator= (const Shared &)
 Shared ()
 Shared (const Shared &)
virtual ~Shared ()

Additional Inherited Members

Static Public Attributes inherited from IceUtil::Shared
static const unsigned char NoDelete
Protected Attributes inherited from IceUtil::Shared
unsigned char _flags
IceUtilInternal::Atomic _ref

Detailed Description

The object adapter provides an up-call interface from the Ice run time to the implementation of Ice objects.

The object adapter is responsible for receiving requests from endpoints, and for mapping between servants, identities, and proxies.

See also
Communicator
ServantLocator

Member Typedef Documentation

◆ PointerType

Constructor & Destructor Documentation

◆ ~ObjectAdapter()

virtual Ice::ObjectAdapter::~ObjectAdapter ( )
virtual

Member Function Documentation

◆ activate()

virtual void Ice::ObjectAdapter::activate ( )
pure virtual

Activate all endpoints that belong to this object adapter.

After activation, the object adapter can dispatch requests received through its endpoints.

See also
hold
deactivate

◆ add()

virtual ObjectPrx Ice::ObjectAdapter::add ( const ObjectPtr & servant,
const Identity & id )
pure virtual

Add a servant to this object adapter's Active Servant Map.

Note that one servant can implement several Ice objects by registering the servant with multiple identities. Adding a servant with an identity that is in the map already throws AlreadyRegisteredException.

Parameters
servantThe servant to add.
idThe identity of the Ice object that is implemented by the servant.
Returns
A proxy that matches the given identity and this object adapter.
See also
Identity
addFacet
addWithUUID
remove
find

◆ addDefaultServant()

virtual void Ice::ObjectAdapter::addDefaultServant ( const ObjectPtr & servant,
const ::std::string & category )
pure virtual

Add a default servant to handle requests for a specific category.

Adding a default servant for a category for which a default servant is already registered throws AlreadyRegisteredException. To dispatch operation calls on servants, the object adapter tries to find a servant for a given Ice object identity and facet in the following order:

  1. The object adapter tries to find a servant for the identity and facet in the Active Servant Map.

  2. If no servant has been found in the Active Servant Map, the object adapter tries to find a default servant for the category component of the identity.

  3. If no servant has been found by any of the preceding steps, the object adapter tries to find a default servant for an empty category, regardless of the category contained in the identity.

  4. If no servant has been found by any of the preceding steps, the object adapter gives up and the caller receives ObjectNotExistException or FacetNotExistException.

Parameters
servantThe default servant.
categoryThe category for which the default servant is registered. An empty category means it will handle all categories.
See also
removeDefaultServant
findDefaultServant

◆ addFacet()

virtual ObjectPrx Ice::ObjectAdapter::addFacet ( const ObjectPtr & servant,
const Identity & id,
const ::std::string & facet )
pure virtual

Like add, but with a facet.

Calling add(servant, id) is equivalent to calling addFacet with an empty facet.

Parameters
servantThe servant to add.
idThe identity of the Ice object that is implemented by the servant.
facetThe facet. An empty facet means the default facet.
Returns
A proxy that matches the given identity, facet, and this object adapter.
See also
Identity
add
addFacetWithUUID
removeFacet
findFacet

◆ addFacetWithUUID()

virtual ObjectPrx Ice::ObjectAdapter::addFacetWithUUID ( const ObjectPtr & servant,
const ::std::string & facet )
pure virtual

Like addWithUUID, but with a facet.

Calling addWithUUID(servant) is equivalent to calling addFacetWithUUID with an empty facet.

Parameters
servantThe servant to add.
facetThe facet. An empty facet means the default facet.
Returns
A proxy that matches the generated UUID identity, facet, and this object adapter.
See also
Identity
addFacet
addWithUUID
removeFacet
findFacet

◆ addServantLocator()

virtual void Ice::ObjectAdapter::addServantLocator ( const ServantLocatorPtr & locator,
const ::std::string & category )
pure virtual

Add a Servant Locator to this object adapter.

Adding a servant locator for a category for which a servant locator is already registered throws AlreadyRegisteredException. To dispatch operation calls on servants, the object adapter tries to find a servant for a given Ice object identity and facet in the following order:

  1. The object adapter tries to find a servant for the identity and facet in the Active Servant Map.

  2. If no servant has been found in the Active Servant Map, the object adapter tries to find a servant locator for the category component of the identity. If a locator is found, the object adapter tries to find a servant using this locator.

  3. If no servant has been found by any of the preceding steps, the object adapter tries to find a locator for an empty category, regardless of the category contained in the identity. If a locator is found, the object adapter tries to find a servant using this locator.

  4. If no servant has been found by any of the preceding steps, the object adapter gives up and the caller receives ObjectNotExistException or FacetNotExistException.

Only one locator for the empty category can be installed.

Parameters
locatorThe locator to add.
categoryThe category for which the Servant Locator can locate servants, or an empty string if the Servant Locator does not belong to any specific category.
See also
Identity
removeServantLocator
findServantLocator
ServantLocator

◆ addWithUUID()

virtual ObjectPrx Ice::ObjectAdapter::addWithUUID ( const ObjectPtr & servant)
pure virtual

Add a servant to this object adapter's Active Servant Map, using an automatically generated UUID as its identity.

Note that the generated UUID identity can be accessed using the proxy's ice_getIdentity operation.

Parameters
servantThe servant to add.
Returns
A proxy that matches the generated UUID identity and this object adapter.
See also
Identity
add
addFacetWithUUID
remove
find

◆ createDirectProxy()

virtual ObjectPrx Ice::ObjectAdapter::createDirectProxy ( const Identity & id) const
pure virtual

Create a direct proxy for the object with the given identity.

The returned proxy contains this object adapter's published endpoints.

Parameters
idThe object's identity.
Returns
A proxy for the object with the given identity.
See also
Identity

◆ createIndirectProxy()

virtual ObjectPrx Ice::ObjectAdapter::createIndirectProxy ( const Identity & id) const
pure virtual

Create an indirect proxy for the object with the given identity.

If this object adapter is configured with an adapter id, the return value refers to the adapter id. Otherwise, the return value contains only the object identity.

Parameters
idThe object's identity.
Returns
A proxy for the object with the given identity.
See also
Identity

◆ createProxy()

virtual ObjectPrx Ice::ObjectAdapter::createProxy ( const Identity & id) const
pure virtual

Create a proxy for the object with the given identity.

If this object adapter is configured with an adapter id, the return value is an indirect proxy that refers to the adapter id. If a replica group id is also defined, the return value is an indirect proxy that refers to the replica group id. Otherwise, if no adapter id is defined, the return value is a direct proxy containing this object adapter's published endpoints.

Parameters
idThe object's identity.
Returns
A proxy for the object with the given identity.
See also
Identity

◆ deactivate()

virtual void Ice::ObjectAdapter::deactivate ( )
throw ( )
pure virtual

Deactivate all endpoints that belong to this object adapter.

After deactivation, the object adapter stops receiving requests through its endpoints. Object adapters that have been deactivated must not be reactivated again, and cannot be used otherwise. Attempts to use a deactivated object adapter raise ObjectAdapterDeactivatedException however, attempts to deactivate an already deactivated object adapter are ignored and do nothing. Once deactivated, it is possible to destroy the adapter to clean up resources and then create and activate a new adapter with the same name.

After deactivate returns, no new requests are processed by the object adapter. However, requests that have been started before deactivate was called might still be active. You can use waitForDeactivate to wait for the completion of all requests for this object adapter.

See also
activate
hold
waitForDeactivate
Communicator::shutdown

◆ destroy()

virtual void Ice::ObjectAdapter::destroy ( )
throw ( )
pure virtual

Destroys the object adapter and cleans up all resources held by the object adapter.

If the object adapter has not yet been deactivated, destroy implicitly initiates the deactivation and waits for it to finish. Subsequent calls to destroy are ignored. Once destroy has returned, it is possible to create another object adapter with the same name.

See also
deactivate
waitForDeactivate
Communicator::destroy

◆ find()

virtual ObjectPtr Ice::ObjectAdapter::find ( const Identity & id) const
pure virtual

Look up a servant in this object adapter's Active Servant Map by the identity of the Ice object it implements.

This operation only tries to look up a servant in the Active Servant Map. It does not attempt to find a servant by using any installed ServantLocator.

Parameters
idThe identity of the Ice object for which the servant should be returned.
Returns
The servant that implements the Ice object with the given identity, or null if no such servant has been found.
See also
Identity
findFacet
findByProxy

◆ findAllFacets()

virtual FacetMap Ice::ObjectAdapter::findAllFacets ( const Identity & id) const
pure virtual

Find all facets with the given identity in the Active Servant Map.

Parameters
idThe identity of the Ice object for which the facets should be returned.
Returns
A collection containing all the facet names and servants that have been found, or an empty map if there is no facet for the given identity.
See also
find
findFacet

◆ findByProxy()

virtual ObjectPtr Ice::ObjectAdapter::findByProxy ( const ObjectPrx & proxy) const
pure virtual

Look up a servant in this object adapter's Active Servant Map, given a proxy.

This operation only tries to lookup a servant in the Active Servant Map. It does not attempt to find a servant by using any installed ServantLocator.

Parameters
proxyThe proxy for which the servant should be returned.
Returns
The servant that matches the proxy, or null if no such servant has been found.
See also
find
findFacet

◆ findDefaultServant()

virtual ObjectPtr Ice::ObjectAdapter::findDefaultServant ( const ::std::string & category) const
pure virtual

Find the default servant for a specific category.

Parameters
categoryThe category of the default servant to find.
Returns
The default servant or null if no default servant was registered for the category.
See also
addDefaultServant
removeDefaultServant

◆ findFacet()

virtual ObjectPtr Ice::ObjectAdapter::findFacet ( const Identity & id,
const ::std::string & facet ) const
pure virtual

Like find, but with a facet.

Calling find(id) is equivalent to calling findFacet with an empty facet.

Parameters
idThe identity of the Ice object for which the servant should be returned.
facetThe facet. An empty facet means the default facet.
Returns
The servant that implements the Ice object with the given identity and facet, or null if no such servant has been found.
See also
Identity
find
findByProxy

◆ findServantLocator()

virtual ServantLocatorPtr Ice::ObjectAdapter::findServantLocator ( const ::std::string & category) const
pure virtual

Find a Servant Locator installed with this object adapter.

Parameters
categoryThe category for which the Servant Locator can locate servants, or an empty string if the Servant Locator does not belong to any specific category.
Returns
The Servant Locator, or null if no Servant Locator was found for the given category.
See also
Identity
addServantLocator
removeServantLocator
ServantLocator

◆ getCommunicator()

virtual CommunicatorPtr Ice::ObjectAdapter::getCommunicator ( ) const
throw ( )
pure virtual

Get the communicator this object adapter belongs to.

Returns
This object adapter's communicator.
See also
Communicator

◆ getEndpoints()

virtual EndpointSeq Ice::ObjectAdapter::getEndpoints ( ) const
throw ( )
pure virtual

Get the set of endpoints configured with this object adapter.

Returns
The set of endpoints.
See also
Endpoint

◆ getLocator()

virtual LocatorPrx Ice::ObjectAdapter::getLocator ( ) const
throw ( )
pure virtual

Get the Ice locator used by this object adapter.

Returns
The locator used by this object adapter, or null if no locator is used by this object adapter.
See also
Locator
setLocator

◆ getName()

virtual::std::string Ice::ObjectAdapter::getName ( ) const
throw ( )
pure virtual

Get the name of this object adapter.

Returns
This object adapter's name.

◆ getPublishedEndpoints()

virtual EndpointSeq Ice::ObjectAdapter::getPublishedEndpoints ( ) const
throw ( )
pure virtual

Get the set of endpoints that proxies created by this object adapter will contain.

Returns
The set of published endpoints.
See also
refreshPublishedEndpoints
Endpoint

◆ hold()

virtual void Ice::ObjectAdapter::hold ( )
pure virtual

Temporarily hold receiving and dispatching requests.

The object adapter can be reactivated with the activate operation.

Holding is not immediate, i.e., after hold returns, the object adapter might still be active for some time. You can use waitForHold to wait until holding is complete.

See also
activate
deactivate
waitForHold

◆ isDeactivated()

virtual bool Ice::ObjectAdapter::isDeactivated ( ) const
throw ( )
pure virtual

Check whether object adapter has been deactivated.

Returns
Whether adapter has been deactivated.
See also
Communicator::shutdown

◆ refreshPublishedEndpoints()

virtual void Ice::ObjectAdapter::refreshPublishedEndpoints ( )
pure virtual

Refresh the set of published endpoints.

The run time re-reads the PublishedEndpoints property if it is set and re-reads the list of local interfaces if the adapter is configured to listen on all endpoints. This operation is useful to refresh the endpoint information that is published in the proxies that are created by an object adapter if the network interfaces used by a host changes.

◆ remove()

virtual ObjectPtr Ice::ObjectAdapter::remove ( const Identity & id)
pure virtual

Remove a servant (that is, the default facet) from the object adapter's Active Servant Map.

Parameters
idThe identity of the Ice object that is implemented by the servant. If the servant implements multiple Ice objects, remove has to be called for all those Ice objects. Removing an identity that is not in the map throws NotRegisteredException.
Returns
The removed servant.
See also
Identity
add
addWithUUID

◆ removeAllFacets()

virtual FacetMap Ice::ObjectAdapter::removeAllFacets ( const Identity & id)
pure virtual

Remove all facets with the given identity from the Active Servant Map.

The operation completely removes the Ice object, including its default facet. Removing an identity that is not in the map throws NotRegisteredException.

Parameters
idThe identity of the Ice object to be removed.
Returns
A collection containing all the facet names and servants of the removed Ice object.
See also
remove
removeFacet

◆ removeDefaultServant()

virtual ObjectPtr Ice::ObjectAdapter::removeDefaultServant ( const ::std::string & category)
pure virtual

Remove the default servant for a specific category.

Attempting to remove a default servant for a category that is not registered throws NotRegisteredException.

Parameters
categoryThe category of the default servant to remove.
Returns
The default servant.
See also
addDefaultServant
findDefaultServant

◆ removeFacet()

virtual ObjectPtr Ice::ObjectAdapter::removeFacet ( const Identity & id,
const ::std::string & facet )
pure virtual

Like remove, but with a facet.

Calling remove(id) is equivalent to calling removeFacet with an empty facet.

Parameters
idThe identity of the Ice object that is implemented by the servant.
facetThe facet. An empty facet means the default facet.
Returns
The removed servant.
See also
Identity
addFacet
addFacetWithUUID

◆ removeServantLocator()

virtual ServantLocatorPtr Ice::ObjectAdapter::removeServantLocator ( const ::std::string & category)
pure virtual

Remove a Servant Locator from this object adapter.

Parameters
categoryThe category for which the Servant Locator can locate servants, or an empty string if the Servant Locator does not belong to any specific category.
Returns
The Servant Locator, or throws NotRegisteredException if no Servant Locator was found for the given category.
See also
Identity
addServantLocator
findServantLocator
ServantLocator

◆ setLocator()

virtual void Ice::ObjectAdapter::setLocator ( const LocatorPrx & loc)
pure virtual

Set an Ice locator for this object adapter.

By doing so, the object adapter will register itself with the locator registry when it is activated for the first time. Furthermore, the proxies created by this object adapter will contain the adapter identifier instead of its endpoints. The adapter identifier must be configured using the AdapterId property.

Parameters
locThe locator used by this object adapter.
See also
createDirectProxy
Locator
LocatorRegistry

◆ setPublishedEndpoints()

virtual void Ice::ObjectAdapter::setPublishedEndpoints ( const EndpointSeq & newEndpoints)
pure virtual

Set of the endpoints that proxies created by this object adapter will contain.

Parameters
newEndpointsThe new set of endpoints that the object adapter will embed in proxies.
See also
refreshPublishedEndpoints
Endpoint

◆ waitForDeactivate()

virtual void Ice::ObjectAdapter::waitForDeactivate ( )
throw ( )
pure virtual

Wait until the object adapter has deactivated.

Calling deactivate initiates object adapter deactivation, and waitForDeactivate only returns when deactivation has been completed.

See also
deactivate
waitForHold
Communicator::waitForShutdown

◆ waitForHold()

virtual void Ice::ObjectAdapter::waitForHold ( )
pure virtual

Wait until the object adapter holds requests.

Calling hold initiates holding of requests, and waitForHold only returns when holding of requests has been completed.

See also
hold
waitForDeactivate
Communicator::waitForShutdown

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