com.hazelcast.client.spi

## Class ProxyManager

- java.lang.Object
- - com.hazelcast.client.spi.ProxyManager

-     public final class ProxyManager
      extends Object

  The ProxyManager handles client proxy instantiation and retrieval at start and runtime by registering corresponding service manager names and their `ClientProxyFactory`s.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProxyManager(com.hazelcast.client.impl.HazelcastClientInstanceImpl client)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `addDistributedObjectListener(DistributedObjectListener listener)`
    `void` | `createDistributedObjectsOnCluster(Connection ownerConnection)`
    `void` | `destroy()`
    `void` | `destroyProxy(ClientProxy proxy)` Destroys the given proxy in a cluster-wide way.
    `void` | `destroyProxyLocally(String service, String id)` Locally destroys the proxy identified by the given service and object ID.
    `Address` | `findNextAddressToSendCreateRequest()`
    `ClientProxyFactory` | `getClientProxyFactory(String serviceName)`
    `ClientContext` | `getContext()`
    `Collection<? extends DistributedObject>` | `getDistributedObjects()`
    `HazelcastInstance` | `getHazelcastInstance()`
    `ClientProxy` | `getOrCreateProxy(String service, String id)`
    `void` | `init(ClientConfig config, ClientContext clientContext)`
    `void` | `register(String serviceName, Class<? extends ClientProxy> proxyType)`
    `void` | `register(String serviceName, ClientProxyFactory factory)`
    `boolean` | `removeDistributedObjectListener(String id)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ProxyManager

          public ProxyManager(com.hazelcast.client.impl.HazelcastClientInstanceImpl client)

  - ### Method Detail

    - #### init

          public void init(ClientConfig config,
                           ClientContext clientContext)

    - #### getContext

          public ClientContext getContext()

    - #### getHazelcastInstance

          public HazelcastInstance getHazelcastInstance()

    - #### getClientProxyFactory

          public ClientProxyFactory getClientProxyFactory(String serviceName)

    - #### register

          public void register(String serviceName,
                               ClientProxyFactory factory)

    - #### register

          public void register(String serviceName,
                               Class<? extends ClientProxy> proxyType)

    - #### getOrCreateProxy

          public ClientProxy getOrCreateProxy(String service,
                                              String id)

    - #### destroyProxy

          public void destroyProxy(ClientProxy proxy)

      Destroys the given proxy in a cluster-wide way.

      Upon successful completion the proxy is unregistered in this proxy manager, all local resources associated with the proxy are released and a distributed object destruction operation is issued to the cluster.

      If the given proxy instance is not registered in this proxy manager, the proxy instance is considered stale. In this case, this stale instance is a subject to a local-only destruction and its registered counterpart, if there is any, is a subject to a cluster-wide destruction.

      Parameters:
        `proxy` - the proxy to destroy.

    - #### destroyProxyLocally

          public void destroyProxyLocally(String service,
                                          String id)

      Locally destroys the proxy identified by the given service and object ID.

      Upon successful completion the proxy is unregistered in this proxy manager and all local resources associated with the proxy are released.

      Parameters:
        `service` - the service associated with the proxy.
        `id` - the ID of the object to destroy the proxy of.

    - #### findNextAddressToSendCreateRequest

          public Address findNextAddressToSendCreateRequest()

    - #### getDistributedObjects

          public Collection<? extends DistributedObject> getDistributedObjects()

    - #### destroy

          public void destroy()

    - #### addDistributedObjectListener

          public String addDistributedObjectListener(DistributedObjectListener listener)

    - #### createDistributedObjectsOnCluster

          public void createDistributedObjectsOnCluster(Connection ownerConnection)

    - #### removeDistributedObjectListener

          public boolean removeDistributedObjectListener(String id)

Copyright © 2018. All rights reserved.