Package org.hypertable.AsyncComm

Examples of org.hypertable.AsyncComm.ResponseCallback


        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));
        }
View Full Code Here

TOP

Related Classes of org.hypertable.AsyncComm.ResponseCallback

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.