1
2
3
4
5
6
7
8
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
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 }