Package com.betfair.cougar.netutil.nio.message

Examples of com.betfair.cougar.netutil.nio.message.EventMessage


        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        CougarObjectOutput out = objectIOFactory.newCougarObjectOutput(baos, CougarProtocol.getProtocolVersion(session));
        out.writeObject(obj);
        out.flush();

        session.write(new EventMessage(baos.toByteArray()));
    }
View Full Code Here


                                        for (Byte version : protocolVersions) {
                                            ByteArrayOutputStream baos = new ByteArrayOutputStream();
                                            CougarObjectOutput out = objectIOFactory.newCougarObjectOutput(baos, version);
                                            out.writeObject(new HeapDelta(heapState.getHeapId(), updateId, updatesThisBatch));
                                            out.flush();
                                            serialisedUpdatesByProtocolVersion.put(version, new EventMessage(baos.toByteArray()));
                                        }
                                        // now write these out for each session
                                        for (IoSession session : heapState.getSessions()) {
                                            nioLogger.log(NioLogger.LoggingLevel.TRANSPORT, session, "Sending heap delta of size %s and with updateId = %s for heapId = %s", updatesThisBatch.size(), updateId, heapState.getHeapId());
                                            session.write(serialisedUpdatesByProtocolVersion.get(CougarProtocol.getProtocolVersion(session)));
View Full Code Here

            processor.process(command);

            sessionLogger.log(ALL, session, "ExecutionVenueServerHandler - Message %s processed", req.getCorrelationId());
        }
        else if (message instanceof EventMessage) {
            EventMessage em = (EventMessage) message;

            final CougarObjectInput in = objectIOFactory.newCougarObjectInput(new ByteArrayInputStream(em.getPayload()), CougarProtocol.getProtocolVersion(session));
            final String remoteAddress = ((InetSocketAddress) session.getRemoteAddress()).getAddress().getHostAddress();
            final SocketTransportCommandImpl command = new SocketTransportCommandImpl(in, remoteAddress, session);

            eventsReceived.incrementAndGet();
            processor.process(command);
View Full Code Here

TOP

Related Classes of com.betfair.cougar.netutil.nio.message.EventMessage

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.