Package com.betfair.cougar.transport.api.protocol

Examples of com.betfair.cougar.transport.api.protocol.CougarObjectInput


                    out.close();

                    ((RequestResponseManager) session.getAttribute(RequestResponseManager.SESSION_KEY)).sendRequest(baos.toByteArray(), new RequestResponseManager.ResponseHandler() {
                        @Override
                        public void responseReceived(ResponseMessage message) {
                            CougarObjectInput in = objectIOFactory.newCougarObjectInput(new ByteArrayInputStream(message.getPayload()), CougarProtocol.getProtocolVersion(session));

                            try {
                                EnumUtils.setHardFailureForThisThread(hardFailEnumDeserialisation);
                                InvocationResponse response = marshaller.readInvocationResponse(def.getReturnType(), in);
                                // connected object calls need some additional setup prior to responding to the observer
View Full Code Here


        if (command instanceof SocketTransportRPCCommand) {
            incrementOutstandingRequests();
            super.process(command);    //To change body of overridden methods use File | Settings | File Templates.
        } else {
            try {
                CougarObjectInput input = command.getInput();
                Object eventPayload = input.readObject();
                input.close();

                if (eventPayload instanceof TerminateSubscription) {
                    connectedObjectManager.terminateSubscription(command.getSession(), (TerminateSubscription) eventPayload);
                } else {
                    logger.log(Level.SEVERE, "SocketTransportCommandProcessor - Received unexpected event type: " + eventPayload + " - closing session");
View Full Code Here

    @Override
    protected CommandResolver<SocketTransportCommand> createCommandResolver(SocketTransportCommand command) {
        try {

            final CougarObjectInput in = command.getInput();

            // rpc call
            if (command instanceof SocketTransportRPCCommand) {
                final SocketTransportRPCCommand rpcCommand = (SocketTransportRPCCommand) command;
View Full Code Here

                    out.close();

                    ((RequestResponseManager) session.getAttribute(RequestResponseManager.SESSION_KEY)).sendRequest(baos.toByteArray(), new RequestResponseManager.ResponseHandler() {
                        @Override
                        public void responseReceived(ResponseMessage message) {
                            CougarObjectInput in = objectIOFactory.newCougarObjectInput(new ByteArrayInputStream(message.getPayload()), CougarProtocol.getProtocolVersion(session));

                            try {
                                EnumUtils.setHardFailureForThisThread(hardFailEnumDeserialisation);
                                InvocationResponse response = marshaller.readInvocationResponse(def.getReturnType(), in);
                                // connected object calls need some additional setup prior to responding to the observer
View Full Code Here

        if (command instanceof SocketTransportRPCCommand) {
            incrementOutstandingRequests();
            super.process(command);    //To change body of overridden methods use File | Settings | File Templates.
        } else {
            try {
                CougarObjectInput input = command.getInput();
                Object eventPayload = input.readObject();
                input.close();

                if (eventPayload instanceof TerminateSubscription) {
                    connectedObjectManager.terminateSubscription(command.getSession(), (TerminateSubscription) eventPayload);
                } else {
                    logger.log(Level.SEVERE, "SocketTransportCommandProcessor - Received unexpected event type: " + eventPayload + " - closing session");
View Full Code Here

    @Override
    protected CommandResolver<SocketTransportCommand> createCommandResolver(SocketTransportCommand command) {
        try {

            final CougarObjectInput in = command.getInput();

            // rpc call
            if (command instanceof SocketTransportRPCCommand) {
                final SocketTransportRPCCommand rpcCommand = (SocketTransportRPCCommand) command;
View Full Code Here

        }
        else if (message instanceof RequestMessage) {
            RequestMessage req = (RequestMessage) message;

            final CougarObjectOutput out = objectIOFactory.newCougarObjectOutput(new ByteArrayOutputStreamWithIoSession(session, req.getCorrelationId()), CougarProtocol.getProtocolVersion(session));
            final CougarObjectInput in = objectIOFactory.newCougarObjectInput(new ByteArrayInputStream(req.getPayload()), CougarProtocol.getProtocolVersion(session));
            final String remoteAddress = ((InetSocketAddress) session.getRemoteAddress()).getAddress().getHostAddress();
            final SocketTransportCommandImpl command = new SocketTransportRPCCommandImpl(in, out, remoteAddress, session);

            requestsReceived.incrementAndGet();
            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.transport.api.protocol.CougarObjectInput

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.