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.transport.jms.config;
8   
9   import org.mule.config.spring.parsers.delegate.AbstractFirstResultSerialDefinitionParser;
10  import org.mule.config.spring.parsers.generic.ParentDefinitionParser;
11  import org.mule.config.spring.parsers.specific.ObjectFactoryWrapper;
12  
13  /**
14   * We want to set the connection factory as a pojo factory and then add attributes (username and
15   * password) on the parent
16   */
17  public class ConnectionFactoryDefinitionParser extends AbstractFirstResultSerialDefinitionParser
18  {
19      public static final String USERNAME = "username";
20      public static final String PASSWORD = "password";
21  
22      public ConnectionFactoryDefinitionParser()
23      {
24          addDelegate(new ObjectFactoryWrapper("connectionFactory")).addIgnored(USERNAME).addIgnored(PASSWORD);
25          addDelegate(new ParentDefinitionParser()).setIgnoredDefault(true).removeIgnored(USERNAME).removeIgnored(PASSWORD);
26      }
27  }