Coverage Report - org.mule.routing.ExpressionMessageInfoMapping
 
Classes in this File Line Coverage Branch Coverage Complexity
ExpressionMessageInfoMapping
0%
0/14
0%
0/2
1.143
 
 1  
 /*
 2  
  * $Id: ExpressionMessageInfoMapping.java 19191 2010-08-25 21:05:23Z tcarlson $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.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.MuleContext;
 13  
 import org.mule.api.MuleMessage;
 14  
 import org.mule.api.context.MuleContextAware;
 15  
 import org.mule.api.routing.MessageInfoMapping;
 16  
 
 17  
 /**
 18  
  * TODO
 19  
  */
 20  0
 public class ExpressionMessageInfoMapping implements MessageInfoMapping, MuleContextAware
 21  
 {
 22  
     private String correlationIdExpression;
 23  
     private String messageIdExpression;
 24  
     private MuleContext muleContext;
 25  
 
 26  
     public void setMuleContext(MuleContext context)
 27  
     {
 28  0
         this.muleContext = context;
 29  0
     }
 30  
 
 31  
     public String getMessageId(MuleMessage message)
 32  
     {
 33  0
         return (String) muleContext.getExpressionManager().evaluate(getMessageIdExpression(), message, true);
 34  
     }
 35  
 
 36  
     public String getCorrelationId(MuleMessage message)
 37  
     {
 38  0
         String id = (String) muleContext.getExpressionManager().evaluate(getCorrelationIdExpression(), message, false);
 39  0
         if (id == null)
 40  
         {
 41  0
             id = getMessageId(message);
 42  
         }
 43  0
         return id;
 44  
     }
 45  
 
 46  
     public String getCorrelationIdExpression()
 47  
     {
 48  0
         return correlationIdExpression;
 49  
     }
 50  
 
 51  
     public void setCorrelationIdExpression(String correlationIdExpression)
 52  
     {
 53  0
         this.correlationIdExpression = correlationIdExpression;
 54  0
     }
 55  
 
 56  
     public String getMessageIdExpression()
 57  
     {
 58  0
         return messageIdExpression;
 59  
     }
 60  
 
 61  
     public void setMessageIdExpression(String messageIdExpression)
 62  
     {
 63  0
         this.messageIdExpression = messageIdExpression;
 64  0
     }
 65  
 }