@zeroc/ice
    Preparing search index...

    Interface ObjectAdapter

    An object adapter is the main server-side Ice API. It has two main purposes:

    interface ObjectAdapter {
        add(servant: Object, id: Identity): ObjectPrx;
        addDefaultServant(servant: Object, category: string): void;
        addFacet(servant: Object, id: Identity, facet: string): ObjectPrx;
        addFacetWithUUID(servant: Object, facet: string): ObjectPrx;
        addServantLocator(locator: ServantLocator, category: string): void;
        addWithUUID(servant: Object): ObjectPrx;
        createDirectProxy(id: Identity): ObjectPrx;
        createProxy(id: Identity): ObjectPrx;
        destroy(): void;
        find(id: Identity): Object;
        findAllFacets(id: Identity): Map<string, Object>;
        findByProxy(proxy: ObjectPrx): Object;
        findDefaultServant(category: string): Object;
        findFacet(id: Identity, facet: string): Object;
        findServantLocator(category: string): ServantLocator;
        getCommunicator(): Communicator;
        getEndpoints(): Endpoint[];
        getName(): string;
        getPublishedEndpoints(): Endpoint[];
        remove(id: Identity): Object;
        removeAllFacets(id: Identity): Map<string, Object>;
        removeDefaultServant(category: string): Object;
        removeFacet(id: Identity, facet: string): Object;
        removeServantLocator(category: string): ServantLocator;
        setPublishedEndpoints(newEndpoints: Endpoint[]): void;
        use(middlewareFactory: (next: Object) => Object): ObjectAdapter;
    }
    Index

    Methods

    • Adds a default servant to handle requests for a specific category. When an object adapter dispatches an incoming request, it tries to find a servant for the identity and facet carried by the request in the following order:

      • The object adapter tries to find a servant for the identity and facet in the Active Servant Map.
      • If this fails, the object adapter tries to find a default servant for the category component of the identity.
      • If this fails, the object adapter tries to find a default servant for the empty category, regardless of the category contained in the identity.
      • If this fails, the object adapter tries to find a servant locator for the category component of the identity. If there is no such servant locator, the object adapter tries to find a servant locator for the empty category.
      • If a servant locator is found, the object adapter tries to find a servant using this servant locator.
      • If all the previous steps fail, the object adapter gives up and the caller receives an ObjectNotExistException or a FacetNotExistException.

      Parameters

      • servant: Object

        The default servant to add.

      • category: string

        The category for which the default servant is registered. The empty category means it will handle all categories.

      Returns void

      AlreadyRegisteredException Thrown when a default servant with the same category is already registered.

    • Adds a servant to this object adapter's Active Servant Map (ASM), while specifying a facet. The ASM is a map {identity, facet} -> servant.

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

      Parameters

      • servant: Object

        The servant to add.

      • id: Identity

        The identity of the Ice object that is implemented by the servant.

      • facet: string

        The facet of the Ice object that is implemented by the servant.

      Returns ObjectPrx

      A proxy with the given id and facet, created by this object adapter.

    • Adds a servant to this object adapter's Active Servant Map (ASM), using an automatically generated UUID as its identity. Also specifies a facet.

      Parameters

      • servant: Object

        The servant to add.

      • facet: string

        The facet of the Ice object that is implemented by the servant.

      Returns ObjectPrx

      A proxy with the generated UUID identity and the specified facet.

    • Adds a ServantLocator to this object adapter for a specific category.

      Parameters

      • locator: ServantLocator

        The servant locator to add.

      • category: string

        The category. The empty category means the locator handles all categories.

      Returns void

      AlreadyRegisteredException Thrown when a servant locator with the same category is already registered.

    • Adds a servant to this object adapter's Active Servant Map (ASM), using an automatically generated UUID as its identity.

      The generated UUID identity can be accessed using the ObjectPrx#ice_getIdentity operation.

      Parameters

      • servant: Object

        The servant to add.

      Returns ObjectPrx

      A proxy with the generated UUID identity created by this object adapter.

    • Creates a direct proxy from an Ice identity.

      Parameters

      Returns ObjectPrx

      A proxy for the object with the given identity.

    • Creates a proxy from an Ice identity. If this object adapter is configured with an adapter ID, the proxy is an indirect proxy that refers to this adapter ID. If a replica group ID is also defined, the proxy is an indirect proxy that refers to this replica group ID. Otherwise, the proxy is a direct proxy containing this object adapter's published endpoints.

      Parameters

      Returns ObjectPrx

      A proxy for the object with the given identity.

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

      Returns void

    • Looks up a servant..

      Parameters

      • id: Identity

        The identity of an Ice object.

      Returns Object

      The servant that implements the Ice object with the given identity, or null if no such servant has been found.

      This function only tries to find the servant in the ASM and among the default servants. It does not attempt to locate a servant using servant locators.

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

      Parameters

      • id: Identity

        The identity of the Ice object for which the facets should be returned.

      Returns Map<string, Object>

      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.

    • Looks up a servant with an identity and a facet. It's equivalent to calling #findFacet.

      Parameters

      • proxy: ObjectPrx

        The proxy that provides the identity and facet to search.

      Returns Object

      The servant that matches the identity and facet carried by the proxy, or null if no such servant has been found.

    • Finds a ServantLocator registered with this object adapter.

      Parameters

      • category: string

        The category.

      Returns Object

      The servant locator, or null if not found.

    • Looks up a servant with an identity and facet.

      Parameters

      • id: Identity

        The identity of an Ice object.

      • facet: string

        The facet of an Ice object. An empty facet means the default facet.

      Returns Object

      The servant that implements the Ice object with the given identity and facet, or null if no such servant has been found.

      This function only tries to find the servant in the ASM and among the default servants. It does not attempt to locate a servant using servant locators.

    • Gets the set of endpoints configured on this object adapter.

      Returns Endpoint[]

      The set of endpoints.

    • Get the name of this object adapter.

      Returns string

      This object adapter's name.

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

      Returns Endpoint[]

      The set of published endpoints.

    • Removes a servant from the object adapter's Active Servant Map.

      Parameters

      • id: Identity

        The identity of the Ice object that is implemented by the servant.

      Returns Object

      The removed servant.

      NotRegisteredException Thrown when no servant with the given identity is registered.

    • Removes all facets with the given identity from the Active Servant Map. The function completely removes the Ice object, including its default facet.

      Parameters

      • id: Identity

        The identity of the Ice object to be removed.

      Returns Map<string, Object>

      A collection containing all the facet names and servants of the removed Ice object.

      NotRegisteredException Thrown when no servant with the given identity is registered.

    • Removes the default servant for a specific category.

      Parameters

      • category: string

        The category of the default servant to remove.

      Returns Object

      The default servant.

      NotRegisteredException Thrown when no default servant is registered for the given category.

    • Removes a servant from the object adapter's Active Servant Map, while specifying a facet.

      Parameters

      • id: Identity

        The identity of the Ice object that is implemented by the servant.

      • facet: string

        The facet. An empty facet means the default facet.

      Returns Object

      The removed servant.

      NotRegisteredException Thrown when no servant with the given identity and facet is registered.

    • Removes a ServantLocator from this object adapter.

      Parameters

      • category: string

        The category.

      Returns ServantLocator

      The servant locator.

      NotRegisteredExceptionThrown when no ServantLocator with the given category is registered.

    • Sets the endpoints that proxies created by this object adapter will contain.

      Parameters

      • newEndpoints: Endpoint[]

        The new set of endpoints that the object adapter will embed in proxies.

      Returns void

      Error Thrown when the newEndpoints is empty or this adapter is associated with a router.

    • Adds a middleware to the dispatch pipeline of this object adapter.

      Parameters

      • middlewareFactory: (next: Object) => Object

        The middleware factory that creates the new middleware when this object adapter creates its dispatch pipeline. A middleware factory is a function that takes an Object (the next element in the dispatch pipeline) and returns a new Object (the middleware you want to install in the pipeline).

      Returns ObjectAdapter

      This object adapter.

      Error Thrown if the object adapter's dispatch pipeline has already been created. This creation typically occurs the first time the object adapter dispatches an incoming request.