{
if (state == SERVER_STATE.STOPPED)
return false;
// Create the pools - we have two pools - one for non scheduled - and another for scheduled
ThreadFactory tFactory = new HornetQThreadFactory("HornetQ-server-" + this.toString(),
false,
getThisClassLoader());
if (configuration.getJournalType() == JournalType.ASYNCIO && !AIOSequentialFileFactory.isSupported())
{
HornetQServerLogger.LOGGER.switchingNIO();
configuration.setJournalType(JournalType.NIO);
}
if (configuration.getThreadPoolMaxSize() == -1)
{
threadPool = Executors.newCachedThreadPool(tFactory);
}
else
{
threadPool = Executors.newFixedThreadPool(configuration.getThreadPoolMaxSize(), tFactory);
}
executorFactory = new OrderedExecutorFactory(threadPool);
scheduledPool = new ScheduledThreadPoolExecutor(configuration.getScheduledThreadPoolMaxSize(),
new HornetQThreadFactory("HornetQ-scheduled-threads",
false,
getThisClassLoader()));
managementService = new ManagementServiceImpl(mbeanServer, configuration);