Package org.apache.activemq.openwire

Examples of org.apache.activemq.openwire.OpenWireFormat


        return transport;
    }

    protected Transport createTransport(URI location, WireFormat wf) throws UnknownHostException, IOException {
        OpenWireFormat wireFormat = asOpenWireFormat(wf);
        return new UdpTransport(wireFormat, location);
    }
View Full Code Here


     */
    protected Transport configure(Transport transport, WireFormat format, Map options, boolean acceptServer) throws Exception {
        IntrospectionSupport.setProperties(transport, options);
        UdpTransport udpTransport = (UdpTransport)transport;

        OpenWireFormat openWireFormat = asOpenWireFormat(format);

        if (udpTransport.isTrace()) {
            transport = TransportLoggerFactory.getInstance().createTransportLogger(transport);
        }

View Full Code Here

    protected Transport configureClientSideNegotiator(Transport transport, WireFormat format, final UdpTransport udpTransport) {
        return new ResponseRedirectInterceptor(transport, udpTransport);
    }

    protected OpenWireFormat asOpenWireFormat(WireFormat wf) {
        OpenWireFormat answer = (OpenWireFormat)wf;
        return answer;
    }
View Full Code Here

        super.setUp();
        openWireformat = createOpenWireFormat();
    }

    protected OpenWireFormat createOpenWireFormat() {
        OpenWireFormat wf = new OpenWireFormat();
        wf.setCacheEnabled(true);
        wf.setStackTraceEnabled(true);
        wf.setVersion(1);
        return wf;
    }
View Full Code Here

        assertEquals("Messages expected doesn't equal messages received", messagesExpected, messagesReceived);
        broker.stop();
    }

     protected void dumpMessages() throws Exception {
        WireFormat wireFormat = new OpenWireFormat();
        java.sql.Connection conn = ((JDBCPersistenceAdapter) broker.getPersistenceAdapter()).getDataSource().getConnection();
        PreparedStatement statement = conn.prepareStatement("SELECT ID, MSG FROM ACTIVEMQ_MSGS");
        ResultSet result = statement.executeQuery();
        LOG.info("Messages left in broker after test");
        while(result.next()) {
            long id = result.getLong(1);
            org.apache.activemq.command.Message message = (org.apache.activemq.command.Message)wireFormat.unmarshal(new ByteSequence(result.getBytes(2)));
            LOG.info("id: " + id + ", message SeqId: " + message.getMessageId().getBrokerSequenceId() + ", MSG: " + message);
        }
        statement.close();
        conn.close();
    }
View Full Code Here

        assertNotNull(queuedMessages);
        assertEquals("Should have found 10 messages", 10, queuedMessages.size());
    }

    protected List<Message> dumpMessages() throws Exception {
        WireFormat wireFormat = new OpenWireFormat();
        java.sql.Connection conn = ((JDBCPersistenceAdapter) service.getPersistenceAdapter()).getDataSource().getConnection();
        PreparedStatement statement = conn.prepareStatement("SELECT ID, MSG FROM MYPREFIX_ACTIVEMQ_MSGS");
        ResultSet result = statement.executeQuery();
        ArrayList<Message> results = new ArrayList<Message>();
        while(result.next()) {
            long id = result.getLong(1);
            Message message = (Message)wireFormat.unmarshal(new ByteSequence(result.getBytes(2)));
            LOG.info("id: " + id + ", message SeqId: " + message.getMessageId().getBrokerSequenceId() + ", MSG: " + message);
            results.add(message);
        }
        statement.close();
        conn.close();
View Full Code Here

    }

    private void fakeUnmarshal(ActiveMQObjectMessage message) throws IOException {
        // we need to force the unmarshalled property field to be set so it
        // gives us a hawtbuffer for the string
        OpenWireFormat format = new OpenWireFormat();
        message.beforeMarshall(format);
        message.afterMarshall(format);

        ByteSequence seq = message.getMarshalledProperties();
        message.clearProperties();
View Full Code Here

        msg.setProperty("floatProperty", Float.valueOf("1.1f"));
        msg.setProperty("doubleProperty", Double.valueOf("1.1"));
        msg.setProperty("booleanProperty", Boolean.TRUE);
        msg.setProperty("nullProperty", null);

        msg.beforeMarshall(new OpenWireFormat());

        Map<String, Object> properties = msg.getProperties();
        assertEquals(properties.get("stringProperty"), "string");
        assertEquals(((Byte) properties.get("byteProperty")).byteValue(), 1);
        assertEquals(((Short) properties.get("shortProperty")).shortValue(), 1);
View Full Code Here

    public WireFormat wireFormat = new OpenWireFormat();

    public void initCombos() {

        OpenWireFormat wf1 = new OpenWireFormat();
        wf1.setCacheEnabled(false);
        OpenWireFormat wf2 = new OpenWireFormat();
        wf2.setCacheEnabled(true);

        addCombinationValues("wireFormat", new Object[] {wf1, wf2, });
    }
View Full Code Here

    };

    protected Transport createProducer() throws Exception {
        LOG.info("Producer using URI: " + producerURI);

        OpenWireFormat wireFormat = createWireFormat();
        UnreliableUdpTransport transport = new UnreliableUdpTransport(wireFormat, new URI(producerURI));
        transport.setDropCommandStrategy(dropStrategy);

        ReliableTransport reliableTransport = new ReliableTransport(transport, transport);
        Replayer replayer = reliableTransport.getReplayer();
View Full Code Here

TOP

Related Classes of org.apache.activemq.openwire.OpenWireFormat

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.