use of org.apache.activemq.artemis.core.server.impl.FileLockNodeManager in project activemq-artemis by apache.
the class PrintData method printData.
public static void printData(File bindingsDirectory, File messagesDirectory, File pagingDirectory, PrintStream out, boolean safe) throws Exception {
// Having the version on the data report is an information very useful to understand what happened
// When debugging stuff
Artemis.printBanner(out);
File serverLockFile = new File(messagesDirectory, "server.lock");
if (serverLockFile.isFile()) {
try {
FileLockNodeManager fileLock = new FileLockNodeManager(messagesDirectory, false);
fileLock.start();
printBanner(out, "Server's ID=" + fileLock.getNodeId().toString());
fileLock.stop();
} catch (Exception e) {
e.printStackTrace();
}
}
printBanner(out, BINDINGS_BANNER);
try {
DescribeJournal.describeBindingsJournal(bindingsDirectory, out, safe);
} catch (Exception e) {
e.printStackTrace();
}
printBanner(out, MESSAGES_BANNER);
DescribeJournal describeJournal = null;
try {
describeJournal = DescribeJournal.describeMessagesJournal(messagesDirectory, out, safe);
} catch (Exception e) {
e.printStackTrace();
return;
}
try {
printBanner(out, "P A G I N G");
printPages(pagingDirectory, describeJournal, out, safe);
} catch (Exception e) {
e.printStackTrace();
return;
}
}
use of org.apache.activemq.artemis.core.server.impl.FileLockNodeManager in project activemq-artemis by apache.
the class NodeManagerAction method main.
public static void main(String[] args) throws Exception {
int[] work1 = new int[args.length];
for (int i = 0; i < args.length; i++) {
work1[i] = Integer.parseInt(args[i]);
}
NodeManagerAction nodeManagerAction = new NodeManagerAction(work1);
FileLockNodeManager nodeManager = new FileLockNodeManager(new File("."), false);
nodeManager.start();
try {
nodeManagerAction.performWork(nodeManager);
} catch (Exception e) {
e.printStackTrace();
System.exit(9);
}
System.out.println("work performed");
}
use of org.apache.activemq.artemis.core.server.impl.FileLockNodeManager in project activemq-artemis by apache.
the class RealNodeManagerTest method testId.
@Test
public void testId() throws Exception {
NodeManager nodeManager = new FileLockNodeManager(new File(getTemporaryDir()), false);
nodeManager.start();
UUID id1 = nodeManager.getUUID();
nodeManager.stop();
nodeManager.start();
ActiveMQTestBase.assertEqualsByteArrays(id1.asBytes(), nodeManager.getUUID().asBytes());
nodeManager.stop();
}
Aggregations