com.hazelcast.instance

## Interface NodeExtension

- All Known Implementing Classes:
    DefaultNodeExtension

      @PrivateApi
      public interface NodeExtension

  NodeExtension is a `Node` extension mechanism to be able to plug different implementations of some modules, like; `SerializationService`, `ChannelFactory` etc.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterStart()` Called after node is started
    `void` | `beforeJoin()` Called before node attempts to join to the cluster
    `void` | `beforeShutdown()` Called before `Node.shutdown()`
    `void` | `beforeStart()` Called before node is started
    `com.hazelcast.internal.dynamicconfig.DynamicConfigListener` | `createDynamicConfigListener()` Creates a listener for changes in dynamic data structure configurations
    `Map<String,Object>` | `createExtensionServices()` Creates additional extension services, which will be registered by service manager during start-up.
    `com.hazelcast.internal.networking.ChannelInboundHandler` | `createInboundHandler(TcpIpConnection connection, IOService ioService)` Creates a `ChannelInboundHandler` for given `Connection` instance.
    `String` | `createMemberUuid(Address address)` Creates a UUID for local member
    `ByteArrayProcessor` | `createMulticastInputProcessor(IOService ioService)` Returns a byte array processor for incoming data on the Multicast joiner
    `ByteArrayProcessor` | `createMulticastOutputProcessor(IOService ioService)` Returns a byte array processor for outgoing data on the Multicast joiner
    `com.hazelcast.internal.networking.ChannelOutboundHandler` | `createOutboundHandler(TcpIpConnection connection, IOService ioService)` Creates a `ChannelOutboundHandler` for given `Connection` instance.
    `com.hazelcast.internal.serialization.InternalSerializationService` | `createSerializationService()` Creates a `SerializationService` instance to be used by this `Node`.
    `<T> T` | `createService(Class<T> type)` Creates a service which is an implementation of given type parameter.
    `com.hazelcast.internal.management.TimedMemberStateFactory` | `createTimedMemberStateFactory(HazelcastInstanceImpl instance)` Creates a TimedMemberStateFactory for a given Hazelcast instance
    `com.hazelcast.internal.networking.ChannelFactory` | `getChannelFactory()` Returns `ChannelFactory` instance to be used by this `Node`.
    `HotRestartService` | `getHotRestartService()` Returns the public hot restart service
    `InternalHotRestartService` | `getInternalHotRestartService()` Returns the internal hot restart service
    `com.hazelcast.internal.management.ManagementCenterConnectionFactory` | `getManagementCenterConnectionFactory()`
    `MemberSocketInterceptor` | `getMemberSocketInterceptor()` Returns `MemberSocketInterceptor` for this `Node` if available, otherwise returns null.
    `MemoryStats` | `getMemoryStats()` Returns MemoryStats of for the JVM and current HazelcastInstance.
    `SecurityContext` | `getSecurityContext()` Returns `SecurityContext` for this `Node` if available, otherwise returns null.
    `SecurityService` | `getSecurityService()`
    `boolean` | `isNodeVersionCompatibleWith(Version clusterVersion)` Check if this node's codebase version is compatible with given cluster version.
    `boolean` | `isStartCompleted()` Returns true if the instance has started
    `void` | `onClusterStateChange(ClusterState newState, boolean isTransient)` Called when cluster state is changed
    `void` | `onClusterVersionChange(Version newVersion)` Called after cluster version is changed.
    `void` | `onMemberListChange()` Called synchronously when member list changes
    `void` | `onPartitionStateChange()` Called synchronously when partition state (partition assignments, version etc) changes
    `void` | `onThreadStart(Thread thread)` Called on thread start to inject/intercept extension specific logic, like; registering thread in some service, executing a special method before thread starts to do its own task.
    `void` | `onThreadStop(Thread thread)` Called before a thread stops to clean/release injected by `onThreadStart(Thread)`.
    `void` | `printNodeInfo()` Called to print node information during startup
    `boolean` | `registerListener(Object listener)` Registers given listener if it's a known type.
    `void` | `registerPlugins(com.hazelcast.internal.diagnostics.Diagnostics diagnostics)` Register the node extension specific diagnostics plugins on the provided `diagnostics`.
    `void` | `sendPhoneHome()` Send PhoneHome ping from OS or EE instance to PhoneHome application
    `void` | `shutdown()` Shutdowns `NodeExtension`.
    `void` | `validateJoinRequest(com.hazelcast.internal.cluster.impl.JoinMessage joinMessage)` Executed on the master node before allowing a new member to join from `ClusterJoinManager.handleJoinRequest(JoinRequest, Connection)`.

- - ### Method Detail

    - #### beforeStart

          void beforeStart()

      Called before node is started

    - #### printNodeInfo

          void printNodeInfo()

      Called to print node information during startup

    - #### beforeJoin

          void beforeJoin()

      Called before node attempts to join to the cluster

    - #### afterStart

          void afterStart()

      Called after node is started

    - #### isStartCompleted

          boolean isStartCompleted()

      Returns true if the instance has started

    - #### beforeShutdown

          void beforeShutdown()

      Called before `Node.shutdown()`

    - #### shutdown

          void shutdown()

      Shutdowns `NodeExtension`. Called on `Node.shutdown()`

    - #### createSerializationService

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

      Creates a `SerializationService` instance to be used by this `Node`.
      Returns:
        a `SerializationService` instance

    - #### getSecurityService

          SecurityService getSecurityService()

    - #### getSecurityContext

          SecurityContext getSecurityContext()

      Returns `SecurityContext` for this `Node` if available, otherwise returns null.
      Returns:
        security context

    - #### createService

          <T> T createService(Class<T> type)

      Creates a service which is an implementation of given type parameter.
      Parameters:
        `type` - type of service
      Returns:
        service implementation
      Throws:
        `IllegalArgumentException` - if type is not known

    - #### createExtensionServices

          Map<String,Object> createExtensionServices()

      Creates additional extension services, which will be registered by service manager during start-up. By default returned map will be empty.
      Returns:
        extension services

    - #### getMemberSocketInterceptor

          MemberSocketInterceptor getMemberSocketInterceptor()

      Returns `MemberSocketInterceptor` for this `Node` if available, otherwise returns null.
      Returns:
        MemberSocketInterceptor

    - #### getChannelFactory

          com.hazelcast.internal.networking.ChannelFactory getChannelFactory()

      Returns `ChannelFactory` instance to be used by this `Node`.
      Returns:
        ChannelFactory

    - #### createInboundHandler

          com.hazelcast.internal.networking.ChannelInboundHandler createInboundHandler(TcpIpConnection connection,
                                                                                       IOService ioService)

      Creates a `ChannelInboundHandler` for given `Connection` instance.
      Parameters:
        `connection` - tcp-ip connection
        `ioService` - IOService
      Returns:
        the created ChannelInboundHandler.

    - #### createOutboundHandler

          com.hazelcast.internal.networking.ChannelOutboundHandler createOutboundHandler(TcpIpConnection connection,
                                                                                         IOService ioService)

      Creates a `ChannelOutboundHandler` for given `Connection` instance.
      Parameters:
        `connection` - tcp-ip connection
        `ioService` - IOService
      Returns:
        the created ChannelOutboundHandler

    - #### onThreadStart

          void onThreadStart(Thread thread)

      Called on thread start to inject/intercept extension specific logic, like; registering thread in some service, executing a special method before thread starts to do its own task.
      Parameters:
        `thread` - thread starting

    - #### onThreadStop

          void onThreadStop(Thread thread)

      Called before a thread stops to clean/release injected by `onThreadStart(Thread)`.
      Parameters:
        `thread` - thread stopping

    - #### getMemoryStats

          MemoryStats getMemoryStats()

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

    - #### validateJoinRequest

          void validateJoinRequest(com.hazelcast.internal.cluster.impl.JoinMessage joinMessage)

      Executed on the master node before allowing a new member to join from `ClusterJoinManager.handleJoinRequest(JoinRequest, Connection)`. Implementation should check if the `JoinMessage` should be allowed to proceed, otherwise throw an exception with a message explaining rejection reason.

    - #### onClusterStateChange

          void onClusterStateChange(ClusterState newState,
                                    boolean isTransient)

      Called when cluster state is changed
      Parameters:
        `newState` - new state
        `isTransient` - status of the change. A cluster state change may be transient if it has been done temporarily during system operations such cluster start etc.

    - #### onPartitionStateChange

          void onPartitionStateChange()

      Called synchronously when partition state (partition assignments, version etc) changes

    - #### onMemberListChange

          void onMemberListChange()

      Called synchronously when member list changes

    - #### onClusterVersionChange

          void onClusterVersionChange(Version newVersion)

      Called after cluster version is changed.
      Parameters:
        `newVersion` - the new version at which the cluster operates.

    - #### isNodeVersionCompatibleWith

          boolean isNodeVersionCompatibleWith(Version clusterVersion)

      Check if this node's codebase version is compatible with given cluster version.
      Parameters:
        `clusterVersion` - the cluster version to check against
      Returns:
        `true` if compatible, otherwise false.

    - #### registerListener

          boolean registerListener(Object listener)

      Registers given listener if it's a known type.
      Parameters:
        `listener` - listener instance
      Returns:
        true if listener is registered, false otherwise

    - #### getHotRestartService

          HotRestartService getHotRestartService()

      Returns the public hot restart service

    - #### getInternalHotRestartService

          InternalHotRestartService getInternalHotRestartService()

      Returns the internal hot restart service

    - #### createMemberUuid

          String createMemberUuid(Address address)

      Creates a UUID for local member
      Parameters:
        `address` - address of local member
      Returns:
        new UUID

    - #### createTimedMemberStateFactory

          com.hazelcast.internal.management.TimedMemberStateFactory createTimedMemberStateFactory(HazelcastInstanceImpl instance)

      Creates a TimedMemberStateFactory for a given Hazelcast instance
      Parameters:
        `instance` - The instance to associate with the timed member state factory
      Returns:
        `TimedMemberStateFactory`

    - #### getManagementCenterConnectionFactory

          com.hazelcast.internal.management.ManagementCenterConnectionFactory getManagementCenterConnectionFactory()

    - #### createMulticastInputProcessor

          ByteArrayProcessor createMulticastInputProcessor(IOService ioService)

      Returns a byte array processor for incoming data on the Multicast joiner

    - #### createMulticastOutputProcessor

          ByteArrayProcessor createMulticastOutputProcessor(IOService ioService)

      Returns a byte array processor for outgoing data on the Multicast joiner

    - #### createDynamicConfigListener

          com.hazelcast.internal.dynamicconfig.DynamicConfigListener createDynamicConfigListener()

      Creates a listener for changes in dynamic data structure configurations
      Returns:
        Listener to be notfied about changes in data structure configurations

    - #### registerPlugins

          void registerPlugins(com.hazelcast.internal.diagnostics.Diagnostics diagnostics)

      Register the node extension specific diagnostics plugins on the provided `diagnostics`.
      Parameters:
        `diagnostics` - the diagnostics on which plugins should be registered

    - #### sendPhoneHome

          void sendPhoneHome()

      Send PhoneHome ping from OS or EE instance to PhoneHome application

Copyright © 2018. All rights reserved.