View Javadoc

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