Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2013 the original author or authors.
|
* Copyright 2002-2014 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -19,7 +19,6 @@ package org.springframework.aop.framework;
|
|||||||
import org.aopalliance.intercept.Interceptor;
|
import org.aopalliance.intercept.Interceptor;
|
||||||
|
|
||||||
import org.springframework.aop.TargetSource;
|
import org.springframework.aop.TargetSource;
|
||||||
import org.springframework.util.Assert;
|
|
||||||
import org.springframework.util.ClassUtils;
|
import org.springframework.util.ClassUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,9 +46,8 @@ public class ProxyFactory extends ProxyCreatorSupport {
|
|||||||
* @param target the target object to be proxied
|
* @param target the target object to be proxied
|
||||||
*/
|
*/
|
||||||
public ProxyFactory(Object target) {
|
public ProxyFactory(Object target) {
|
||||||
Assert.notNull(target, "Target object must not be null");
|
|
||||||
setInterfaces(ClassUtils.getAllInterfaces(target));
|
|
||||||
setTarget(target);
|
setTarget(target);
|
||||||
|
setInterfaces(ClassUtils.getAllInterfaces(target));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -91,7 +91,8 @@ public class AsyncAnnotationAdvisor extends AbstractPointcutAdvisor implements B
|
|||||||
}
|
}
|
||||||
if (exceptionHandler != null) {
|
if (exceptionHandler != null) {
|
||||||
this.exceptionHandler = exceptionHandler;
|
this.exceptionHandler = exceptionHandler;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
this.exceptionHandler = new SimpleAsyncUncaughtExceptionHandler();
|
this.exceptionHandler = new SimpleAsyncUncaughtExceptionHandler();
|
||||||
}
|
}
|
||||||
this.advice = buildAdvice(executor, this.exceptionHandler);
|
this.advice = buildAdvice(executor, this.exceptionHandler);
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ public class AsyncAnnotationBeanPostProcessor extends AbstractAdvisingBeanPostPr
|
|||||||
private Class<? extends Annotation> asyncAnnotationType;
|
private Class<? extends Annotation> asyncAnnotationType;
|
||||||
|
|
||||||
private Executor executor;
|
private Executor executor;
|
||||||
|
|
||||||
private AsyncUncaughtExceptionHandler exceptionHandler;
|
private AsyncUncaughtExceptionHandler exceptionHandler;
|
||||||
|
|
||||||
|
|
||||||
@@ -93,6 +94,7 @@ public class AsyncAnnotationBeanPostProcessor extends AbstractAdvisingBeanPostPr
|
|||||||
/**
|
/**
|
||||||
* Set the {@link AsyncUncaughtExceptionHandler} to use to handle uncaught
|
* Set the {@link AsyncUncaughtExceptionHandler} to use to handle uncaught
|
||||||
* exceptions thrown by asynchronous method executions.
|
* exceptions thrown by asynchronous method executions.
|
||||||
|
* @since 4.1
|
||||||
*/
|
*/
|
||||||
public void setExceptionHandler(AsyncUncaughtExceptionHandler exceptionHandler) {
|
public void setExceptionHandler(AsyncUncaughtExceptionHandler exceptionHandler) {
|
||||||
this.exceptionHandler = exceptionHandler;
|
this.exceptionHandler = exceptionHandler;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2014 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -45,7 +45,7 @@ public class FileSystemResource extends AbstractResource implements WritableReso
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new FileSystemResource from a File handle.
|
* Create a new {@code FileSystemResource} from a {@link File} handle.
|
||||||
* <p>Note: When building relative resources via {@link #createRelative},
|
* <p>Note: When building relative resources via {@link #createRelative},
|
||||||
* the relative path will apply <i>at the same directory level</i>:
|
* the relative path will apply <i>at the same directory level</i>:
|
||||||
* e.g. new File("C:/dir1"), relative path "dir2" -> "C:/dir2"!
|
* e.g. new File("C:/dir1"), relative path "dir2" -> "C:/dir2"!
|
||||||
@@ -62,7 +62,7 @@ public class FileSystemResource extends AbstractResource implements WritableReso
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new FileSystemResource from a file path.
|
* Create a new {@code FileSystemResource} from a file path.
|
||||||
* <p>Note: When building relative resources via {@link #createRelative},
|
* <p>Note: When building relative resources via {@link #createRelative},
|
||||||
* it makes a difference whether the specified resource base path here
|
* it makes a difference whether the specified resource base path here
|
||||||
* ends with a slash or not. In the case of "C:/dir1/", relative paths
|
* ends with a slash or not. In the case of "C:/dir1/", relative paths
|
||||||
@@ -77,6 +77,7 @@ public class FileSystemResource extends AbstractResource implements WritableReso
|
|||||||
this.path = StringUtils.cleanPath(path);
|
this.path = StringUtils.cleanPath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the file path for this resource.
|
* Return the file path for this resource.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user