Package org.archfirst.bfcommon.jsontrading

Examples of org.archfirst.bfcommon.jsontrading.JsonMessage


        // Write out the JsonMessage as a string
        String jsonMessageString = JsonMessageMapper.toFormattedString(newOrderSingle);
       
        // Read the JsonMessage back
        JsonMessage jsonMessageRead = JsonMessageMapper.fromString(jsonMessageString);
       
        // Make sure that the message type has been retrieved properly
        Assert.assertTrue(
                jsonMessageRead.getClass().equals(NewOrderSingle.class));
       
        // Make sure that the order has been retrieved properly
        Order orderRead =
            ((NewOrderSingle)jsonMessageRead).getOrder();
View Full Code Here


    @Override
    public void processMessage(String messageText) {

        // Parse the message
        JsonMessage jsonMessage = JsonMessageMapper.fromString(messageText);
        logger.debug("Received message:\n{}", JsonMessageMapper.toFormattedString(jsonMessage));
       
        // Dispatch to the correct handler
        if (jsonMessage.getClass().equals(NewOrderSingle.class)) {
            this.onMessage((NewOrderSingle)jsonMessage);
        }
        else if (jsonMessage.getClass().equals(OrderCancelRequest.class)) {
            this.onMessage((OrderCancelRequest)jsonMessage);
        }
    }
View Full Code Here

    @Override
    public void processMessage(String messageText) {

        // Parse the message
        JsonMessage jsonMessage = JsonMessageMapper.fromString(messageText);
        logger.debug("Received message:\n{}", JsonMessageMapper.toFormattedString(jsonMessage));
       
        // Dispatch to the correct handler
        if (jsonMessage.getClass().equals(ExecutionReport.class)) {
            this.onMessage((ExecutionReport)jsonMessage);
        }
        else if (jsonMessage.getClass().equals(OrderCancelReject.class)) {
            this.onMessage((OrderCancelReject)jsonMessage);
        }
    }
View Full Code Here

TOP

Related Classes of org.archfirst.bfcommon.jsontrading.JsonMessage

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.