com.hazelcast.client

## Interface ClientExtension

-     public interface ClientExtension

  ClientExtension is a client extension mechanism to be able to plug different implementations of some modules, like; `InternalSerializationService` etc.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterStart(com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl client)` Called after node is started
    `void` | `beforeStart(com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl client)` Called before client is started
    `com.hazelcast.internal.networking.ChannelInitializer` | `createChannelInitializer()`
    `com.hazelcast.internal.networking.ChannelInitializer` | `createChannelInitializer(SSLConfig sslConfig, SocketOptions socketOptions)`
    `com.hazelcast.internal.nearcache.NearCacheManager` | `createNearCacheManager()` Creates a `NearCacheManager` instance to be used by this client.
    `com.hazelcast.internal.serialization.InternalSerializationService` | `createSerializationService(byte version)` Creates a `InternalSerializationService` instance to be used by this client.
    `<T> ClientProxyFactory` | `createServiceProxyFactory(Class<T> service)` Creates a `ClientProxyFactory` for the supplied service class.
    `SocketInterceptor` | `createSocketInterceptor()` Creates a `SocketInterceptor` to be used by this client if available, otherwise returns `null`
    `SocketInterceptor` | `createSocketInterceptor(SocketInterceptorConfig socketInterceptorConfig)` Create socket interceptor according to given config
    `MemoryStats` | `getMemoryStats()` Returns MemoryStats of for the JVM and current HazelcastInstance.

- - ### Method Detail

    - #### beforeStart

          void beforeStart(com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl client)

      Called before client is started

    - #### afterStart

          void afterStart(com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl client)

      Called after node is started

    - #### createSerializationService

          com.hazelcast.internal.serialization.InternalSerializationService createSerializationService(byte version)

      Creates a `InternalSerializationService` instance to be used by this client.
      Parameters:
        `version` - serialization version to be created. Values less than 1 will be ignored and max supported version will be used
      Returns:
        the created `InternalSerializationService` instance

    - #### createSocketInterceptor

          SocketInterceptor createSocketInterceptor()

      Creates a `SocketInterceptor` to be used by this client if available, otherwise returns `null`
      Returns:
        the created `SocketInterceptor` instance if available, + otherwise `null`

    - #### createSocketInterceptor

          SocketInterceptor createSocketInterceptor(SocketInterceptorConfig socketInterceptorConfig)

      Create socket interceptor according to given config
      Parameters:
        `socketInterceptorConfig` - config for socket interceptor
      Returns:
        socket interceptor if it is able to created, null otherwise

    - #### createChannelInitializer

          com.hazelcast.internal.networking.ChannelInitializer createChannelInitializer()

    - #### createChannelInitializer

          com.hazelcast.internal.networking.ChannelInitializer createChannelInitializer(SSLConfig sslConfig,
                                                                                        SocketOptions socketOptions)

      Parameters:
        `sslConfig` - ssl config for channel initializer
        `socketOptions` - socket options for channel initializer
      Returns:
        @return ChannelInitializer created from given configs

    - #### createNearCacheManager

          com.hazelcast.internal.nearcache.NearCacheManager createNearCacheManager()

      Creates a `NearCacheManager` instance to be used by this client.
      Returns:
        the created `NearCacheManager` instance

    - #### createServiceProxyFactory

          <T> ClientProxyFactory createServiceProxyFactory(Class<T> service)

      Creates a `ClientProxyFactory` for the supplied service class. Currently only the `MapService` is supported.
      Parameters:
        `service` - service for the proxy to create.
      Returns:
        `ClientProxyFactory` for the service.
      Throws:
        `IllegalArgumentException` - if service is not known

    - #### getMemoryStats

          MemoryStats getMemoryStats()

      Returns MemoryStats of for the JVM and current HazelcastInstance.
      Returns:
        memory statistics

Copyright © 2019. All rights reserved.