Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.ActiveMQObjectMessage


     * @return an ActiveMQObjectMessage
     * @throws JMSException if the JMS provider fails to create this message due to some internal error.
     */
    public ObjectMessage createObjectMessage() throws JMSException {
        checkClosed();
        return new ActiveMQObjectMessage();
    }
View Full Code Here


     * @return an ActiveMQObjectMessage
     * @throws JMSException if the JMS provider fails to create this message due to some internal error.
     */
    public ObjectMessage createObjectMessage(Serializable object) throws JMSException {
        checkClosed();
        ActiveMQObjectMessage msg = new ActiveMQObjectMessage();
        msg.setObject(object);
        return msg;
    }
View Full Code Here

     * @return an ActiveMQObjectMessage
     * @throws JMSException if the JMS provider fails to create this message due to some internal error.
     */
    public ObjectMessage createObjectMessage() throws JMSException {
        checkClosed();
        return new ActiveMQObjectMessage();
    }
View Full Code Here

     * @return an ActiveMQObjectMessage
     * @throws JMSException if the JMS provider fails to create this message due to some internal error.
     */
    public ObjectMessage createObjectMessage(Serializable object) throws JMSException {
        checkClosed();
        ActiveMQObjectMessage msg = new ActiveMQObjectMessage();
        msg.setObject(object);
        return msg;
    }
View Full Code Here

        if (dest != null && dest.isTemporary()) {
            TempDestinationAdvisoryEvent event = (TempDestinationAdvisoryEvent) tempDestinationMap.get(dest);
            if (event == null) {
                event = new TempDestinationAdvisoryEvent(dest, true);
                tempDestinationMap.put(dest, event);
                ActiveMQObjectMessage msg = new ActiveMQObjectMessage();
                msg.setObject(event);
                msg.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);
                String destName = ActiveMQDestination.TEMP_DESTINATION_ADVISORY_PREFIX + dest.getPhysicalName();
                ActiveMQDestination target = ActiveMQDestination.createDestination(dest.getDestinationType(), destName);
                msg.setJMSDestination(target);
                this.asyncSendPacket(msg);
            }
        }
    }
View Full Code Here

    protected void stopTemporaryDestination(ActiveMQDestination dest) throws JMSException{
        if (dest != null && dest.isTemporary()) {
            TempDestinationAdvisoryEvent event = (TempDestinationAdvisoryEvent) tempDestinationMap.remove(dest);
            if (event != null) {
                event.setStarted(false);
                ActiveMQObjectMessage msg = new ActiveMQObjectMessage();
                msg.setObject(event);
                msg.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);
                String destName = ActiveMQDestination.TEMP_DESTINATION_ADVISORY_PREFIX + dest.getPhysicalName();
                ActiveMQDestination target = ActiveMQDestination.createDestination(dest.getDestinationType(), destName);
                msg.setJMSDestination(target);
                this.asyncSendPacket(msg);
            }
        }
    }
View Full Code Here

  public ActiveMQObjectMessageReaderTest(String arg0) {
    super(arg0);
  }

  public void testGetPacketType() {
    ActiveMQObjectMessage msg = new ActiveMQObjectMessage();
    assertTrue(msg.getPacketType() == Packet.ACTIVEMQ_OBJECT_MESSAGE);
  }
View Full Code Here

  public void testReadPacket() {
        DefaultWireFormat wf = new DefaultWireFormat();
    ActiveMQObjectMessageReader reader = new ActiveMQObjectMessageReader(wf);
    ActiveMQObjectMessageWriter writer = new ActiveMQObjectMessageWriter(wf);
    ActiveMQObjectMessage msg1 = new ActiveMQObjectMessage();
    try {
      msg1.setObject(this.table);
      super.initializeMessage(msg1);
      byte[] data = writer.writePacketToByteArray(msg1);
      ActiveMQObjectMessage msg2 = (ActiveMQObjectMessage) reader.readPacketFromByteArray(data);
      super.testEquals(msg1, msg2);
      assertTrue(msg1.getObject().equals(msg2.getObject()));
    }
    catch (IOException e) {
      e.printStackTrace();
      assertTrue(false);
    }
View Full Code Here

  public void testTime(){

        DefaultWireFormat wf = new DefaultWireFormat();
    ActiveMQObjectMessageReader reader = new ActiveMQObjectMessageReader(wf);
    ActiveMQObjectMessageWriter writer = new ActiveMQObjectMessageWriter(wf);
    ActiveMQObjectMessage msg1 = new ActiveMQObjectMessage();
   
    ActiveMQObjectMessage msg2 = null;
    try {
      int count = 10000;
      long startTime = System.currentTimeMillis();
   
      msg1.setObject(this.table);
View Full Code Here

    /**
     * @return a new Packet instance
     */

    public Packet createPacket() {
        return new ActiveMQObjectMessage();
    }
View Full Code Here

TOP

Related Classes of org.codehaus.activemq.message.ActiveMQObjectMessage

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.