mComm = comm;
mAppQueue = appQueue;
}
public void run() {
ResponseCallback cb = new ResponseCallback(mComm, mEvent);
try {
if (mEvent.payload.remaining() < 2)
throw new ProtocolException("Truncated message");
short flags = mEvent.payload.getShort();
if ((flags & Protocol.SHUTDOWN_FLAG_IMMEDIATE) != 0) {
log.info("Immediate shutdown.");
System.exit(0);
}
mAppQueue.Shutdown();
cb.response_ok();
wait(2000);
System.exit(0);
}
catch (ProtocolException e) {
int error = cb.error(Error.PROTOCOL_ERROR, e.getMessage());
log.severe("Protocol error (SHUTDOWN) - " + e.getMessage());
if (error != Error.OK)
log.severe("Problem sending (SHUTDOWN) error back to client - "
+ Error.GetText(error));
}