com.hazelcast.instance

## Class DefaultNodeExtension

- java.lang.Object
- - com.hazelcast.instance.DefaultNodeExtension

- All Implemented Interfaces:
    NodeExtension

      @PrivateApi
      public class DefaultNodeExtension
      extends Object
      implements NodeExtension

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected List<com.hazelcast.internal.cluster.ClusterVersionListener>` | `clusterVersionListeners`
    `protected ILogger` | `logger`
    `protected Node` | `node`
    `protected PhoneHome` | `phoneHome`
    `protected ILogger` | `systemLogger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultNodeExtension(Node node)`

  - ### Method Summary

    All Methods Instance Methods Concrete 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
    `protected void` | `createAndSetPhoneHome()`
    `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> clazz)` 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.
    `protected PartitioningStrategy` | `getPartitioningStrategy(ClassLoader configClassLoader)`
    `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 `NodeExtension.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)`.

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

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

- - ### Field Detail

    - #### node

          protected final Node node

    - #### logger

          protected final ILogger logger

    - #### systemLogger

          protected final ILogger systemLogger

    - #### clusterVersionListeners

          protected final List<com.hazelcast.internal.cluster.ClusterVersionListener> clusterVersionListeners

    - #### phoneHome

          protected PhoneHome phoneHome

  - ### Constructor Detail

    - #### DefaultNodeExtension

          public DefaultNodeExtension(Node node)

  - ### Method Detail

    - #### beforeStart

          public void beforeStart()

      Description copied from interface: `NodeExtension`
      Called before node is started
      Specified by:
        `beforeStart` in interface `NodeExtension`

    - #### printNodeInfo

          public void printNodeInfo()

      Description copied from interface: `NodeExtension`
      Called to print node information during startup
      Specified by:
        `printNodeInfo` in interface `NodeExtension`

    - #### beforeJoin

          public void beforeJoin()

      Description copied from interface: `NodeExtension`
      Called before node attempts to join to the cluster
      Specified by:
        `beforeJoin` in interface `NodeExtension`

    - #### afterStart

          public void afterStart()

      Description copied from interface: `NodeExtension`
      Called after node is started
      Specified by:
        `afterStart` in interface `NodeExtension`

    - #### isStartCompleted

          public boolean isStartCompleted()

      Description copied from interface: `NodeExtension`
      Returns true if the instance has started
      Specified by:
        `isStartCompleted` in interface `NodeExtension`

    - #### getSecurityContext

          public SecurityContext getSecurityContext()

      Description copied from interface: `NodeExtension`
      Returns `SecurityContext` for this `Node` if available, otherwise returns null.
      Specified by:
        `getSecurityContext` in interface `NodeExtension`
      Returns:
        security context

    - #### createSerializationService

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

      Description copied from interface: `NodeExtension`
      Creates a `SerializationService` instance to be used by this `Node`.
      Specified by:
        `createSerializationService` in interface `NodeExtension`
      Returns:
        a `SerializationService` instance

    - #### getSecurityService

          public SecurityService getSecurityService()

      Specified by:
        `getSecurityService` in interface `NodeExtension`

    - #### getPartitioningStrategy

          protected PartitioningStrategy getPartitioningStrategy(ClassLoader configClassLoader)
                                                          throws Exception

      Throws:
        `Exception`

    - #### createService

          public <T> T createService(Class<T> clazz)

      Description copied from interface: `NodeExtension`
      Creates a service which is an implementation of given type parameter.
      Specified by:
        `createService` in interface `NodeExtension`
      Parameters:
        `clazz` - type of service
      Returns:
        service implementation

    - #### createExtensionServices

          public Map<String,Object> createExtensionServices()

      Description copied from interface: `NodeExtension`
      Creates additional extension services, which will be registered by service manager during start-up. By default returned map will be empty.
      Specified by:
        `createExtensionServices` in interface `NodeExtension`
      Returns:
        extension services

    - #### getMemberSocketInterceptor

          public MemberSocketInterceptor getMemberSocketInterceptor()

      Description copied from interface: `NodeExtension`
      Returns `MemberSocketInterceptor` for this `Node` if available, otherwise returns null.
      Specified by:
        `getMemberSocketInterceptor` in interface `NodeExtension`
      Returns:
        MemberSocketInterceptor

    - #### getChannelFactory

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

      Description copied from interface: `NodeExtension`
      Returns `ChannelFactory` instance to be used by this `Node`.
      Specified by:
        `getChannelFactory` in interface `NodeExtension`
      Returns:
        ChannelFactory

    - #### createInboundHandler

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

      Description copied from interface: `NodeExtension`
      Creates a `ChannelInboundHandler` for given `Connection` instance.
      Specified by:
        `createInboundHandler` in interface `NodeExtension`
      Parameters:
        `connection` - tcp-ip connection
        `ioService` - IOService
      Returns:
        the created ChannelInboundHandler.

    - #### createOutboundHandler

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

      Description copied from interface: `NodeExtension`
      Creates a `ChannelOutboundHandler` for given `Connection` instance.
      Specified by:
        `createOutboundHandler` in interface `NodeExtension`
      Parameters:
        `connection` - tcp-ip connection
        `ioService` - IOService
      Returns:
        the created ChannelOutboundHandler

    - #### onThreadStart

          public void onThreadStart(Thread thread)

      Description copied from interface: `NodeExtension`
      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.
      Specified by:
        `onThreadStart` in interface `NodeExtension`
      Parameters:
        `thread` - thread starting

    - #### onThreadStop

          public void onThreadStop(Thread thread)

      Description copied from interface: `NodeExtension`
      Called before a thread stops to clean/release injected by `NodeExtension.onThreadStart(Thread)`.
      Specified by:
        `onThreadStop` in interface `NodeExtension`
      Parameters:
        `thread` - thread stopping

    - #### getMemoryStats

          public MemoryStats getMemoryStats()

      Description copied from interface: `NodeExtension`
      Returns MemoryStats of for the JVM and current HazelcastInstance.
      Specified by:
        `getMemoryStats` in interface `NodeExtension`
      Returns:
        memory statistics

    - #### beforeShutdown

          public void beforeShutdown()

      Description copied from interface: `NodeExtension`
      Called before `Node.shutdown()`
      Specified by:
        `beforeShutdown` in interface `NodeExtension`

    - #### shutdown

          public void shutdown()

      Description copied from interface: `NodeExtension`
      Shutdowns `NodeExtension`. Called on `Node.shutdown()`
      Specified by:
        `shutdown` in interface `NodeExtension`

    - #### validateJoinRequest

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

      Description copied from interface: `NodeExtension`
      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.
      Specified by:
        `validateJoinRequest` in interface `NodeExtension`

    - #### onClusterStateChange

          public void onClusterStateChange(ClusterState newState,
                                           boolean isTransient)

      Description copied from interface: `NodeExtension`
      Called when cluster state is changed
      Specified by:
        `onClusterStateChange` in interface `NodeExtension`
      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

          public void onPartitionStateChange()

      Description copied from interface: `NodeExtension`
      Called synchronously when partition state (partition assignments, version etc) changes
      Specified by:
        `onPartitionStateChange` in interface `NodeExtension`

    - #### onMemberListChange

          public void onMemberListChange()

      Description copied from interface: `NodeExtension`
      Called synchronously when member list changes
      Specified by:
        `onMemberListChange` in interface `NodeExtension`

    - #### onClusterVersionChange

          public void onClusterVersionChange(Version newVersion)

      Description copied from interface: `NodeExtension`
      Called after cluster version is changed.
      Specified by:
        `onClusterVersionChange` in interface `NodeExtension`
      Parameters:
        `newVersion` - the new version at which the cluster operates.

    - #### isNodeVersionCompatibleWith

          public boolean isNodeVersionCompatibleWith(Version clusterVersion)

      Description copied from interface: `NodeExtension`
      Check if this node's codebase version is compatible with given cluster version.
      Specified by:
        `isNodeVersionCompatibleWith` in interface `NodeExtension`
      Parameters:
        `clusterVersion` - the cluster version to check against
      Returns:
        `true` if compatible, otherwise false.

    - #### registerListener

          public boolean registerListener(Object listener)

      Description copied from interface: `NodeExtension`
      Registers given listener if it's a known type.
      Specified by:
        `registerListener` in interface `NodeExtension`
      Parameters:
        `listener` - listener instance
      Returns:
        true if listener is registered, false otherwise

    - #### getHotRestartService

          public HotRestartService getHotRestartService()

      Description copied from interface: `NodeExtension`
      Returns the public hot restart service
      Specified by:
        `getHotRestartService` in interface `NodeExtension`

    - #### getInternalHotRestartService

          public InternalHotRestartService getInternalHotRestartService()

      Description copied from interface: `NodeExtension`
      Returns the internal hot restart service
      Specified by:
        `getInternalHotRestartService` in interface `NodeExtension`

    - #### createMemberUuid

          public String createMemberUuid(Address address)

      Description copied from interface: `NodeExtension`
      Creates a UUID for local member
      Specified by:
        `createMemberUuid` in interface `NodeExtension`
      Parameters:
        `address` - address of local member
      Returns:
        new UUID

    - #### createMulticastInputProcessor

          public ByteArrayProcessor createMulticastInputProcessor(IOService ioService)

      Description copied from interface: `NodeExtension`
      Returns a byte array processor for incoming data on the Multicast joiner
      Specified by:
        `createMulticastInputProcessor` in interface `NodeExtension`

    - #### createMulticastOutputProcessor

          public ByteArrayProcessor createMulticastOutputProcessor(IOService ioService)

      Description copied from interface: `NodeExtension`
      Returns a byte array processor for outgoing data on the Multicast joiner
      Specified by:
        `createMulticastOutputProcessor` in interface `NodeExtension`

    - #### createTimedMemberStateFactory

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

      Description copied from interface: `NodeExtension`
      Creates a TimedMemberStateFactory for a given Hazelcast instance
      Specified by:
        `createTimedMemberStateFactory` in interface `NodeExtension`
      Parameters:
        `instance` - The instance to associate with the timed member state factory
      Returns:
        `TimedMemberStateFactory`

    - #### createDynamicConfigListener

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

      Description copied from interface: `NodeExtension`
      Creates a listener for changes in dynamic data structure configurations
      Specified by:
        `createDynamicConfigListener` in interface `NodeExtension`
      Returns:
        Listener to be notfied about changes in data structure configurations

    - #### registerPlugins

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

      Description copied from interface: `NodeExtension`
      Register the node extension specific diagnostics plugins on the provided `diagnostics`.
      Specified by:
        `registerPlugins` in interface `NodeExtension`
      Parameters:
        `diagnostics` - the diagnostics on which plugins should be registered

    - #### getManagementCenterConnectionFactory

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

      Specified by:
        `getManagementCenterConnectionFactory` in interface `NodeExtension`

    - #### sendPhoneHome

          public void sendPhoneHome()

      Description copied from interface: `NodeExtension`
      Send PhoneHome ping from OS or EE instance to PhoneHome application
      Specified by:
        `sendPhoneHome` in interface `NodeExtension`

    - #### createAndSetPhoneHome

          protected void createAndSetPhoneHome()

Copyright © 2018. All rights reserved.