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.config.spring.processors;
8   
9   import org.mule.api.MuleContext;
10  import org.mule.api.context.MuleContextAware;
11  import org.mule.api.service.Service;
12  import org.mule.config.processors.DecoratingAnnotatedServiceProcessor;
13  
14  import org.springframework.beans.BeansException;
15  import org.springframework.beans.factory.config.BeanPostProcessor;
16  
17  /**
18   * TODO
19   */
20  public class DecoratingFlowAnnotationsBeanProcessor implements BeanPostProcessor, MuleContextAware
21  {
22      private DecoratingAnnotatedServiceProcessor processor;
23  
24      public void setMuleContext(MuleContext muleContext)
25      {
26          processor = new DecoratingAnnotatedServiceProcessor(muleContext);
27      }
28  
29      public Object postProcessBeforeInitialization(java.lang.Object o, java.lang.String s) throws BeansException
30      {
31          if(o instanceof Service)
32          {
33              return processor.process(o);
34          }
35          return o;
36      }
37  
38  
39      public Object postProcessAfterInitialization(java.lang.Object o, java.lang.String s) throws BeansException
40      {
41          return o;
42      }
43  }