Class SharedNothingBackupActivation
java.lang.Object
org.apache.activemq.artemis.core.server.impl.Activation
org.apache.activemq.artemis.core.server.impl.SharedNothingBackupActivation
- All Implemented Interfaces:
Runnable,ReplicationEndpoint.ReplicationEndpointEventListener
public final class SharedNothingBackupActivation
extends Activation
implements ReplicationEndpoint.ReplicationEndpointEventListener
-
Constructor Summary
ConstructorsConstructorDescriptionSharedNothingBackupActivation(ActiveMQServerImpl activeMQServer, boolean attemptFailBack, Map<String, Object> activationParams, IOCriticalErrorListener ioCriticalErrorListener, ReplicaPolicy replicaPolicy, NetworkHealthCheck networkHealthCheck) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose(boolean permanently, boolean restarting) createJournalLoader(PostOffice postOffice, PagingManager pagingManager, StorageManager storageManager, QueueFactory queueFactory, NodeManager nodeManager, ManagementService managementService, GroupingHandler groupingHandler, Configuration configuration, ActiveMQServer parentServer) create the Journal loader needed for this Activation.voidfailOver(ReplicationPrimaryIsStoppingMessage.PrimaryStopping finalMessage) Primary has notified this server that it is going to stop.voidcalled by the ha manager to notify the Activation that HA is now activevoidinit()booleanWhether a remote backup server was in sync with its primary server.booleanvoidonPrimaryNodeId(String nodeId) voidvoidonRemoteBackupUpToDate(String nodeId, long ignoredActivationSequence) voidcalled before the server is closing the journals so the activation can tidy up stuffvoidrun()booleanwaitForBackupSync(long timeout, TimeUnit unit) Wait for backup synchronization when using synchronizationMethods inherited from class org.apache.activemq.artemis.core.server.impl.Activation
freezeConnections, getActivationChannelHandler, getHAManager, getReplicationManager, postConnectionFreeze, sendPrimaryIsStopping
-
Constructor Details
-
SharedNothingBackupActivation
public SharedNothingBackupActivation(ActiveMQServerImpl activeMQServer, boolean attemptFailBack, Map<String, Object> activationParams, IOCriticalErrorListener ioCriticalErrorListener, ReplicaPolicy replicaPolicy, NetworkHealthCheck networkHealthCheck)
-
-
Method Details
-
init
- Throws:
Exception
-
run
public void run() -
close
- Specified by:
closein classActivation- Throws:
Exception
-
preStorageClose
Description copied from class:Activationcalled before the server is closing the journals so the activation can tidy up stuff- Overrides:
preStorageClosein classActivation- Throws:
Exception
-
createJournalLoader
public JournalLoader createJournalLoader(PostOffice postOffice, PagingManager pagingManager, StorageManager storageManager, QueueFactory queueFactory, NodeManager nodeManager, ManagementService managementService, GroupingHandler groupingHandler, Configuration configuration, ActiveMQServer parentServer) throws ActiveMQException Description copied from class:Activationcreate the Journal loader needed for this Activation.- Overrides:
createJournalLoaderin classActivation- Throws:
ActiveMQException
-
haStarted
public void haStarted()Description copied from class:Activationcalled by the ha manager to notify the Activation that HA is now active- Overrides:
haStartedin classActivation
-
waitForBackupSync
Wait for backup synchronization when using synchronization- Returns:
trueif the server was already initialized or if it was initialized within the timeout period,falseotherwise.- Throws:
InterruptedException- See Also:
-
failOver
Primary has notified this server that it is going to stop. -
getReplicationEndpoint
-
isRemoteBackupUpToDate
public boolean isRemoteBackupUpToDate()Whether a remote backup server was in sync with its primary server. If it was not in sync, it may not take over the primary's functions.A local backup server or a primary server should always return
true- Returns:
- whether the backup is up-to-date, if the server is not a backup it always returns
true.
-
onPrimaryNodeId
- Specified by:
onPrimaryNodeIdin interfaceReplicationEndpoint.ReplicationEndpointEventListener
-
onRemoteBackupUpToDate
- Specified by:
onRemoteBackupUpToDatein interfaceReplicationEndpoint.ReplicationEndpointEventListener
-
onPrimaryStopping
public void onPrimaryStopping(ReplicationPrimaryIsStoppingMessage.PrimaryStopping finalMessage) throws ActiveMQException - Specified by:
onPrimaryStoppingin interfaceReplicationEndpoint.ReplicationEndpointEventListener- Throws:
ActiveMQException
-
isReplicaSync
public boolean isReplicaSync()- Overrides:
isReplicaSyncin classActivation
-