mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-21 21:39:05 +00:00
consistent loading of optional classes
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1926 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
+3
-4
@@ -140,16 +140,15 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean
|
||||
private static Class<? extends Annotation> ejbRefClass = null;
|
||||
|
||||
static {
|
||||
ClassLoader cl = CommonAnnotationBeanPostProcessor.class.getClassLoader();
|
||||
try {
|
||||
webServiceRefClass = ClassUtils.forName("javax.xml.ws.WebServiceRef",
|
||||
CommonAnnotationBeanPostProcessor.class.getClassLoader());
|
||||
webServiceRefClass = (Class) cl.loadClass("javax.xml.ws.WebServiceRef");
|
||||
}
|
||||
catch (ClassNotFoundException ex) {
|
||||
webServiceRefClass = null;
|
||||
}
|
||||
try {
|
||||
ejbRefClass = ClassUtils.forName("javax.ejb.EJB",
|
||||
CommonAnnotationBeanPostProcessor.class.getClassLoader());
|
||||
ejbRefClass = (Class) cl.loadClass("javax.ejb.EJB");
|
||||
}
|
||||
catch (ClassNotFoundException ex) {
|
||||
ejbRefClass = null;
|
||||
|
||||
+2
-3
@@ -32,7 +32,6 @@ import org.springframework.aop.support.annotation.AnnotationMatchingPointcut;
|
||||
import org.springframework.core.task.AsyncTaskExecutor;
|
||||
import org.springframework.core.task.SimpleAsyncTaskExecutor;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
* Advisor that activates asynchronous method execution through the {@link Async}
|
||||
@@ -73,9 +72,9 @@ public class AsyncAnnotationAdvisor extends AbstractPointcutAdvisor {
|
||||
public AsyncAnnotationAdvisor(Executor executor) {
|
||||
Set<Class<? extends Annotation>> asyncAnnotationTypes = new LinkedHashSet<Class<? extends Annotation>>(2);
|
||||
asyncAnnotationTypes.add(Async.class);
|
||||
ClassLoader cl = AsyncAnnotationAdvisor.class.getClassLoader();
|
||||
try {
|
||||
asyncAnnotationTypes.add(ClassUtils.forName(
|
||||
"javax.ejb.Asynchronous", AsyncAnnotationAdvisor.class.getClassLoader()));
|
||||
asyncAnnotationTypes.add((Class) cl.loadClass("javax.ejb.Asynchronous"));
|
||||
}
|
||||
catch (ClassNotFoundException ex) {
|
||||
// If EJB 3.1 API not present, simply ignore.
|
||||
|
||||
Reference in New Issue
Block a user