Coverage Report - org.mule.config.spring.parsers.specific.InterceptorStackDefinitionParser
 
Classes in this File Line Coverage Branch Coverage Complexity
InterceptorStackDefinitionParser
0%
0/6
N/A
1
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.config.spring.parsers.specific;
 8  
 
 9  
 import org.mule.config.spring.parsers.AbstractMuleBeanDefinitionParser;
 10  
 import org.mule.config.spring.parsers.MuleDefinitionParser;
 11  
 import org.mule.config.spring.parsers.delegate.ParentContextDefinitionParser;
 12  
 import org.mule.config.spring.parsers.generic.MuleOrphanDefinitionParser;
 13  
 import org.mule.config.spring.parsers.generic.ParentDefinitionParser;
 14  
 import org.mule.interceptor.InterceptorStack;
 15  
 
 16  
 /**
 17  
  * This allows a interceptor-stack to be defined globally, or configured on a
 18  
  * service.
 19  
  */
 20  
 public class InterceptorStackDefinitionParser extends ParentContextDefinitionParser
 21  
 {
 22  
     public static final String INTERCEPTOR_STACK = "interceptor";
 23  
     public static final String ATTRIBUTE_NAME = AbstractMuleBeanDefinitionParser.ATTRIBUTE_NAME;
 24  
 
 25  
     /**
 26  
      * For custom transformers
 27  
      */
 28  
     public InterceptorStackDefinitionParser()
 29  
     {
 30  
         // Interceptor stacks get next message processor etc. set in their chains and thus
 31  
         // cannot be singletons
 32  0
         super(MuleOrphanDefinitionParser.ROOT_ELEMENT, 
 33  
             new MuleOrphanDefinitionParser(InterceptorStack.class, false));
 34  0
         otherwise(addAlias(new ParentDefinitionParser(), AbstractMuleBeanDefinitionParser.ATTRIBUTE_REF,
 35  
             INTERCEPTOR_STACK));
 36  0
         super.addIgnored(ATTRIBUTE_NAME);
 37  0
     }
 38  
 
 39  
     private static MuleDefinitionParser addAlias(MuleDefinitionParser parser, String alias, String name)
 40  
     {
 41  0
         parser.addAlias(alias, name);
 42  0
         return parser;
 43  
     }
 44  
 }