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