View Javadoc

1   /*
2    * $Id: JerseyNamespaceHandler.java 21492 2011-03-08 04:25:31Z 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  
11  package org.mule.module.jersey.config;
12  
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.ComponentDefinitionParser;
16  import org.mule.module.jersey.JerseyResourcesComponent;
17  
18  public class JerseyNamespaceHandler extends AbstractMuleNamespaceHandler
19  {
20      public void init()
21      {
22          ChildDefinitionParser exceptionMapperParser = new ChildDefinitionParser("exceptionMapper",
23              null, null, true);
24          registerBeanDefinitionParser("exception-mapper", exceptionMapperParser);
25  
26          ComponentDefinitionParser parser = new ComponentDefinitionParser(JerseyResourcesComponent.class);
27          registerBeanDefinitionParser("resources", parser);
28      }
29  }