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 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
public class LegacyEntryPointResolverSet extends DefaultEntryPointResolverSet |
24 | |
{ |
25 | |
private static final String ANNOTATED_ENTRYPOINT_RESOLVER_CLASS = "org.mule.impl.model.resolvers.AnnotatedEntryPointResolver"; |
26 | |
|
27 | |
public LegacyEntryPointResolverSet() |
28 | 0 | { |
29 | 0 | addAnnotatedEntryPointResolver(); |
30 | 0 | addEntryPointResolver(new MethodHeaderPropertyEntryPointResolver()); |
31 | 0 | addEntryPointResolver(new CallableEntryPointResolver()); |
32 | |
|
33 | 0 | ReflectionEntryPointResolver reflectionResolver = new ReflectionEntryPointResolver(); |
34 | |
|
35 | 0 | reflectionResolver.removeIgnoredMethod("set*"); |
36 | 0 | addEntryPointResolver(reflectionResolver); |
37 | 0 | } |
38 | |
|
39 | |
protected void addAnnotatedEntryPointResolver() |
40 | |
{ |
41 | |
|
42 | |
|
43 | |
|
44 | |
try |
45 | |
{ |
46 | 0 | Class<? extends EntryPointResolver> annotatedEntrypointResolver = |
47 | |
ClassUtils.loadClass(ANNOTATED_ENTRYPOINT_RESOLVER_CLASS, getClass(), EntryPointResolver.class); |
48 | 0 | addEntryPointResolver(ClassUtils.instanciateClass(annotatedEntrypointResolver, ClassUtils.NO_ARGS)); |
49 | |
} |
50 | 0 | catch (ClassNotFoundException e) |
51 | |
{ |
52 | 0 | if(logger.isDebugEnabled()) |
53 | |
{ |
54 | 0 | logger.warn("Mule annotations module is not on your classpath, annotations cannot be used on components"); |
55 | |
} |
56 | |
} |
57 | 0 | catch (Exception e) |
58 | |
{ |
59 | 0 | throw new MuleRuntimeException(CoreMessages.cannotLoadFromClasspath(ANNOTATED_ENTRYPOINT_RESOLVER_CLASS)); |
60 | 0 | } |
61 | 0 | } |
62 | |
} |