Class ReplicationPrimaryActivation

All Implemented Interfaces:
Runnable, org.apache.activemq.artemis.lockmanager.DistributedLock.UnavailableLockListener

public class ReplicationPrimaryActivation extends PrimaryActivation implements org.apache.activemq.artemis.lockmanager.DistributedLock.UnavailableLockListener
This is going to be run() just by natural born primary, at the first start. Both during a failover or a failback, run() isn't going to be used, but only getActivationChannelHandler(Channel, Acceptor).
  • Constructor Details

    • ReplicationPrimaryActivation

      public ReplicationPrimaryActivation(ActiveMQServerImpl activeMQServer, org.apache.activemq.artemis.lockmanager.DistributedLockManager distributedManager, ReplicationPrimaryPolicy policy)
  • Method Details

    • getDistributedManager

      public org.apache.activemq.artemis.lockmanager.DistributedLockManager getDistributedManager()
      used for testing purposes.
    • freezeConnections

      public void freezeConnections(RemotingService remotingService)
      Description copied from class: Activation
      freeze the connection but allow the Activation to over ride this and decide if any connections should be left open.
      Overrides:
      freezeConnections in class Activation
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • applyCoordinationId

      public static void applyCoordinationId(String coordinationId, ActiveMQServerImpl activeMQServer) throws Exception
      Throws:
      Exception
    • getActivationChannelHandler

      public ChannelHandler getActivationChannelHandler(Channel channel, Acceptor acceptorUsed)
      Description copied from class: Activation
      allows the Activation to register a channel handler so it can handle any packets that are unique to the Activation
      Overrides:
      getActivationChannelHandler in class Activation
    • onUnavailableLockEvent

      public void onUnavailableLockEvent()
      Specified by:
      onUnavailableLockEvent in interface org.apache.activemq.artemis.lockmanager.DistributedLock.UnavailableLockListener
    • close

      public void close(boolean permanently, boolean restarting) throws Exception
      Specified by:
      close in class Activation
      Throws:
      Exception
    • sendPrimaryIsStopping

      public void sendPrimaryIsStopping()
      Description copied from class: Activation
      called by the server to notify the Activation that the server is stopping
      Overrides:
      sendPrimaryIsStopping in class Activation
    • getReplicationManager

      public ReplicationManager getReplicationManager()
      Overrides:
      getReplicationManager in class Activation
    • isReplicaSync

      public boolean isReplicaSync()
      Overrides:
      isReplicaSync in class Activation