if (con instanceof IMQBasicConnection) {
IMQBasicConnection ipCon = (IMQBasicConnection)con;
ipCon.flushControl(1000);
}
BrokerStateHandler bsh = Globals.getBrokerStateHandler();
if (time == null || time.intValue() == 0) {
// stop new connections
// set the flag to notify everyone we are shutting down
BrokerStateHandler.shuttingDown = true;
bsh.prepareShutdown(failover);
}
//if we aren't doing an unsafe exit, give us time to complete any operations
waitForHandlersToComplete(20);
// logging
if (shouldRestart) {
logger.log(Logger.INFO, BrokerResources.I_ADMIN_RESTART_REQUEST);
} else {
logger.log(Logger.INFO, BrokerResources.I_ADMIN_SHUTDOWN_REQUEST);
}
// shutdown the broker
bsh.initiateShutdown("admin", (time == null ? 0 : time.longValue())* 1000, failover, (shouldRestart ? BrokerStateHandler.getRestartCode() : 0), true);
}
return true;
}