1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
package org.mule.model.resolvers; |
11 | |
|
12 | |
import org.mule.api.MuleRuntimeException; |
13 | |
import org.mule.api.model.EntryPointResolver; |
14 | |
import org.mule.config.i18n.CoreMessages; |
15 | |
import org.mule.util.ClassUtils; |
16 | |
|
17 | |
import org.apache.commons.logging.Log; |
18 | |
import org.apache.commons.logging.LogFactory; |
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
public class LegacyEntryPointResolverSet extends DefaultEntryPointResolverSet |
27 | |
{ |
28 | |
private static final String ANNOTATED_ENTRYPOINT_RESOLVER_CLASS = "org.mule.impl.model.resolvers.AnnotatedEntryPointResolver"; |
29 | 0 | private static final Log logger = LogFactory.getLog(LegacyEntryPointResolverSet.class); |
30 | |
|
31 | |
public LegacyEntryPointResolverSet() |
32 | 0 | { |
33 | 0 | addAnnotatedEntryPointResolver(); |
34 | 0 | addEntryPointResolver(new MethodHeaderPropertyEntryPointResolver()); |
35 | 0 | addEntryPointResolver(new CallableEntryPointResolver()); |
36 | |
|
37 | 0 | ReflectionEntryPointResolver reflectionResolver = new ReflectionEntryPointResolver(); |
38 | |
|
39 | 0 | reflectionResolver.removeIgnoredMethod("set*"); |
40 | 0 | addEntryPointResolver(reflectionResolver); |
41 | 0 | } |
42 | |
|
43 | |
protected void addAnnotatedEntryPointResolver() |
44 | |
{ |
45 | |
|
46 | |
|
47 | |
|
48 | |
try |
49 | |
{ |
50 | 0 | Class<? extends EntryPointResolver> annotatedEntrypointResolver = |
51 | |
ClassUtils.loadClass(ANNOTATED_ENTRYPOINT_RESOLVER_CLASS, getClass(), EntryPointResolver.class); |
52 | 0 | addEntryPointResolver(ClassUtils.instanciateClass(annotatedEntrypointResolver, ClassUtils.NO_ARGS)); |
53 | |
} |
54 | 0 | catch (ClassNotFoundException e) |
55 | |
{ |
56 | 0 | if(logger.isDebugEnabled()) |
57 | |
{ |
58 | 0 | logger.warn("Mule annotations module is not on your classpath, annotations cannot be used on components"); |
59 | |
} |
60 | |
} |
61 | 0 | catch (Exception e) |
62 | |
{ |
63 | 0 | throw new MuleRuntimeException(CoreMessages.cannotLoadFromClasspath(ANNOTATED_ENTRYPOINT_RESOLVER_CLASS)); |
64 | 0 | } |
65 | 0 | } |
66 | |
} |