@zeroc/ice
    Preparing search index...

    Interface ServantLocator

    An application-provided class that an object adapter uses to locate servants.

    Servant locators are provided for backward compatibility with earlier versions of Ice. You should consider using a default servant instead (see ObjectAdapter#addDefaultServant). For more advanced use cases, you can create a middleware (see ObjectAdapter#use).

    interface ServantLocator {
        deactivate(category: string): void;
        finished(current: Current, servant: Object, cookie: object): void;
        locate(current: Current): [Object, object];
    }
    Index

    Methods

    • Notifies this servant locator that the object adapter in which it's installed is being deactivated.

      Parameters

      • category: string

        The category with which this servant locator was registered.

      Returns void

    • Notifies this servant locator that the dispatch on the servant returned by locate is complete. The object adapter calls this function only when locate returns a non-null servant.

      Parameters

      • current: Current

        Information about the incoming request being dispatched.

      • servant: Object

        The servant that was returned by locate.

      • cookie: object

        The cookie that was returned by locate.

      Returns void

      The implementation can throw any exception, including UserException. The Ice runtime marshals this exception in the response. If both the dispatch and finished throw an exception, the exception thrown by finished prevails and is marshaled back to the client.

      UserException - The implementation can raise a UserException, and the runtime will marshal it as the result of the invocation.

    • Asks this servant locator to find and return a servant.

      Parameters

      • current: Current

        Information about the incoming request being dispatched.

      Returns [Object, object]

      An array where:

      • [0]: The located servant, or null if no suitable servant was found.
      • [1]: A "cookie" that will be passed to finished.

      The caller (the object adapter) does not insert the returned servant into its Active Servant Map.

      The implementation can throw any exception, including UserException. The Ice runtime marshals this exception in the response.

      UserException - The implementation can raise a UserException, and the runtime will marshal it as the result of the invocation.