View Javadoc

1   /*
2    * $Id: PgpNamespaceHandler.java 10789 2008-02-12 20:04:43Z dfeist $
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  
11  package org.mule.module.pgp.config;
12  
13  import org.mule.api.config.MuleProperties;
14  import org.mule.config.spring.parsers.generic.ChildDefinitionParser;
15  import org.mule.config.spring.parsers.generic.NamedDefinitionParser;
16  import org.mule.config.spring.parsers.generic.ParentDefinitionParser;
17  import org.mule.module.pgp.KeyBasedEncryptionStrategy;
18  import org.mule.module.pgp.PGPSecurityProvider;
19  import org.mule.module.pgp.filters.PGPSecurityFilter;
20  
21  import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
22  
23  public class PgpNamespaceHandler extends NamespaceHandlerSupport
24  {
25      public void init()
26      {
27          registerBeanDefinitionParser("security-manager", new NamedDefinitionParser(MuleProperties.OBJECT_SECURITY_MANAGER));
28          registerBeanDefinitionParser("security-provider", new ChildDefinitionParser("provider", PGPSecurityProvider.class));
29          registerBeanDefinitionParser("security-filters", new ParentDefinitionParser());
30          registerBeanDefinitionParser("security-filter", new ChildDefinitionParser("securityFilter", PGPSecurityFilter.class));
31          registerBeanDefinitionParser("keybased-encryption-strategy", new ChildDefinitionParser("encryptionStrategy", KeyBasedEncryptionStrategy.class));
32      }
33  
34  }