View Javadoc

1   /*
2    * $Id: TransformerAnnotatedBeanProcessor.java 20321 2010-11-24 15:21:24Z dfeist $
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.config.spring.processors;
11  
12  import org.mule.api.MuleContext;
13  import org.mule.api.context.MuleContextAware;
14  import org.mule.config.transformer.AnnotatedTransformerObjectProcessor;
15  
16  import org.springframework.beans.BeansException;
17  import org.springframework.beans.factory.config.BeanPostProcessor;
18  
19  /**
20   * TODO
21   */
22  public class TransformerAnnotatedBeanProcessor implements BeanPostProcessor, MuleContextAware
23  {
24      private AnnotatedTransformerObjectProcessor processor;
25  
26      public void setMuleContext(MuleContext muleContext)
27      {
28          processor = new AnnotatedTransformerObjectProcessor(muleContext);
29      }
30  
31      public Object postProcessBeforeInitialization(Object o, String s) throws BeansException
32      {
33          return processor.process(o);
34      }
35  
36  
37      public Object postProcessAfterInitialization(Object o, String s) throws BeansException
38      {
39          return o;
40      }
41  }