org.apache.activemq.console.command.store.amq
public class: MessageBodyFormatter [javadoc |
source]
java.lang.Object
org.apache.activemq.console.command.store.amq.MessageBodyFormatter
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Field Summary |
---|
final ActiveMQMessage | message | |
Method from org.apache.activemq.console.command.store.amq.MessageBodyFormatter Summary: |
---|
toString |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from org.apache.activemq.console.command.store.amq.MessageBodyFormatter Detail: |
public String toString() {
try {
switch (message.getDataStructureType()) {
case ActiveMQMessage.DATA_STRUCTURE_TYPE:
return "";
case ActiveMQBlobMessage.DATA_STRUCTURE_TYPE:
ActiveMQBlobMessage blob = (ActiveMQBlobMessage) message;
return blob.getRemoteBlobUrl();
case ActiveMQMapMessage.DATA_STRUCTURE_TYPE:
ActiveMQMapMessage map = (ActiveMQMapMessage)message;
return map.getContentMap().toString();
case ActiveMQTextMessage.DATA_STRUCTURE_TYPE:
ActiveMQTextMessage text = (ActiveMQTextMessage)message;
return text.getText();
case ActiveMQBytesMessage.DATA_STRUCTURE_TYPE:
case ActiveMQObjectMessage.DATA_STRUCTURE_TYPE:
case ActiveMQStreamMessage.DATA_STRUCTURE_TYPE:
ByteSequence data = message.getContent();
return "binary payload {length="+data.getLength()+", compressed="+message.isCompressed()+"}";
}
} catch (JMSException e) {
}
return "";
}
|