use of org.apache.activemq.artemis.core.server.files.FileStoreMonitor in project activemq-artemis by apache.
the class ActiveMQServerImpl method initialisePart2.
/*
* Load the data, and start remoting service so clients can connect
*/
synchronized void initialisePart2(boolean scalingDown) throws Exception {
if (state == SERVER_STATE.STOPPED || state == SERVER_STATE.STOPPING) {
return;
}
pagingManager.reloadStores();
JournalLoadInformation[] journalInfo = loadJournals();
final ServerInfo dumper = new ServerInfo(this, pagingManager);
long dumpInfoInterval = configuration.getServerDumpInterval();
if (dumpInfoInterval > 0) {
scheduledPool.scheduleWithFixedDelay(new Runnable() {
@Override
public void run() {
ActiveMQServerLogger.LOGGER.dumpServerInfo(dumper.dump());
}
}, 0, dumpInfoInterval, TimeUnit.MILLISECONDS);
}
// Deploy the rest of the stuff
// Deploy predefined addresses
deployAddressesFromConfiguration();
// Deploy any predefined queues
deployQueuesFromConfiguration();
// Undeploy any addresses and queues not in config
undeployAddressesAndQueueNotInConfiguration();
// We need to call this here, this gives any dependent server a chance to deploy its own addresses
// this needs to be done before clustering is fully activated
callActivateCallbacks();
checkForPotentialOOMEInAddressConfiguration();
if (!scalingDown) {
// Deploy any pre-defined diverts
deployDiverts();
if (groupingHandler != null) {
groupingHandler.start();
}
if (groupingHandler != null && groupingHandler instanceof LocalGroupingHandler) {
clusterManager.start();
groupingHandler.awaitBindings();
remotingService.start();
} else {
remotingService.start();
clusterManager.start();
}
if (nodeManager.getNodeId() == null) {
throw ActiveMQMessageBundle.BUNDLE.nodeIdNull();
}
// We can only do this after everything is started otherwise we may get nasty races with expired messages
postOffice.startExpiryScanner();
}
if (configuration.getMaxDiskUsage() != -1) {
try {
injectMonitor(new FileStoreMonitor(getScheduledPool(), executorFactory.getExecutor(), configuration.getDiskScanPeriod(), TimeUnit.MILLISECONDS, configuration.getMaxDiskUsage() / 100f, shutdownOnCriticalIO));
} catch (Exception e) {
ActiveMQServerLogger.LOGGER.unableToInjectMonitor(e);
}
}
}
Aggregations