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