Class FileBasedNodeManager
java.lang.Object
org.apache.activemq.artemis.core.server.NodeManager
org.apache.activemq.artemis.core.server.impl.FileBasedNodeManager
- All Implemented Interfaces:
ActiveMQComponent
- Direct Known Subclasses:
FileLockNodeManager,InVMNodeManager
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.activemq.artemis.core.server.NodeManager
NodeManager.LockListener, NodeManager.NodeManagerException -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FileChannelprotected FileChannelprotected static final bytestatic final Stringstatic final Stringprotected FileFields inherited from class org.apache.activemq.artemis.core.server.NodeManager
nodeActivationSequence, nodeIDGuard, NULL_NODE_ACTIVATION_SEQUENCE, replicatedBackup -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidprotected final Filelongprotected voidEnsures existence of persistent information about the server's nodeID.voidstop()voidvoidwriteNodeActivationSequence(long sequence) Methods inherited from class org.apache.activemq.artemis.core.server.NodeManager
awaitActiveStatus, awaitPrimaryNode, checkStarted, crashPrimaryServer, getNodeActivationSequence, getNodeId, getUUID, interrupt, isAwaitingFailback, isBackupActive, isStarted, notifyLostLock, pausePrimaryServer, readNodeId, registerLockListener, releaseBackup, setNodeActivationSequence, setNodeID, setUUID, start, startBackup, startPrimaryNode, 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
-
FIRST_TIME_START
protected static final byte FIRST_TIME_START- See Also:
-
SERVER_LOCK_NAME
- See Also:
-
SERVER_ACTIVATION_SEQUENCE_NAME
- See Also:
-
serverLockFile
-
channel
-
activationSequenceChannel
-
-
Constructor Details
-
FileBasedNodeManager
-
-
Method Details
-
readNodeActivationSequence
- Overrides:
readNodeActivationSequencein classNodeManager- Throws:
NodeManager.NodeManagerException
-
writeNodeActivationSequence
- Overrides:
writeNodeActivationSequencein classNodeManager- Throws:
NodeManager.NodeManagerException
-
setUpServerLockFile
Ensures 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
- Throws:
IOException
-
newFile
-
createNodeId
- Throws:
IOException
-
stop
- Specified by:
stopin interfaceActiveMQComponent- Overrides:
stopin classNodeManager- Throws:
Exception
-
stopBackup
- Overrides:
stopBackupin classNodeManager- Throws:
NodeManager.NodeManagerException
-