Package org.activemq.io.impl

Examples of org.activemq.io.impl.DefaultWireFormat


    public static PersistenceAdapter createDefault(boolean cleanup) {
        EmbeddedDataSource ds = new EmbeddedDataSource();
        ds.setDatabaseName("testdb");
        ds.setCreateDatabase("create");
    //AxionDataSource ds = new AxionDataSource("jdbc:axiondb:testdb");
        JDBCPersistenceAdapter rc = new JDBCPersistenceAdapter(ds, new DefaultWireFormat());
        rc.setDropTablesOnStartup(cleanup);
        return rc;
  }
View Full Code Here


        container.stop();
    }

    protected void setUp() throws Exception {
        container = new BrokerContainerImpl(URL);
        BrokerConnector brokerConnector = new BrokerConnectorImpl(container, URL, new DefaultWireFormat());
        container.start();

        super.setUp();
    }
View Full Code Here

     *
     * Runs at about 2600 msg/sec on OS X G4 1.5ghz
     */
    public void XtestMessageSerialization() throws Exception {
        message.setReceiptRequired(false);
        DefaultWireFormat wireFormat = new DefaultWireFormat();

        long start = System.currentTimeMillis();
        for (int i = 0; i < MESSAGE_COUNT; i++) {

            message.setJMSMessageID("id:"+i);

            PacketByteArrayOutputStream pos = new PacketByteArrayOutputStream();
            DataOutputStream os = new DataOutputStream(pos);
            os.writeByte(1);
            os.writeUTF("Test");
            wireFormat.writePacket(message, os);
            os.close();
           
        }
        long end = System.currentTimeMillis();

View Full Code Here

       
        int workers=10;
        Callable task = new Callable() {
            public Object call() throws Exception {
               
                DefaultWireFormat wireFormat = new DefaultWireFormat();
                ActiveMQMessage copy = message.deepCopy();
                copy.setReceiptRequired(false);
               
                for (int i = 0; i < MESSAGE_COUNT; i++) {
                    copy.setJMSMessageID("id:"+i);

                    PacketByteArrayOutputStream pos = new PacketByteArrayOutputStream();
                    DataOutputStream os = new DataOutputStream(pos);
                    os.writeByte(1);
                    os.writeUTF("Test");
                    wireFormat.writePacket(copy, os);
                    os.close();
                }
               
                return null;
            }
View Full Code Here

    protected PacketWriter writer;
    protected PacketReader reader;
    protected int packetCount = 10;

    public void testWireFormat() throws IOException, JMSException {
        WireFormat wireFormat = new DefaultWireFormat();

        Packet packet = createPacket();
        System.out.println("Created packet: " + packet + " with type: " + packet.getPacketType());

        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        DataOutputStream dataOut = new DataOutputStream(buffer);
        wireFormat.writePacket(packet, dataOut);
        dataOut.close();
        byte[] bytes = buffer.toByteArray();

        DataInputStream dataIn = new DataInputStream(new ByteArrayInputStream(bytes));
        int type = dataIn.readByte();
        System.out.println("Read type: " + type);
        Packet otherPacket = wireFormat.readPacket(type, dataIn);

        System.out.println("Read packet: " + otherPacket);
        assertPacket(otherPacket, packet);
    }
View Full Code Here

        context.deregisterConnector(connector.getServerChannel().getUrl());
    }


    public void addConnector(String bindAddress) throws JMSException {
        addConnector(bindAddress, new DefaultWireFormat());
    }
View Full Code Here

                chars[i] = '_';
            }
        }
        this.name = new String(chars);
        this.maxDataLength = maxDataLength;
        this.wireFormat = new DefaultWireFormat();
        this.container = new DataContainer(dir, this.name, maxBlockSize);
        //as the DataContainer is temporary, clean-up any old files
        this.container.deleteAll();
    }
View Full Code Here

        assertTrue("has receive channel", vmChannel.getReceiveChannel() == null);
        vmChannel.stop();
    }

    protected TransportChannel createChannel(String uri) throws JMSException, URISyntaxException {
        return TransportChannelProvider.create(new DefaultWireFormat(), new URI(uri));
    }
View Full Code Here

    forced = false;
  }
 
  public void testKeepAliveProperty() throws Exception {
    long keepAliveTimeout = 373727;
    ReliableTransportChannel ch = (ReliableTransportChannel) new ReliableTransportChannelFactory().create(new DefaultWireFormat(), new URI("vm://localhost:6144?keepAliveTimeout=" + keepAliveTimeout));
    assertEquals(ch.getKeepAliveTimeout(), keepAliveTimeout);
  }
View Full Code Here

  protected class ReliableTransportChannelMock extends ReliableTransportChannel {
    private boolean stopped = false;
    protected long lastReceiptTime = 0;

    protected ReliableTransportChannelMock() {
      super(new DefaultWireFormat());
    }
View Full Code Here

TOP

Related Classes of org.activemq.io.impl.DefaultWireFormat

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.