View Javadoc

1   /*
2    * $Id: VmNamespaceHandler.java 22176 2011-06-14 15:36:23Z 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  package org.mule.transport.vm.config;
11  
12  import org.mule.config.spring.factories.QueueProfileFactoryBean;
13  import org.mule.config.spring.handlers.AbstractMuleNamespaceHandler;
14  import org.mule.config.spring.parsers.generic.ChildDefinitionParser;
15  import org.mule.config.spring.parsers.specific.TransactionDefinitionParser;
16  import org.mule.endpoint.URIBuilder;
17  import org.mule.transport.vm.VMConnector;
18  import org.mule.transport.vm.VMTransactionFactory;
19  
20  /**
21   * Reigsters a Bean Definition Parser for handling <code><vm:connector></code> elements.
22   *
23   */
24  public class VmNamespaceHandler extends AbstractMuleNamespaceHandler
25  {
26      @Override
27      public void init()
28      {
29          registerStandardTransportEndpoints(VMConnector.VM, URIBuilder.PATH_ATTRIBUTES);
30          registerConnectorDefinitionParser(VMConnector.class);
31          registerBeanDefinitionParser("queue-profile", new ChildDefinitionParser("queueProfile", QueueProfileFactoryBean.class));
32          registerBeanDefinitionParser("transaction", new TransactionDefinitionParser(VMTransactionFactory.class));
33  
34          // DEPRECATED. Use "queue-profile"
35          registerBeanDefinitionParser("queueProfile", new ChildDefinitionParser("queueProfile", QueueProfileFactoryBean.class));
36      }
37  }