Class FileLockNodeManager
java.lang.Object
org.apache.activemq.artemis.core.server.NodeManager
org.apache.activemq.artemis.core.server.impl.FileBasedNodeManager
org.apache.activemq.artemis.core.server.impl.FileLockNodeManager
- All Implemented Interfaces:
ActiveMQComponent
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.activemq.artemis.core.server.NodeManager
NodeManager.LockListener, NodeManager.NodeManagerException -
Field Summary
FieldsFields inherited from class org.apache.activemq.artemis.core.server.impl.FileBasedNodeManager
activationSequenceChannel, channel, FIRST_TIME_START, SERVER_ACTIVATION_SEQUENCE_NAME, SERVER_LOCK_NAME, serverLockFileFields inherited from class org.apache.activemq.artemis.core.server.NodeManager
nodeActivationSequence, nodeIDGuard, NULL_NODE_ACTIVATION_SEQUENCE, replicatedBackup -
Constructor Summary
ConstructorsConstructorDescriptionFileLockNodeManager(File directory, boolean replicatedBackup) FileLockNodeManager(File directory, boolean replicatedBackup, long lockAcquisitionTimeout, ScheduledExecutorService scheduledPool) FileLockNodeManager(File directory, boolean replicatedBackup, ScheduledExecutorService scheduledPool) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidbooleanbooleanbooleanprotected FileLocklock(int lockPosition) protected voidvoidfinal SimpleStringfinal voidprotected voidEnsures existence of persistent information about the server's nodeID.voidstart()voidvoidstop()protected FileLocktryLock(int lockPos) Methods inherited from class org.apache.activemq.artemis.core.server.impl.FileBasedNodeManager
createNodeId, newFile, readNodeActivationSequence, stopBackup, writeNodeActivationSequenceMethods inherited from class org.apache.activemq.artemis.core.server.NodeManager
checkStarted, getNodeActivationSequence, getNodeId, getUUID, isStarted, registerLockListener, setNodeActivationSequence, setNodeID, setUUID, unregisterLockListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.core.server.ActiveMQComponent
asyncStop
-
Field Details
-
interrupted
protected boolean interrupted
-
-
Constructor Details
-
FileLockNodeManager
public FileLockNodeManager(File directory, boolean replicatedBackup, ScheduledExecutorService scheduledPool) -
FileLockNodeManager
-
FileLockNodeManager
public FileLockNodeManager(File directory, boolean replicatedBackup, long lockAcquisitionTimeout, ScheduledExecutorService scheduledPool)
-
-
Method Details
-
start
- Specified by:
startin interfaceActiveMQComponent- Overrides:
startin classNodeManager- Throws:
Exception
-
setUpServerLockFile
Description copied from class:FileBasedNodeManagerEnsures existence of persistent information about the server's nodeID.Roughly the different use cases are:
- old server restarts: a server.lock file already exists and contains a nodeID.
- new server starting for the first time: no file exists, and we just *create* a new UUID to use as nodeID
- replicated backup received its nodeID from its live: no file exists, we need to persist the *current* nodeID
- Overrides:
setUpServerLockFilein classFileBasedNodeManager- Throws:
IOException
-
stop
- Specified by:
stopin interfaceActiveMQComponent- Overrides:
stopin classFileBasedNodeManager- Throws:
Exception
-
isAwaitingFailback
- Specified by:
isAwaitingFailbackin classNodeManager- Throws:
NodeManager.NodeManagerException
-
isBackupActive
- Specified by:
isBackupActivein classNodeManager- Throws:
NodeManager.NodeManagerException
-
isPrimaryLocked
public boolean isPrimaryLocked() -
interrupt
public void interrupt()- Specified by:
interruptin classNodeManager
-
releaseBackup
- Specified by:
releaseBackupin classNodeManager- Throws:
NodeManager.NodeManagerException
-
awaitPrimaryNode
- Specified by:
awaitPrimaryNodein classNodeManager- Throws:
NodeManager.NodeManagerExceptionInterruptedException
-
startBackup
- Specified by:
startBackupin classNodeManager- Throws:
NodeManager.NodeManagerException
-
startPrimaryNode
- Specified by:
startPrimaryNodein classNodeManager- Throws:
NodeManager.NodeManagerException
-
pausePrimaryServer
- Specified by:
pausePrimaryServerin classNodeManager- Throws:
NodeManager.NodeManagerException
-
crashPrimaryServer
- Specified by:
crashPrimaryServerin classNodeManager- Throws:
NodeManager.NodeManagerException
-
awaitActiveStatus
- Specified by:
awaitActiveStatusin classNodeManager- Throws:
NodeManager.NodeManagerExceptionInterruptedException
-
readNodeId
- Specified by:
readNodeIdin classNodeManager- Throws:
NodeManager.NodeManagerException
-
tryLock
- Throws:
IOException
-
lock
-
notifyLostLock
protected void notifyLostLock()- Overrides:
notifyLostLockin classNodeManager
-