View Javadoc
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.module.ibeans.config;
8   
9   import org.mule.config.spring.handlers.AbstractMuleNamespaceHandler;
10  import org.mule.endpoint.URIBuilder;
11  import org.mule.transport.ibean.IBeansConnector;
12  
13  /**
14   * Registers a Bean Definition Parser for handling <code><ibeans:connector></code> elements
15   * and supporting endpoint elements.
16   */
17  public class IBeansNamespaceHandler extends AbstractMuleNamespaceHandler
18  {
19      public void init()
20      {
21          /* This creates handlers for 'endpoint', 'outbound-endpoint' and 'inbound-endpoint' elements.
22             The defaults are sufficient unless you have endpoint styles different from the Mule standard ones
23             The URIBuilder as constants for common required attributes, but you can also pass in a user-defined String[].
24           */
25          registerStandardTransportEndpoints(IBeansConnector.PROTOCOL, URIBuilder.PATH_ATTRIBUTES);
26  
27          /* This will create the handler for your custom 'connector' element.  You will need to add handlers for any other
28             xml elements you define.  For more information see:
29             http://www.mulesoft.org/documentation/display/MULE3USER/Creating+a+Custom+XML+Namespace
30          */
31          registerConnectorDefinitionParser(IBeansConnector.class);
32      }
33  }