View Javadoc

1   /*
2    * $Id: JnpNamespaceHandler.java 10494 2008-01-23 21:09:56Z acooke $
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  package org.mule.transport.jnp.config;
11  
12  import org.mule.config.spring.factories.InboundEndpointFactoryBean;
13  import org.mule.config.spring.factories.OutboundEndpointFactoryBean;
14  import org.mule.config.spring.handlers.AbstractMuleNamespaceHandler;
15  import org.mule.config.spring.parsers.specific.endpoint.TransportEndpointDefinitionParser;
16  import org.mule.config.spring.parsers.specific.endpoint.TransportGlobalEndpointDefinitionParser;
17  import org.mule.endpoint.URIBuilder;
18  import org.mule.transport.jnp.JnpConnector;
19  import org.mule.transport.rmi.config.RmiNamespaceHandler;
20  
21  /**
22   * Registers a Bean Definition Parser for handling <code>&lt;jnp:connector&gt;</code> elements.
23   *
24   */
25  public class JnpNamespaceHandler extends AbstractMuleNamespaceHandler
26  {
27  
28      public void init()
29      {
30          registerMuleBeanDefinitionParser("endpoint", new TransportGlobalEndpointDefinitionParser(JnpConnector.JNP, TransportGlobalEndpointDefinitionParser.PROTOCOL, RmiNamespaceHandler.ADDRESS, RmiNamespaceHandler.PROPERTIES)).addAlias(RmiNamespaceHandler.OBJECT, URIBuilder.PATH);
31          registerMuleBeanDefinitionParser("inbound-endpoint", new TransportEndpointDefinitionParser(JnpConnector.JNP, TransportGlobalEndpointDefinitionParser.PROTOCOL, InboundEndpointFactoryBean.class, RmiNamespaceHandler.ADDRESS, RmiNamespaceHandler.PROPERTIES)).addAlias(RmiNamespaceHandler.OBJECT, URIBuilder.PATH);
32          registerMuleBeanDefinitionParser("outbound-endpoint", new TransportEndpointDefinitionParser(JnpConnector.JNP, TransportGlobalEndpointDefinitionParser.PROTOCOL, OutboundEndpointFactoryBean.class, RmiNamespaceHandler.ADDRESS, RmiNamespaceHandler.PROPERTIES)).addAlias(RmiNamespaceHandler.OBJECT, URIBuilder.PATH);
33          registerConnectorDefinitionParser(JnpConnector.class);
34      }
35  
36  }