updated message properties

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@561428 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2007-07-31 18:34:32 +00:00
parent 5ad4732038
commit ec6a7029c5
1 changed files with 60 additions and 55 deletions

View File

@ -43,6 +43,7 @@ public class PropertyExpression implements Expression {
static final private HashMap JMS_PROPERTY_EXPRESSIONS = new HashMap();
static{
JMS_PROPERTY_EXPRESSIONS.put("JMSDestination",new SubExpression(){
public Object evaluate(Message message){
ActiveMQDestination dest=message.getOriginalDestination();
if(dest==null)
@ -53,6 +54,7 @@ public class PropertyExpression implements Expression {
}
});
JMS_PROPERTY_EXPRESSIONS.put("JMSReplyTo",new SubExpression(){
public Object evaluate(Message message){
if(message.getReplyTo()==null)
return null;
@ -60,21 +62,25 @@ public class PropertyExpression implements Expression {
}
});
JMS_PROPERTY_EXPRESSIONS.put("JMSType",new SubExpression(){
public Object evaluate(Message message){
return message.getType();
}
});
JMS_PROPERTY_EXPRESSIONS.put("JMSDeliveryMode",new SubExpression(){
public Object evaluate(Message message){
return Integer.valueOf(message.isPersistent()?DeliveryMode.PERSISTENT:DeliveryMode.NON_PERSISTENT);
}
});
JMS_PROPERTY_EXPRESSIONS.put("JMSPriority",new SubExpression(){
public Object evaluate(Message message){
return Integer.valueOf(message.getPriority());
}
});
JMS_PROPERTY_EXPRESSIONS.put("JMSMessageID",new SubExpression(){
public Object evaluate(Message message){
if(message.getMessageId()==null)
return null;
@ -82,52 +88,49 @@ public class PropertyExpression implements Expression {
}
});
JMS_PROPERTY_EXPRESSIONS.put("JMSTimestamp",new SubExpression(){
public Object evaluate(Message message){
return Long.valueOf(message.getTimestamp());
}
});
JMS_PROPERTY_EXPRESSIONS.put("JMSCorrelationID",new SubExpression(){
public Object evaluate(Message message){
return message.getCorrelationId();
}
});
JMS_PROPERTY_EXPRESSIONS.put("JMSExpiration",new SubExpression(){
public Object evaluate(Message message){
return Long.valueOf(message.getExpiration());
}
});
JMS_PROPERTY_EXPRESSIONS.put("JMSPriority", new SubExpression() {
public Object evaluate(Message message) {
return Integer.valueOf(message.getPriority());
}
});
JMS_PROPERTY_EXPRESSIONS.put("JMSTimestamp", new SubExpression() {
public Object evaluate(Message message) {
return Long.valueOf(message.getTimestamp());
}
});
JMS_PROPERTY_EXPRESSIONS.put("JMSRedelivered",new SubExpression(){
public Object evaluate(Message message){
return Boolean.valueOf(message.isRedelivered());
}
});
JMS_PROPERTY_EXPRESSIONS.put("JMSXDeliveryCount",new SubExpression(){
public Object evaluate(Message message){
return Integer.valueOf(message.getRedeliveryCounter()+1);
}
});
JMS_PROPERTY_EXPRESSIONS.put("JMSXGroupID",new SubExpression(){
public Object evaluate(Message message){
return message.getGroupID();
}
});
JMS_PROPERTY_EXPRESSIONS.put("JMSXGroupSeq",new SubExpression(){
public Object evaluate(Message message){
return new Integer(message.getGroupSequence());
}
});
JMS_PROPERTY_EXPRESSIONS.put("JMSXProducerTXID",new SubExpression(){
public Object evaluate(Message message){
TransactionId txId=message.getOriginalTransactionId();
if(txId==null)
@ -137,12 +140,14 @@ public class PropertyExpression implements Expression {
return new Integer(txId.toString());
}
});
JMS_PROPERTY_EXPRESSIONS.put("JMS_ActiveMQBrokerInTime", new SubExpression() {
JMS_PROPERTY_EXPRESSIONS.put("JMSActiveMQBrokerInTime",new SubExpression(){
public Object evaluate(Message message){
return Long.valueOf(message.getBrokerInTime());
}
});
JMS_PROPERTY_EXPRESSIONS.put("JMS_ActiveMQBrokerOutTime", new SubExpression() {
JMS_PROPERTY_EXPRESSIONS.put("JMSActiveMQBrokerOutTime",new SubExpression(){
public Object evaluate(Message message){
return Long.valueOf(message.getBrokerOutTime());
}