Coverage Report - org.mule.providers.soap.xfire.MuleHeadersInHandler
 
Classes in this File Line Coverage Branch Coverage Complexity
MuleHeadersInHandler
0%
0/21
0%
0/7
9
 
 1  
 /*
 2  
  * $Id: MuleHeadersInHandler.java 7976 2007-08-21 14:26:13Z dirk.olmes $
 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  
 
 11  
 package org.mule.providers.soap.xfire;
 12  
 
 13  
 import org.mule.config.MuleProperties;
 14  
 import org.mule.providers.soap.MuleSoapHeaders;
 15  
 
 16  
 import org.codehaus.xfire.MessageContext;
 17  
 import org.codehaus.xfire.handler.AbstractHandler;
 18  
 import org.jdom.Element;
 19  
 import org.jdom.Namespace;
 20  
 
 21  
 /**
 22  
  * Reads the Mule Soap Header and sets the various header properties on the context.
 23  
  */
 24  0
 public class MuleHeadersInHandler extends AbstractHandler
 25  
 {
 26  0
     protected final Namespace ns = Namespace.getNamespace(MuleSoapHeaders.MULE_NAMESPACE,
 27  
         MuleSoapHeaders.MULE_10_ACTOR);
 28  
 
 29  
     /**
 30  
      * Invoke a handler. If a fault occurs it will be handled via the
 31  
      * <code>handleFault</code> method.
 32  
      * 
 33  
      * @param context The message context.
 34  
      */
 35  
     public void invoke(MessageContext context) throws Exception
 36  
     {
 37  0
         if (context.getInMessage() != null)
 38  
         {
 39  0
             Element header = context.getInMessage().getHeader();
 40  0
             if (header == null)
 41  
             {
 42  0
                 return;
 43  
             }
 44  
 
 45  0
             Element muleHeaders = header.getChild(MuleSoapHeaders.MULE_HEADER, ns);
 46  0
             if (muleHeaders != null)
 47  
             {
 48  0
                 Element child = muleHeaders.getChild(MuleProperties.MULE_CORRELATION_ID_PROPERTY, ns);
 49  0
                 if (child != null)
 50  
                 {
 51  0
                     context.setProperty(MuleProperties.MULE_CORRELATION_ID_PROPERTY, child.getText());
 52  
                 }
 53  0
                 child = muleHeaders.getChild(MuleProperties.MULE_CORRELATION_GROUP_SIZE_PROPERTY, ns);
 54  0
                 if (child != null)
 55  
                 {
 56  0
                     context.setProperty(MuleProperties.MULE_CORRELATION_GROUP_SIZE_PROPERTY, child.getText());
 57  
                 }
 58  0
                 child = muleHeaders.getChild(MuleProperties.MULE_CORRELATION_SEQUENCE_PROPERTY, ns);
 59  0
                 if (child != null)
 60  
                 {
 61  0
                     context.setProperty(MuleProperties.MULE_CORRELATION_SEQUENCE_PROPERTY, child.getText());
 62  
                 }
 63  0
                 child = muleHeaders.getChild(MuleProperties.MULE_REPLY_TO_PROPERTY, ns);
 64  0
                 if (child != null)
 65  
                 {
 66  0
                     context.setProperty(MuleProperties.MULE_REPLY_TO_PROPERTY, child.getText());
 67  
                 }
 68  
             }
 69  
         }
 70  0
     }
 71  
 
 72  
 }