Package com.art.anette.common.network

Examples of com.art.anette.common.network.DataResponse


                    if (obj instanceof Ping) {
                        Ping ping = (Ping) obj;
                        cdbc.getSyncUpThread().addObject(new Pong(ping.getValue()));
                        cdbc.getSyncUpThread().wakeup();
                    } else if (obj instanceof DataResponse) {
                        DataResponse dataResponse = (DataResponse) obj;
                        cdbc.adoptList(dataResponse.getObjects());
                    }
                }
            } catch (StreamCorruptedException ex) {
                problem = true;
                logger.severe("Different versions of the server and client detected", ex);
View Full Code Here


        if (packet instanceof DataRequest) {
            DataRequest dataRequest = (DataRequest) packet;
            logger.info(String.format("%s: detail %s", prefix, prettyPrintObjectForLogging(dataRequest.getObject())));
        }
        if (packet instanceof DataResponse) {
            DataResponse dataResponse = (DataResponse) packet;
            for (int i = 0; i < dataResponse.getObjects().size(); i++) {
                Object o = dataResponse.getObjects().get(i);
                logger.info(String.format("%s: detail[%d/%d] %s", prefix,
                        i + 1, dataResponse.getObjects().size(), prettyPrintObjectForLogging(o)));
            }
        }
    }
View Full Code Here

                throw new IllegalStateException("not frozen");
            }
            frozen = false;
            freezeTime = null;
            if (!objects.isEmpty()) {
                DataResponse response = new DataResponse();
                for (Object object : objects) {
                    response.getObjects().add(adjustObjectForSending(object));
                }
                responses.add(response);
                objects.clear();
                lock.notifyAll();
            }
View Full Code Here

    @Override
    public void run() {
        while (!isInterrupted()) {

            // 1) look if we have something to send
            DataResponse response = null;
            synchronized (lock) {
                if (!responses.isEmpty()) {
                    response = responses.remove(0);
                }
            }
View Full Code Here

TOP

Related Classes of com.art.anette.common.network.DataResponse

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.