View Javadoc

1   /*
2    * $Id: HttpProxyDefinitionParser.java 21749 2011-04-29 15:20:47Z dirk.olmes $
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  
11  package org.mule.transport.http.config.spring.parsers.specific;
12  
13  import org.mule.config.spring.parsers.processors.CheckExclusiveAttributes;
14  import org.mule.config.spring.parsers.processors.CheckExclusiveAttributesAndChildren;
15  import org.mule.config.spring.parsers.specific.AbstractFlowConstructDefinitionParser;
16  import org.mule.transport.http.config.spring.factories.HttpProxyFactoryBean;
17  import org.w3c.dom.Element;
18  
19  public class HttpProxyDefinitionParser extends AbstractFlowConstructDefinitionParser
20  {
21      public HttpProxyDefinitionParser()
22      {
23          super.registerPreProcessor(new CheckExclusiveAttributes(new String[][]{
24              new String[]{INBOUND_ADDRESS_ATTRIBUTE}, new String[]{INBOUND_ENDPOINT_REF_ATTRIBUTE}}));
25  
26          super.registerPreProcessor(new CheckExclusiveAttributes(new String[][]{
27              new String[]{OUTBOUND_ADDRESS_ATTRIBUTE}, new String[]{OUTBOUND_ENDPOINT_REF_ATTRIBUTE}}));
28  
29          super.registerPreProcessor(new CheckExclusiveAttributesAndChildren(new String[]{
30              INBOUND_ENDPOINT_REF_ATTRIBUTE, INBOUND_ADDRESS_ATTRIBUTE}, new String[]{INBOUND_ENDPOINT_CHILD}));
31  
32          super.registerPreProcessor(new CheckExclusiveAttributesAndChildren(new String[]{
33              OUTBOUND_ENDPOINT_REF_ATTRIBUTE, OUTBOUND_ADDRESS_ATTRIBUTE, TRANSFORMER_REFS_ATTRIBUTE,
34              RESPONSE_TRANSFORMER_REFS_ATTRIBUTE}, new String[]{OUTBOUND_ENDPOINT_CHILD}));
35      }
36  
37      @Override
38      protected Class<?> getBeanClass(final Element element)
39      {
40          return HttpProxyFactoryBean.class;
41      }
42  }