@zeroc/ice
    Preparing search index...

    Interface ObjectAdapter

    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.

    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(middleware: (next: Object) => Object): ObjectAdapter;
    }
    Index

    Methods

    • 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

      • servant: Object

        The default servant.

      • category: string

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

      Returns void

    • 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 throws ObjectNotExistException or FacetNotExistException.
      Only one locator for the empty category can be installed.

      Parameters

      • locator: ServantLocator

        The locator to add.

      • category: string

        The 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 void

    • Create a direct proxy for the object with the given identity. The returned proxy contains this object adapter's published endpoints.

      Parameters

      Returns ObjectPrx

      A proxy for the object with the given identity.

    • 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

      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

    • 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

      • id: Identity

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

      Returns Object

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

    • 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.

    • 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

      • proxy: ObjectPrx

        The proxy for which the servant should be returned.

      Returns Object

      The servant that matches the proxy, or null if no such servant has been found.

    • Like ObjectAdapter#find, but with a facet.

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

      Parameters

      • id: Identity

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

      • facet: string

        The facet. 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.

    • Get the set of endpoints configured with this object adapter.

      Returns Endpoint[]

      The set of endpoints.

    • Get the name of this object adapter.

      Returns string

      This object adapter's name.

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

      Returns Endpoint[]

      The set of published endpoints.

    • 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

      • 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.

    • Set of 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

    • Install a middleware in this object adapter.

      Parameters

      • middleware: (next: Object) => Object

        The middleware to install.

      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.