@zeroc/ice
    Preparing search index...

    Class Communicator

    Communicator is the central object in Ice. Its responsibilities include:

    • creating and managing outgoing connections
    • creating and destroying object adapters
    • managing properties (configuration), retries, logging, and more.

    You create a communicator with new Ice.Communicator(), and it's usually the first object you create when programming with Ice.

    Index

    Constructors

    • Creates a communicator. When called without initialization data, the communicator is created with default options.

      Parameters

      • OptionalinitData: InitializationData

        The optional initialization data for the new communicator.

      Returns Communicator

      InitializationException If an error occurs during initialization.

    • Creates a communicator.

      Parameters

      • args: string[]

        A command-line argument vector. Any Ice-related options in this vector are used to initialize the communicator. This method modifies the argument vector by removing any Ice-related options.

      Returns Communicator

      InitializationException If an error occurs during initialization.

    Methods

    • Asynchronously disposes this communicator. It's an alias for destroy.

      Returns Promise<void>

    • Creates a new object adapter.

      It is valid to create an object adapter with an empty string as its name. Such an object adapter is accessible via bidirectional connections.

      Parameters

      • name: string

        The object adapter name.

      Returns Promise<ObjectAdapter>

      A promise that resolves to the created object adapter.

      CommunicatorDestroyedException - Thrown when the communicator has been destroyed.

      The returned promise rejects with InitializationException when a named object adapter has no configuration, with PropertyException when the adapter properties are invalid (for example, name.Endpoints is not supported: JavaScript object adapters do not listen on endpoints; only bidirectional adapters and router-associated adapters are supported), and with AlreadyRegisteredException when an adapter with the same name already exists.

    • Destroys this communicator. This method calls shutdown implicitly. Calling destroy destroys all object adapters, and closes all outgoing connections. {@code destroy} waits for all outstanding dispatches to complete before resolving the returned promise. This includes "bidirectional dispatches" that execute on outgoing connections.

      Returns Promise<void>

      A promise that is resolved when the communicator has been destroyed.

    • Flushes any pending batch requests for this communicator.

      This operation flushes all batch requests invoked on fixed proxies for all connections associated with the communicator. Any errors that occur while flushing a connection are ignored.

      Returns Promise<void>

      A promise that resolves when the flush operation is complete.

      CommunicatorDestroyedException - Thrown synchronously when the communicator has been destroyed.

    • Retrieves the implicit context associated with this communicator.

      Returns ImplicitContext | null

      The implicit context associated with this communicator, or null if the Ice.ImplicitContext property is not set or is set to None.

    • Retrieves the logger associated with this communicator.

      Returns Logger

      The logger of the communicator.

    • Retrieves the properties associated with this communicator.

      Returns Properties

      The properties of the communicator.

    • Converts an identity into a string.

      Parameters

      • identity: Identity

        The identity to convert into a string.

      Returns string

      The string representation of the identity.

    • Converts a set of proxy properties into a proxy. The "base" name supplied in theproperty argument refers to a property containing a stringified proxy, such as MyProxy=id:tcp -h localhost -p 10000. Additional properties configure local settings for the proxy.

      Parameters

      • property: string

        The base property name.

      Returns ObjectPrx | null

      The proxy, or null if the property is not set.

      ParseException - Thrown when the property value is not a valid proxy string.

      CommunicatorDestroyedException - Thrown when the communicator has been destroyed.

    • Converts a proxy into a set of proxy properties.

      Parameters

      • proxy: ObjectPrx

        The proxy to convert.

      • property: string

        The base property name to associate with the proxy.

      Returns PropertyDict

      A dictionary containing the property set derived from the proxy.

    • Converts a proxy into a string.

      Parameters

      • prx: ObjectPrx | null

        The proxy to convert into a string.

      Returns string

      The string representation of the proxy, or an empty string if prx is null.

    • Sets the communicator's default locator.

      All newly created proxies will use this default locator. To disable the default locator, pass null. Note that this operation has no effect on existing proxies.

      You can also set a locator for an individual proxy by calling ObjectPrx#ice_locator on the proxy.

      Parameters

      • locator: Ice.LocatorPrx | null

        The default locator to use for this communicator, or null to disable the default locator.

      Returns void

      CommunicatorDestroyedException - Thrown when the communicator has been destroyed.

    • Sets the communicator's default router.

      All newly created proxies will use this default router. To disable the default router, pass null. Note that this operation has no effect on existing proxies.

      You can also set a router for an individual proxy by calling ObjectPrx#ice_router on the proxy.

      Parameters

      • router: Ice.RouterPrx | null

        The default router to use for this communicator, or null to disable the default router.

      Returns void

      CommunicatorDestroyedException - Thrown when the communicator has been destroyed.

    • Shuts down this communicator. In JavaScript, shutdown resolves a promise and doesn't do anything else.

      Returns void

    • Converts a proxy string into a proxy.

      Parameters

      • proxyString: string

        The proxy string to convert.

      Returns ObjectPrx | null

      The proxy, or null if proxyString is an empty string.

      ParseException - Thrown when proxyString is not a valid proxy string.

      CommunicatorDestroyedException - Thrown when the communicator has been destroyed.