Coverage Report - org.mule.routing.ExpressionMessageInfoMapping
 
Classes in this File Line Coverage Branch Coverage Complexity
ExpressionMessageInfoMapping
0%
0/12
0%
0/2
1.167
 
 1  
 /*
 2  
  * $Id: ExpressionMessageInfoMapping.java 11475 2008-03-21 22:46:33Z rossmason $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 package org.mule.routing;
 11  
 
 12  
 import org.mule.api.MuleMessage;
 13  
 import org.mule.api.routing.MessageInfoMapping;
 14  
 import org.mule.util.expression.ExpressionEvaluatorManager;
 15  
 
 16  
 /**
 17  
  * TODO
 18  
  */
 19  0
 public class ExpressionMessageInfoMapping implements MessageInfoMapping
 20  
 {
 21  
     private String correlationIdExpression;
 22  
     private String messageIdExpression;
 23  
 
 24  
     public String getMessageId(MuleMessage message)
 25  
     {
 26  0
         return (String)ExpressionEvaluatorManager.evaluate(getMessageIdExpression(), message, true);
 27  
     }
 28  
 
 29  
     public String getCorrelationId(MuleMessage message)
 30  
     {
 31  0
         String id = (String)ExpressionEvaluatorManager.evaluate(getCorrelationIdExpression(), message, true);
 32  0
         if (id == null)
 33  
         {
 34  0
             id = getMessageId(message);
 35  
         }
 36  0
         return id;
 37  
     }
 38  
 
 39  
     public String getCorrelationIdExpression()
 40  
     {
 41  0
         return correlationIdExpression;
 42  
     }
 43  
 
 44  
     public void setCorrelationIdExpression(String correlationIdExpression)
 45  
     {
 46  0
         this.correlationIdExpression = correlationIdExpression;
 47  0
     }
 48  
 
 49  
     public String getMessageIdExpression()
 50  
     {
 51  0
         return messageIdExpression;
 52  
     }
 53  
 
 54  
     public void setMessageIdExpression(String messageIdExpression)
 55  
     {
 56  0
         this.messageIdExpression = messageIdExpression;
 57  0
     }
 58  
 }