Examples of ActiveMQObjectMessage


Examples of io.fabric8.gateway.handlers.detecting.protocol.openwire.command.ActiveMQObjectMessage

   
    /**
     * @return a new object instance
     */
    public DataStructure createObject() {
        return new ActiveMQObjectMessage();
    }
View Full Code Here

Examples of org.activemq.message.ActiveMQObjectMessage

      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);
        msg.setJMSDestination(dest.getTopicForTempAdvisory());
        msg.setJMSMessageID("ID:" + dest.getPhysicalName()
            + " .started");
        this.syncSendPacket(msg);
      }
    }
  }
View Full Code Here

Examples of org.activemq.message.ActiveMQObjectMessage

    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);
        msg.setJMSDestination(dest.getTopicForTempAdvisory());
        msg.setJMSMessageID("ID:" + dest.getPhysicalName()
            + " .stopped");
        this.syncSendPacket(msg);
      }
    }
  }
View Full Code Here

Examples of org.apache.activemq.apollo.openwire.command.ActiveMQObjectMessage

   
    /**
     * @return a new object instance
     */
    public DataStructure createObject() {
        return new ActiveMQObjectMessage();
    }
View Full Code Here

Examples of org.apache.activemq.apollo.openwire.command.ActiveMQObjectMessage

   
    /**
     * @return a new object instance
     */
    public DataStructure createObject() {
        return new ActiveMQObjectMessage();
    }
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQObjectMessage

                }

                activeMessage = msg;
            } else if (message instanceof ObjectMessage) {
                ObjectMessage objMsg = (ObjectMessage)message;
                ActiveMQObjectMessage msg = new ActiveMQObjectMessage();
                msg.setConnection(connection);
                msg.setObject(objMsg.getObject());
                msg.storeContent();
                activeMessage = msg;
            } else if (message instanceof StreamMessage) {
                StreamMessage streamMessage = (StreamMessage)message;
                streamMessage.reset();
                ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
                msg.setConnection(connection);
                Object obj = null;

                try {
                    while ((obj = streamMessage.readObject()) != null) {
                        msg.writeObject(obj);
                    }
                } catch (MessageEOFException e) {
                    // if an end of message stream as expected
                } catch (JMSException e) {
                }

                activeMessage = msg;
            } else if (message instanceof TextMessage) {
                TextMessage textMsg = (TextMessage)message;
                ActiveMQTextMessage msg = new ActiveMQTextMessage();
                msg.setConnection(connection);
                msg.setText(textMsg.getText());
                activeMessage = msg;
            } else {
                activeMessage = new ActiveMQMessage();
                activeMessage.setConnection(connection);
            }
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQObjectMessage

                }

                activeMessage = msg;
            } else if (message instanceof ObjectMessage) {
                ObjectMessage objMsg = (ObjectMessage)message;
                ActiveMQObjectMessage msg = new ActiveMQObjectMessage();
                msg.setConnection(connection);
                msg.setObject(objMsg.getObject());
                msg.storeContent();
                activeMessage = msg;
            } else if (message instanceof StreamMessage) {
                StreamMessage streamMessage = (StreamMessage)message;
                streamMessage.reset();
                ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
                msg.setConnection(connection);
                Object obj = null;

                try {
                    while ((obj = streamMessage.readObject()) != null) {
                        msg.writeObject(obj);
                    }
                } catch (MessageEOFException e) {
                    // if an end of message stream as expected
                } catch (JMSException e) {
                }

                activeMessage = msg;
            } else if (message instanceof TextMessage) {
                TextMessage textMsg = (TextMessage)message;
                ActiveMQTextMessage msg = new ActiveMQTextMessage();
                msg.setConnection(connection);
                msg.setText(textMsg.getText());
                activeMessage = msg;
            } else {
                activeMessage = new ActiveMQMessage();
                activeMessage.setConnection(connection);
            }
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQObjectMessage

        if (body instanceof String) {
            ActiveMQTextMessage answer = new ActiveMQTextMessage();
            answer.setText((String) body);
            return answer;
        } else if (body instanceof Serializable) {
            ActiveMQObjectMessage answer = new ActiveMQObjectMessage();
            answer.setObject((Serializable) body);
            return answer;
        } else {
            return new ActiveMQMessage();
        }
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQObjectMessage

                headers.put(Stomp.Headers.TRANSFORMATION, Stomp.Transformations.JMS_OBJECT_XML.toString());
            } else if (headers.get(Stomp.Headers.TRANSFORMATION).equals(Stomp.Transformations.JMS_JSON.toString())) {
                headers.put(Stomp.Headers.TRANSFORMATION, Stomp.Transformations.JMS_OBJECT_JSON.toString());
            }

            ActiveMQObjectMessage msg = (ActiveMQObjectMessage) message.copy();
            command.setContent(marshall(msg.getObject(),
                    headers.get(Stomp.Headers.TRANSFORMATION))
                    .getBytes("UTF-8"));
            return command;

        } else if (message.getDataStructureType() == ActiveMQMapMessage.DATA_STRUCTURE_TYPE) {
            StompFrame command = new StompFrame();
            command.setAction(Stomp.Responses.MESSAGE);
            Map<String, String> headers = new HashMap<String, String>(25);
            command.setHeaders(headers);

            FrameTranslator.Helper.copyStandardHeadersFromMessageToFrame(
                    converter, message, command, this);

            if (headers.get(Stomp.Headers.TRANSFORMATION).equals(Stomp.Transformations.JMS_XML.toString())) {
                headers.put(Stomp.Headers.TRANSFORMATION, Stomp.Transformations.JMS_MAP_XML.toString());
            } else if (headers.get(Stomp.Headers.TRANSFORMATION).equals(Stomp.Transformations.JMS_JSON.toString())) {
                headers.put(Stomp.Headers.TRANSFORMATION, Stomp.Transformations.JMS_MAP_JSON.toString());
            }

            ActiveMQMapMessage msg = (ActiveMQMapMessage) message.copy();
            command.setContent(marshall((Serializable)msg.getContentMap(),
                    headers.get(Stomp.Headers.TRANSFORMATION))
                    .getBytes("UTF-8"));
            return command;
        } else if (message.getDataStructureType() == ActiveMQMessage.DATA_STRUCTURE_TYPE &&
                AdvisorySupport.ADIVSORY_MESSAGE_TYPE.equals(message.getType())) {
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQObjectMessage

        getXStream().marshal(object, out);
        return buffer.toString();
    }

    protected ActiveMQObjectMessage createObjectMessage(HierarchicalStreamReader in) throws JMSException {
        ActiveMQObjectMessage objMsg = new ActiveMQObjectMessage();
        Object obj = getXStream().unmarshal(in);
        objMsg.setObject((Serializable) obj);
        return objMsg;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.