@zeroc/ice
    Preparing search index...

    Interface ServantLocator

    A servant locator is called by an object adapter to locate a servant that is not found in its active servant map.

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

    Methods

    • Called when the object adapter in which this servant locator is installed is destroyed.

      Parameters

      • category: string

        The category for which the servant locator is being deactivated.

      Returns void

    • Called by the object adapter after a request has been processed. This operation is only invoked if locate was called before the request and returned a non-null servant. The finished method can be used for cleanup purposes after a request.

      The finished method can throw any user exception. If it does, that exception is marshaled back to the client. If the Slice definition for the corresponding operation includes that user exception, the client receives it; otherwise, the client receives an UnknownUserException. If both the operation and finished throw exceptions, the exception thrown by finished is marshaled back to the client.

      Parameters

      • current: Current

        Information about the current operation call for which a servant was located by locate.

      • servant: Object

        The servant that was returned by locate.

      • cookie: object

        The cookie that was returned by locate.

      Returns void

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

    • Called before a request is dispatched if a servant cannot be found in the object adapter's active servant map. Note that the object adapter does not automatically insert the returned servant into its active servant map. This must be done by the servant locator implementation, if desired. The locate method can throw any user exception. If it does, that exception is marshaled back to the client. If the Slice definition for the corresponding operation includes that user exception, the client receives it; otherwise, the client receives an UnknownUserException.

      If locate throws any exception, the Ice runtime does not call finished.

      Parameters

      • current: Current

        Information about the current operation for which a servant is required.

      • cookie: Holder<object>

        A "cookie" that will be passed to finished.

      Returns Object

      The located servant, or null if no suitable servant has been found.

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