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` | `afterClusterStateChange(ClusterState oldState, ClusterState newState, boolean isTransient)` Called after the cluster state change transaction has completed (successfully or otherwise).
    `void` | `afterStart()` Called after node is started
    `void` | `beforeClusterStateChange(ClusterState currState, ClusterState requestedState, boolean isTransient)` Called before starting a cluster state change transaction.
    `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.networking.ChannelInitializerProvider` | `createChannelInitializerProvider(IOService ioService)` Creates the ChannelInitializerProvider.
    `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.InboundHandler[]` | `createInboundHandlers(EndpointQualifier qualifier, TcpIpConnection connection, IOService ioService)` Creates a `InboundHandler` for given `Connection` instance.
    `com.hazelcast.internal.jmx.ManagementService` | `createJMXManagementService(HazelcastInstanceImpl 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.OutboundHandler[]` | `createOutboundHandlers(EndpointQualifier qualifier, TcpIpConnection connection, IOService ioService)` Creates a `OutboundHandler` 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.ascii.TextCommandService` | `createTextCommandService()`
    `com.hazelcast.internal.management.TimedMemberStateFactory` | `createTimedMemberStateFactory(HazelcastInstanceImpl instance)` Creates a TimedMemberStateFactory for a given Hazelcast instance
    `HotRestartService` | `getHotRestartService()` Returns the public hot restart service
    `InternalHotRestartService` | `getInternalHotRestartService()` Returns the internal hot restart service
    `com.hazelcast.internal.management.ManagementCenterConnectionFactory` | `getManagementCenterConnectionFactory()`
    `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()`
    `MemberSocketInterceptor` | `getSocketInterceptor(EndpointQualifier endpointQualifier)` Returns `MemberSocketInterceptor` for this `Node` if available, otherwise returns null.
    `boolean` | `isClientFailoverSupported()`
    `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 during the commit phase of the cluster state change transaction, just after updating the value of the cluster state on the local member, while still holding the cluster lock.
    `void` | `onClusterVersionChange(Version newVersion)` Called after cluster version is changed.
    `void` | `onInitialClusterState(ClusterState initialState)` Called when initial cluster state is received while joining the cluster.
    `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` | `scheduleClusterVersionAutoUpgrade()` Cluster version auto upgrade is done asynchronously.
    `void` | `sendPhoneHome()` Send PhoneHome ping from OS or EE instance to PhoneHome application
    `void` | `setLicenseKey(String licenseKey)`
    `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

    - #### getSocketInterceptor

          public MemberSocketInterceptor getSocketInterceptor(EndpointQualifier endpointQualifier)

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

    - #### createInboundHandlers

          public com.hazelcast.internal.networking.InboundHandler[] createInboundHandlers(EndpointQualifier qualifier,
                                                                                          TcpIpConnection connection,
                                                                                          IOService ioService)

      Description copied from interface: `NodeExtension`
      Creates a `InboundHandler` for given `Connection` instance. For TLS and other enterprise features, instead of returning the regular protocol decoder, a TLS decoder can be returned. This is the first item in the chain.
      Specified by:
        `createInboundHandlers` in interface `NodeExtension`
        `connection` - tcp-ip connection
        `ioService` - IOService
      Returns:
        the created InboundHandler.

    - #### createOutboundHandlers

          public com.hazelcast.internal.networking.OutboundHandler[] createOutboundHandlers(EndpointQualifier qualifier,
                                                                                            TcpIpConnection connection,
                                                                                            IOService ioService)

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

    - #### createChannelInitializerProvider

          public com.hazelcast.internal.networking.ChannelInitializerProvider createChannelInitializerProvider(IOService ioService)

      Description copied from interface: `NodeExtension`
      Creates the ChannelInitializerProvider.
      Specified by:
        `createChannelInitializerProvider` in interface `NodeExtension`
      Returns:

    - #### 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`

    - #### beforeClusterStateChange

          public void beforeClusterStateChange(ClusterState currState,
                                               ClusterState requestedState,
                                               boolean isTransient)

      Description copied from interface: `NodeExtension`
      Called before starting a cluster state change transaction. Called only on the member that initiated the state change.
      Specified by:
        `beforeClusterStateChange` in interface `NodeExtension`
      Parameters:
        `currState` - the state before the change
        `requestedState` - the requested cluster state
        `isTransient` - whether the change will be recorded in persistent storage, affecting the initial state after cluster restart. Transient changes happen during system operations such as an orderly all-cluster shutdown.

    - #### onClusterStateChange

          public void onClusterStateChange(ClusterState newState,
                                           boolean isTransient)

      Description copied from interface: `NodeExtension`
      Called during the commit phase of the cluster state change transaction, just after updating the value of the cluster state on the local member, while still holding the cluster lock. Called on all cluster members.
      Specified by:
        `onClusterStateChange` in interface `NodeExtension`
      Parameters:
        `newState` - the new cluster state
        `isTransient` - whether the change will be recorded in persistent storage, affecting the initial state after cluster restart. Transient changes happen during system operations such as an orderly all-cluster shutdown.

    - #### afterClusterStateChange

          public void afterClusterStateChange(ClusterState oldState,
                                              ClusterState newState,
                                              boolean isTransient)

      Description copied from interface: `NodeExtension`
      Called after the cluster state change transaction has completed (successfully or otherwise). Called only on the member that initiated the state change.
      Specified by:
        `afterClusterStateChange` in interface `NodeExtension`
      Parameters:
        `oldState` - the state before the change
        `newState` - the new cluster state, can be equal to `oldState` if the state change transaction failed
        `isTransient` - whether the change will be recorded in persistent storage, affecting the initial state after cluster restart. Transient changes happen during system operations such as an orderly all-cluster shutdown.

    - #### 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`

    - #### onInitialClusterState

          public void onInitialClusterState(ClusterState initialState)

      Description copied from interface: `NodeExtension`
      Called when initial cluster state is received while joining the cluster.
      Specified by:
        `onInitialClusterState` in interface `NodeExtension`
      Parameters:
        `initialState` - initial cluster state

    - #### 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`

    - #### createJMXManagementService

          public com.hazelcast.internal.jmx.ManagementService createJMXManagementService(HazelcastInstanceImpl instance)

      Specified by:
        `createJMXManagementService` in interface `NodeExtension`

    - #### createTextCommandService

          public com.hazelcast.internal.ascii.TextCommandService createTextCommandService()

      Specified by:
        `createTextCommandService` 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`

    - #### scheduleClusterVersionAutoUpgrade

          public void scheduleClusterVersionAutoUpgrade()

      Description copied from interface: `NodeExtension`
      Cluster version auto upgrade is done asynchronously. Every call of this method creates and schedules a new auto upgrade task.
      Specified by:
        `scheduleClusterVersionAutoUpgrade` in interface `NodeExtension`

    - #### isClientFailoverSupported

          public boolean isClientFailoverSupported()

      Specified by:
        `isClientFailoverSupported` in interface `NodeExtension`
      Returns:
        true if client failover feature is supported

    - #### createAndSetPhoneHome

          protected void createAndSetPhoneHome()

    - #### setLicenseKey

          public void setLicenseKey(String licenseKey)

Copyright © 2020. All rights reserved.