Replace <code> with {@code} throughout Javadoc
Issue: SPR-10128
This commit is contained in:
parent
8597ec25ec
commit
9540d2c81b
|
@ -50,7 +50,7 @@ public interface Advisor {
|
|||
* (for example, creating a mixin) or shared with all instances of
|
||||
* the advised class obtained from the same Spring bean factory.
|
||||
* <p><b>Note that this method is not currently used by the framework.</b>
|
||||
* Typical Advisor implementations always return <code>true</code>.
|
||||
* Typical Advisor implementations always return {@code true}.
|
||||
* Use singleton/prototype bean definitions or appropriate programmatic
|
||||
* proxy creation to ensure that Advisors have the correct lifecycle model.
|
||||
* @return whether this advice is associated with a particular target instance
|
||||
|
|
|
@ -33,7 +33,7 @@ public interface AfterReturningAdvice extends AfterAdvice {
|
|||
* @param returnValue the value returned by the method, if any
|
||||
* @param method method being invoked
|
||||
* @param args arguments to the method
|
||||
* @param target target of the method invocation. May be <code>null</code>.
|
||||
* @param target target of the method invocation. May be {@code null}.
|
||||
* @throws Throwable if this object wishes to abort the call.
|
||||
* Any exception thrown will be returned to the caller if it's
|
||||
* allowed by the method signature. Otherwise the exception
|
||||
|
|
|
@ -33,10 +33,10 @@ public interface IntroductionAwareMethodMatcher extends MethodMatcher {
|
|||
* instead of the 2-arg {@link #matches(java.lang.reflect.Method, Class)} method
|
||||
* if the caller supports the extended IntroductionAwareMethodMatcher interface.
|
||||
* @param method the candidate method
|
||||
* @param targetClass the target class (may be <code>null</code>, in which case
|
||||
* @param targetClass the target class (may be {@code null}, in which case
|
||||
* the candidate class must be taken to be the method's declaring class)
|
||||
* @param hasIntroductions <code>true</code> if the object on whose behalf we are
|
||||
* asking is the subject on one or more introductions; <code>false</code> otherwise
|
||||
* @param hasIntroductions {@code true} if the object on whose behalf we are
|
||||
* asking is the subject on one or more introductions; {@code false} otherwise
|
||||
* @return whether or not this method matches statically
|
||||
*/
|
||||
boolean matches(Method method, Class targetClass, boolean hasIntroductions);
|
||||
|
|
|
@ -33,7 +33,7 @@ public interface MethodBeforeAdvice extends BeforeAdvice {
|
|||
* Callback before a given method is invoked.
|
||||
* @param method method being invoked
|
||||
* @param args arguments to the method
|
||||
* @param target target of the method invocation. May be <code>null</code>.
|
||||
* @param target target of the method invocation. May be {@code null}.
|
||||
* @throws Throwable if this object wishes to abort the call.
|
||||
* Any exception thrown will be returned to the caller if it's
|
||||
* allowed by the method signature. Otherwise the exception
|
||||
|
|
|
@ -26,15 +26,15 @@ import java.lang.reflect.Method;
|
|||
* also makes arguments for a particular call available, and any effects of running
|
||||
* previous advice applying to the joinpoint.
|
||||
*
|
||||
* <p>If an implementation returns <code>false</code> from its {@link #isRuntime()}
|
||||
* <p>If an implementation returns {@code false} from its {@link #isRuntime()}
|
||||
* method, evaluation can be performed statically, and the result will be the same
|
||||
* for all invocations of this method, whatever their arguments. This means that
|
||||
* if the {@link #isRuntime()} method returns <code>false</code>, the 3-arg
|
||||
* if the {@link #isRuntime()} method returns {@code false}, the 3-arg
|
||||
* {@link #matches(java.lang.reflect.Method, Class, Object[])} method will never be invoked.
|
||||
*
|
||||
* <p>If an implementation returns <code>true</code> from its 2-arg
|
||||
* <p>If an implementation returns {@code true} from its 2-arg
|
||||
* {@link #matches(java.lang.reflect.Method, Class)} method and its {@link #isRuntime()} method
|
||||
* returns <code>true</code>, the 3-arg {@link #matches(java.lang.reflect.Method, Class, Object[])}
|
||||
* returns {@code true}, the 3-arg {@link #matches(java.lang.reflect.Method, Class, Object[])}
|
||||
* method will be invoked <i>immediately before each potential execution of the related advice</i>,
|
||||
* to decide whether the advice should run. All previous advice, such as earlier interceptors
|
||||
* in an interceptor chain, will have run, so any state changes they have produced in
|
||||
|
@ -49,11 +49,11 @@ public interface MethodMatcher {
|
|||
|
||||
/**
|
||||
* Perform static checking whether the given method matches. If this
|
||||
* returns <code>false</code> or if the {@link #isRuntime()} method
|
||||
* returns <code>false</code>, no runtime check (i.e. no.
|
||||
* returns {@code false} or if the {@link #isRuntime()} method
|
||||
* returns {@code false}, no runtime check (i.e. no.
|
||||
* {@link #matches(java.lang.reflect.Method, Class, Object[])} call) will be made.
|
||||
* @param method the candidate method
|
||||
* @param targetClass the target class (may be <code>null</code>, in which case
|
||||
* @param targetClass the target class (may be {@code null}, in which case
|
||||
* the candidate class must be taken to be the method's declaring class)
|
||||
* @return whether or not this method matches statically
|
||||
*/
|
||||
|
@ -62,7 +62,7 @@ public interface MethodMatcher {
|
|||
/**
|
||||
* Is this MethodMatcher dynamic, that is, must a final call be made on the
|
||||
* {@link #matches(java.lang.reflect.Method, Class, Object[])} method at
|
||||
* runtime even if the 2-arg matches method returns <code>true</code>?
|
||||
* runtime even if the 2-arg matches method returns {@code true}?
|
||||
* <p>Can be invoked when an AOP proxy is created, and need not be invoked
|
||||
* again before each method invocation,
|
||||
* @return whether or not a runtime match via the 3-arg
|
||||
|
@ -75,12 +75,12 @@ public interface MethodMatcher {
|
|||
* Check whether there a runtime (dynamic) match for this method,
|
||||
* which must have matched statically.
|
||||
* <p>This method is invoked only if the 2-arg matches method returns
|
||||
* <code>true</code> for the given method and target class, and if the
|
||||
* {@link #isRuntime()} method returns <code>true</code>. Invoked
|
||||
* {@code true} for the given method and target class, and if the
|
||||
* {@link #isRuntime()} method returns {@code true}. Invoked
|
||||
* immediately before potential running of the advice, after any
|
||||
* advice earlier in the advice chain has run.
|
||||
* @param method the candidate method
|
||||
* @param targetClass the target class (may be <code>null</code>, in which case
|
||||
* @param targetClass the target class (may be {@code null}, in which case
|
||||
* the candidate class must be taken to be the method's declaring class)
|
||||
* @param args arguments to the method
|
||||
* @return whether there's a runtime match
|
||||
|
|
|
@ -34,13 +34,13 @@ public interface Pointcut {
|
|||
|
||||
/**
|
||||
* Return the ClassFilter for this pointcut.
|
||||
* @return the ClassFilter (never <code>null</code>)
|
||||
* @return the ClassFilter (never {@code null})
|
||||
*/
|
||||
ClassFilter getClassFilter();
|
||||
|
||||
/**
|
||||
* Return the MethodMatcher for this pointcut.
|
||||
* @return the MethodMatcher (never <code>null</code>)
|
||||
* @return the MethodMatcher (never {@code null})
|
||||
*/
|
||||
MethodMatcher getMethodMatcher();
|
||||
|
||||
|
|
|
@ -40,22 +40,22 @@ public interface ProxyMethodInvocation extends MethodInvocation {
|
|||
Object getProxy();
|
||||
|
||||
/**
|
||||
* Create a clone of this object. If cloning is done before <code>proceed()</code>
|
||||
* is invoked on this object, <code>proceed()</code> can be invoked once per clone
|
||||
* Create a clone of this object. If cloning is done before {@code proceed()}
|
||||
* is invoked on this object, {@code proceed()} can be invoked once per clone
|
||||
* to invoke the joinpoint (and the rest of the advice chain) more than once.
|
||||
* @return an invocable clone of this invocation.
|
||||
* <code>proceed()</code> can be called once per clone.
|
||||
* {@code proceed()} can be called once per clone.
|
||||
*/
|
||||
MethodInvocation invocableClone();
|
||||
|
||||
/**
|
||||
* Create a clone of this object. If cloning is done before <code>proceed()</code>
|
||||
* is invoked on this object, <code>proceed()</code> can be invoked once per clone
|
||||
* Create a clone of this object. If cloning is done before {@code proceed()}
|
||||
* is invoked on this object, {@code proceed()} can be invoked once per clone
|
||||
* to invoke the joinpoint (and the rest of the advice chain) more than once.
|
||||
* @param arguments the arguments that the cloned invocation is supposed to use,
|
||||
* overriding the original arguments
|
||||
* @return an invocable clone of this invocation.
|
||||
* <code>proceed()</code> can be called once per clone.
|
||||
* {@code proceed()} can be called once per clone.
|
||||
*/
|
||||
MethodInvocation invocableClone(Object[] arguments);
|
||||
|
||||
|
@ -71,14 +71,14 @@ public interface ProxyMethodInvocation extends MethodInvocation {
|
|||
* <p>Such attributes are not used within the AOP framework itself. They are
|
||||
* just kept as part of the invocation object, for use in special interceptors.
|
||||
* @param key the name of the attribute
|
||||
* @param value the value of the attribute, or <code>null</code> to reset it
|
||||
* @param value the value of the attribute, or {@code null} to reset it
|
||||
*/
|
||||
void setUserAttribute(String key, Object value);
|
||||
|
||||
/**
|
||||
* Return the value of the specified user attribute.
|
||||
* @param key the name of the attribute
|
||||
* @return the value of the attribute, or <code>null</code> if not set
|
||||
* @return the value of the attribute, or {@code null} if not set
|
||||
* @see #setUserAttribute
|
||||
*/
|
||||
Object getUserAttribute(String key);
|
||||
|
|
|
@ -32,7 +32,7 @@ public interface TargetClassAware {
|
|||
/**
|
||||
* Return the target class behind the implementing object
|
||||
* (typically a proxy configuration or an actual proxy).
|
||||
* @return the target Class, or <code>null</code> if not known
|
||||
* @return the target Class, or {@code null} if not known
|
||||
*/
|
||||
Class<?> getTargetClass();
|
||||
|
||||
|
|
|
@ -17,16 +17,16 @@
|
|||
package org.springframework.aop;
|
||||
|
||||
/**
|
||||
* A <code>TargetSource</code> is used to obtain the current "target" of
|
||||
* A {@code TargetSource} is used to obtain the current "target" of
|
||||
* an AOP invocation, which will be invoked via reflection if no around
|
||||
* advice chooses to end the interceptor chain itself.
|
||||
*
|
||||
* <p>If a <code>TargetSource</code> is "static", it will always return
|
||||
* <p>If a {@code TargetSource} is "static", it will always return
|
||||
* the same target, allowing optimizations in the AOP framework. Dynamic
|
||||
* target sources can support pooling, hot swapping, etc.
|
||||
*
|
||||
* <p>Application developers don't usually need to work with
|
||||
* <code>TargetSources</code> directly: this is an AOP framework interface.
|
||||
* {@code TargetSources} directly: this is an AOP framework interface.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
*/
|
||||
|
@ -34,8 +34,8 @@ public interface TargetSource extends TargetClassAware {
|
|||
|
||||
/**
|
||||
* Return the type of targets returned by this {@link TargetSource}.
|
||||
* <p>Can return <code>null</code>, although certain usages of a
|
||||
* <code>TargetSource</code> might just work with a predetermined
|
||||
* <p>Can return {@code null}, although certain usages of a
|
||||
* {@code TargetSource} might just work with a predetermined
|
||||
* target class.
|
||||
* @return the type of targets returned by this {@link TargetSource}
|
||||
*/
|
||||
|
@ -46,7 +46,7 @@ public interface TargetSource extends TargetClassAware {
|
|||
* <p>In that case, there will be no need to invoke
|
||||
* {@link #releaseTarget(Object)}, and the AOP framework can cache
|
||||
* the return value of {@link #getTarget()}.
|
||||
* @return <code>true</code> if the target is immutable
|
||||
* @return {@code true} if the target is immutable
|
||||
* @see #getTarget
|
||||
*/
|
||||
boolean isStatic();
|
||||
|
|
|
@ -40,7 +40,7 @@ class TrueClassFilter implements ClassFilter, Serializable {
|
|||
/**
|
||||
* Required to support serialization. Replaces with canonical
|
||||
* instance on deserialization, protecting Singleton pattern.
|
||||
* Alternative to overriding <code>equals()</code>.
|
||||
* Alternative to overriding {@code equals()}.
|
||||
*/
|
||||
private Object readResolve() {
|
||||
return INSTANCE;
|
||||
|
|
|
@ -50,7 +50,7 @@ class TrueMethodMatcher implements MethodMatcher, Serializable {
|
|||
/**
|
||||
* Required to support serialization. Replaces with canonical
|
||||
* instance on deserialization, protecting Singleton pattern.
|
||||
* Alternative to overriding <code>equals()</code>.
|
||||
* Alternative to overriding {@code equals()}.
|
||||
*/
|
||||
private Object readResolve() {
|
||||
return INSTANCE;
|
||||
|
|
|
@ -44,7 +44,7 @@ class TruePointcut implements Pointcut, Serializable {
|
|||
/**
|
||||
* Required to support serialization. Replaces with canonical
|
||||
* instance on deserialization, protecting Singleton pattern.
|
||||
* Alternative to overriding <code>equals()</code>.
|
||||
* Alternative to overriding {@code equals()}.
|
||||
*/
|
||||
private Object readResolve() {
|
||||
return INSTANCE;
|
||||
|
|
|
@ -347,8 +347,8 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
|
|||
* on subsequent advice invocations can be as fast as possible.
|
||||
* <p>If the first argument is of type JoinPoint or ProceedingJoinPoint then we
|
||||
* pass a JoinPoint in that position (ProceedingJoinPoint for around advice).
|
||||
* <p>If the first argument is of type <code>JoinPoint.StaticPart</code>
|
||||
* then we pass a <code>JoinPoint.StaticPart</code> in that position.
|
||||
* <p>If the first argument is of type {@code JoinPoint.StaticPart}
|
||||
* then we pass a {@code JoinPoint.StaticPart} in that position.
|
||||
* <p>Remaining arguments have to be bound by pointcut evaluation at
|
||||
* a given join point. We will get back a map from argument name to
|
||||
* value. We need to calculate which advice parameter needs to be bound
|
||||
|
|
|
@ -34,13 +34,13 @@ public interface AspectInstanceFactory extends Ordered {
|
|||
|
||||
/**
|
||||
* Create an instance of this factory's aspect.
|
||||
* @return the aspect instance (never <code>null</code>)
|
||||
* @return the aspect instance (never {@code null})
|
||||
*/
|
||||
Object getAspectInstance();
|
||||
|
||||
/**
|
||||
* Expose the aspect class loader that this factory uses.
|
||||
* @return the aspect class loader (never <code>null</code>)
|
||||
* @return the aspect class loader (never {@code null})
|
||||
*/
|
||||
ClassLoader getAspectClassLoader();
|
||||
|
||||
|
|
|
@ -36,82 +36,82 @@ import org.springframework.util.StringUtils;
|
|||
/**
|
||||
* {@link ParameterNameDiscoverer} implementation that tries to deduce parameter names
|
||||
* for an advice method from the pointcut expression, returning, and throwing clauses.
|
||||
* If an unambiguous interpretation is not available, it returns <code>null</code>.
|
||||
* If an unambiguous interpretation is not available, it returns {@code null}.
|
||||
*
|
||||
* <p>This class interprets arguments in the following way:
|
||||
* <ol>
|
||||
* <li>If the first parameter of the method is of type {@link JoinPoint}
|
||||
* or {@link ProceedingJoinPoint}, it is assumed to be for passing
|
||||
* <code>thisJoinPoint</code> to the advice, and the parameter name will
|
||||
* be assigned the value <code>"thisJoinPoint"</code>.</li>
|
||||
* {@code thisJoinPoint} to the advice, and the parameter name will
|
||||
* be assigned the value {@code "thisJoinPoint"}.</li>
|
||||
* <li>If the first parameter of the method is of type
|
||||
* <code>JoinPoint.StaticPart</code>, it is assumed to be for passing
|
||||
* <code>"thisJoinPointStaticPart"</code> to the advice, and the parameter name
|
||||
* will be assigned the value <code>"thisJoinPointStaticPart"</code>.</li>
|
||||
* {@code JoinPoint.StaticPart}, it is assumed to be for passing
|
||||
* {@code "thisJoinPointStaticPart"} to the advice, and the parameter name
|
||||
* will be assigned the value {@code "thisJoinPointStaticPart"}.</li>
|
||||
* <li>If a {@link #setThrowingName(String) throwingName} has been set, and
|
||||
* there are no unbound arguments of type <code>Throwable+</code>, then an
|
||||
* there are no unbound arguments of type {@code Throwable+}, then an
|
||||
* {@link IllegalArgumentException} is raised. If there is more than one
|
||||
* unbound argument of type <code>Throwable+</code>, then an
|
||||
* unbound argument of type {@code Throwable+}, then an
|
||||
* {@link AmbiguousBindingException} is raised. If there is exactly one
|
||||
* unbound argument of type <code>Throwable+</code>, then the corresponding
|
||||
* unbound argument of type {@code Throwable+}, then the corresponding
|
||||
* parameter name is assigned the value <throwingName>.</li>
|
||||
* <li>If there remain unbound arguments, then the pointcut expression is
|
||||
* examined. Let <code>a</code> be the number of annotation-based pointcut
|
||||
* examined. Let {@code a} be the number of annotation-based pointcut
|
||||
* expressions (@annotation, @this, @target, @args,
|
||||
* @within, @withincode) that are used in binding form. Usage in
|
||||
* binding form has itself to be deduced: if the expression inside the
|
||||
* pointcut is a single string literal that meets Java variable name
|
||||
* conventions it is assumed to be a variable name. If <code>a</code> is
|
||||
* zero we proceed to the next stage. If <code>a</code> > 1 then an
|
||||
* <code>AmbiguousBindingException</code> is raised. If <code>a</code> == 1,
|
||||
* and there are no unbound arguments of type <code>Annotation+</code>,
|
||||
* then an <code>IllegalArgumentException</code> is raised. if there is
|
||||
* conventions it is assumed to be a variable name. If {@code a} is
|
||||
* zero we proceed to the next stage. If {@code a} > 1 then an
|
||||
* {@code AmbiguousBindingException} is raised. If {@code a} == 1,
|
||||
* and there are no unbound arguments of type {@code Annotation+},
|
||||
* then an {@code IllegalArgumentException} is raised. if there is
|
||||
* exactly one such argument, then the corresponding parameter name is
|
||||
* assigned the value from the pointcut expression.</li>
|
||||
* <li>If a returningName has been set, and there are no unbound arguments
|
||||
* then an <code>IllegalArgumentException</code> is raised. If there is
|
||||
* then an {@code IllegalArgumentException} is raised. If there is
|
||||
* more than one unbound argument then an
|
||||
* <code>AmbiguousBindingException</code> is raised. If there is exactly
|
||||
* {@code AmbiguousBindingException} is raised. If there is exactly
|
||||
* one unbound argument then the corresponding parameter name is assigned
|
||||
* the value <returningName>.</li>
|
||||
* <li>If there remain unbound arguments, then the pointcut expression is
|
||||
* examined once more for <code>this</code>, <code>target</code>, and
|
||||
* <code>args</code> pointcut expressions used in the binding form (binding
|
||||
* examined once more for {@code this}, {@code target}, and
|
||||
* {@code args} pointcut expressions used in the binding form (binding
|
||||
* forms are deduced as described for the annotation based pointcuts). If
|
||||
* there remains more than one unbound argument of a primitive type (which
|
||||
* can only be bound in <code>args</code>) then an
|
||||
* <code>AmbiguousBindingException</code> is raised. If there is exactly
|
||||
* one argument of a primitive type, then if exactly one <code>args</code>
|
||||
* can only be bound in {@code args}) then an
|
||||
* {@code AmbiguousBindingException} is raised. If there is exactly
|
||||
* one argument of a primitive type, then if exactly one {@code args}
|
||||
* bound variable was found, we assign the corresponding parameter name
|
||||
* the variable name. If there were no <code>args</code> bound variables
|
||||
* found an <code>IllegalStateException</code> is raised. If there are
|
||||
* multiple <code>args</code> bound variables, an
|
||||
* <code>AmbiguousBindingException</code> is raised. At this point, if
|
||||
* the variable name. If there were no {@code args} bound variables
|
||||
* found an {@code IllegalStateException} is raised. If there are
|
||||
* multiple {@code args} bound variables, an
|
||||
* {@code AmbiguousBindingException} is raised. At this point, if
|
||||
* there remains more than one unbound argument we raise an
|
||||
* <code>AmbiguousBindingException</code>. If there are no unbound arguments
|
||||
* {@code AmbiguousBindingException}. If there are no unbound arguments
|
||||
* remaining, we are done. If there is exactly one unbound argument
|
||||
* remaining, and only one candidate variable name unbound from
|
||||
* <code>this</code>, <code>target</code>, or <code>args</code>, it is
|
||||
* {@code this}, {@code target}, or {@code args}, it is
|
||||
* assigned as the corresponding parameter name. If there are multiple
|
||||
* possibilities, an <code>AmbiguousBindingException</code> is raised.</li>
|
||||
* possibilities, an {@code AmbiguousBindingException} is raised.</li>
|
||||
* </ol>
|
||||
*
|
||||
* <p>The behavior on raising an <code>IllegalArgumentException</code> or
|
||||
* <code>AmbiguousBindingException</code> is configurable to allow this discoverer
|
||||
* <p>The behavior on raising an {@code IllegalArgumentException} or
|
||||
* {@code AmbiguousBindingException} is configurable to allow this discoverer
|
||||
* to be used as part of a chain-of-responsibility. By default the condition will
|
||||
* be logged and the <code>getParameterNames(..)</code> method will simply return
|
||||
* <code>null</code>. If the {@link #setRaiseExceptions(boolean) raiseExceptions}
|
||||
* property is set to <code>true</code>, the conditions will be thrown as
|
||||
* <code>IllegalArgumentException</code> and <code>AmbiguousBindingException</code>,
|
||||
* be logged and the {@code getParameterNames(..)} method will simply return
|
||||
* {@code null}. If the {@link #setRaiseExceptions(boolean) raiseExceptions}
|
||||
* property is set to {@code true}, the conditions will be thrown as
|
||||
* {@code IllegalArgumentException} and {@code AmbiguousBindingException},
|
||||
* respectively.
|
||||
*
|
||||
* <p>Was that perfectly clear? ;)
|
||||
*
|
||||
* <p>Short version: If an unambiguous binding can be deduced, then it is.
|
||||
* If the advice requirements cannot possibly be satisfied, then <code>null</code>
|
||||
* If the advice requirements cannot possibly be satisfied, then {@code null}
|
||||
* is returned. By setting the {@link #setRaiseExceptions(boolean) raiseExceptions}
|
||||
* property to <code>true</code>, descriptive exceptions will be thrown instead of
|
||||
* returning <code>null</code> in the case that the parameter names cannot be discovered.
|
||||
* property to {@code true}, descriptive exceptions will be thrown instead of
|
||||
* returning {@code null} in the case that the parameter names cannot be discovered.
|
||||
*
|
||||
* @author Adrian Colyer
|
||||
* @since 2.0
|
||||
|
@ -191,14 +191,14 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
|
|||
/**
|
||||
* Indicate whether {@link IllegalArgumentException} and {@link AmbiguousBindingException}
|
||||
* must be thrown as appropriate in the case of failing to deduce advice parameter names.
|
||||
* @param raiseExceptions <code>true</code> if exceptions are to be thrown
|
||||
* @param raiseExceptions {@code true} if exceptions are to be thrown
|
||||
*/
|
||||
public void setRaiseExceptions(boolean raiseExceptions) {
|
||||
this.raiseExceptions = raiseExceptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* If <code>afterReturning</code> advice binds the return value, the
|
||||
* If {@code afterReturning} advice binds the return value, the
|
||||
* returning variable name must be specified.
|
||||
* @param returningName the name of the returning variable
|
||||
*/
|
||||
|
@ -207,7 +207,7 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
|
|||
}
|
||||
|
||||
/**
|
||||
* If <code>afterThrowing</code> advice binds the thrown value, the
|
||||
* If {@code afterThrowing} advice binds the thrown value, the
|
||||
* throwing variable name must be specified.
|
||||
* @param throwingName the name of the throwing variable
|
||||
*/
|
||||
|
@ -305,9 +305,9 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
|
|||
|
||||
/**
|
||||
* An advice method can never be a constructor in Spring.
|
||||
* @return <code>null</code>
|
||||
* @return {@code null}
|
||||
* @throws UnsupportedOperationException if
|
||||
* {@link #setRaiseExceptions(boolean) raiseExceptions} has been set to <code>true</code>
|
||||
* {@link #setRaiseExceptions(boolean) raiseExceptions} has been set to {@code true}
|
||||
*/
|
||||
public String[] getParameterNames(Constructor ctor) {
|
||||
if (this.raiseExceptions) {
|
||||
|
@ -493,7 +493,7 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
|
|||
}
|
||||
|
||||
/**
|
||||
* Given an args pointcut body (could be <code>args</code> or <code>at_args</code>),
|
||||
* Given an args pointcut body (could be {@code args} or {@code at_args}),
|
||||
* add any candidate variable names to the given list.
|
||||
*/
|
||||
private void maybeExtractVariableNamesFromArgs(String argsSpec, List<String> varNames) {
|
||||
|
@ -726,7 +726,7 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
|
|||
}
|
||||
|
||||
/*
|
||||
* Return <code>true</code> if the given argument type is a subclass
|
||||
* Return {@code true} if the given argument type is a subclass
|
||||
* of the given supertype.
|
||||
*/
|
||||
private boolean isSubtypeOf(Class supertype, int argumentNumber) {
|
||||
|
@ -755,7 +755,7 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
|
|||
|
||||
/*
|
||||
* Find the argument index with the given type, and bind the given
|
||||
* <code>varName</code> in that position.
|
||||
* {@code varName} in that position.
|
||||
*/
|
||||
private void findAndBind(Class argumentType, String varName) {
|
||||
for (int i = 0; i < this.argumentTypes.length; i++) {
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.springframework.aop.BeforeAdvice;
|
|||
public abstract class AspectJAopUtils {
|
||||
|
||||
/**
|
||||
* Return <code>true</code> if the advisor is a form of before advice.
|
||||
* Return {@code true} if the advisor is a form of before advice.
|
||||
*/
|
||||
public static boolean isBeforeAdvice(Advisor anAdvisor) {
|
||||
AspectJPrecedenceInformation precedenceInfo = getAspectJPrecedenceInformationFor(anAdvisor);
|
||||
|
@ -43,7 +43,7 @@ public abstract class AspectJAopUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return <code>true</code> if the advisor is a form of after advice.
|
||||
* Return {@code true} if the advisor is a form of after advice.
|
||||
*/
|
||||
public static boolean isAfterAdvice(Advisor anAdvisor) {
|
||||
AspectJPrecedenceInformation precedenceInfo = getAspectJPrecedenceInformationFor(anAdvisor);
|
||||
|
@ -56,7 +56,7 @@ public abstract class AspectJAopUtils {
|
|||
/**
|
||||
* Return the AspectJPrecedenceInformation provided by this advisor or its advice.
|
||||
* If neither the advisor nor the advice have precedence information, this method
|
||||
* will return <code>null</code>.
|
||||
* will return {@code null}.
|
||||
*/
|
||||
public static AspectJPrecedenceInformation getAspectJPrecedenceInformationFor(Advisor anAdvisor) {
|
||||
if (anAdvisor instanceof AspectJPrecedenceInformation) {
|
||||
|
|
|
@ -223,9 +223,9 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
|
|||
|
||||
/**
|
||||
* If a pointcut expression has been specified in XML, the user cannot
|
||||
* write <code>and</code> as "&&" (though && will work).
|
||||
* We also allow <code>and</code> between two pointcut sub-expressions.
|
||||
* <p>This method converts back to <code>&&</code> for the AspectJ pointcut parser.
|
||||
* write {@code and} as "&&" (though && will work).
|
||||
* We also allow {@code and} between two pointcut sub-expressions.
|
||||
* <p>This method converts back to {@code &&} for the AspectJ pointcut parser.
|
||||
*/
|
||||
private String replaceBooleanOperators(String pcExpr) {
|
||||
String result = StringUtils.replace(pcExpr, " and ", " && ");
|
||||
|
@ -494,10 +494,10 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
|
|||
|
||||
|
||||
/**
|
||||
* Handler for the Spring-specific <code>bean()</code> pointcut designator
|
||||
* Handler for the Spring-specific {@code bean()} pointcut designator
|
||||
* extension to AspectJ.
|
||||
* <p>This handler must be added to each pointcut object that needs to
|
||||
* handle the <code>bean()</code> PCD. Matching context is obtained
|
||||
* handle the {@code bean()} PCD. Matching context is obtained
|
||||
* automatically by examining a thread local variable and therefore a matching
|
||||
* context need not be set on the pointcut.
|
||||
*/
|
||||
|
|
|
@ -37,7 +37,7 @@ public abstract class AspectJProxyUtils {
|
|||
* and make available the current AspectJ JoinPoint. The call will have no effect if there are no
|
||||
* AspectJ advisors in the advisor chain.
|
||||
* @param advisors Advisors available
|
||||
* @return <code>true</code> if any special {@link Advisor Advisors} were added, otherwise <code>false</code>.
|
||||
* @return {@code true} if any special {@link Advisor Advisors} were added, otherwise {@code false}.
|
||||
*/
|
||||
public static boolean makeAdvisorChainAspectJCapableIfNecessary(List<Advisor> advisors) {
|
||||
// Don't add advisors to an empty list; may indicate that proxying is just not required
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.aspectj.bridge.IMessageHandler;
|
|||
* <p><code class="code">-XmessageHandlerClass:org.springframework.aop.aspectj.AspectJWeaverMessageHandler</code>
|
||||
*
|
||||
* <p>to the weaver; for example, specifying the following in a
|
||||
* "<code>META-INF/aop.xml</code> file:
|
||||
* "{@code META-INF/aop.xml} file:
|
||||
*
|
||||
* <p><code class="code"><weaver options="..."/></code>
|
||||
*
|
||||
|
|
|
@ -34,11 +34,11 @@ import org.springframework.util.Assert;
|
|||
* Implementation of AspectJ ProceedingJoinPoint interface
|
||||
* wrapping an AOP Alliance MethodInvocation.
|
||||
*
|
||||
* <p><b>Note</b>: the <code>getThis()</code> method returns the current Spring AOP proxy.
|
||||
* The <code>getTarget()</code> method returns the current Spring AOP target (which may be
|
||||
* <code>null</code> if there is no target), and is a plain POJO without any advice.
|
||||
* <p><b>Note</b>: the {@code getThis()} method returns the current Spring AOP proxy.
|
||||
* The {@code getTarget()} method returns the current Spring AOP target (which may be
|
||||
* {@code null} if there is no target), and is a plain POJO without any advice.
|
||||
* <b>If you want to call the object and have the advice take effect, use
|
||||
* <code>getThis()</code>.</b> A common example is casting the object to an
|
||||
* {@code getThis()}.</b> A common example is casting the object to an
|
||||
* introduced interface in the implementation of an introduction.
|
||||
*
|
||||
* <p>Of course there is no such distinction between target and proxy in AspectJ.
|
||||
|
@ -92,14 +92,14 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the Spring AOP proxy. Cannot be <code>null</code>.
|
||||
* Returns the Spring AOP proxy. Cannot be {@code null}.
|
||||
*/
|
||||
public Object getThis() {
|
||||
return this.methodInvocation.getProxy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Spring AOP target. May be <code>null</code> if there is no target.
|
||||
* Returns the Spring AOP target. May be {@code null} if there is no target.
|
||||
*/
|
||||
public Object getTarget() {
|
||||
return this.methodInvocation.getThis();
|
||||
|
|
|
@ -44,7 +44,7 @@ import org.springframework.util.ReflectionUtils;
|
|||
* <p>It relies on implementation specific knowledge in AspectJ to break
|
||||
* encapsulation and do something AspectJ was not designed to do: query
|
||||
* the types of runtime tests that will be performed. The code here should
|
||||
* migrate to <code>ShadowMatch.getVariablesInvolvedInRuntimeTest()</code>
|
||||
* migrate to {@code ShadowMatch.getVariablesInvolvedInRuntimeTest()}
|
||||
* or some similar operation.
|
||||
*
|
||||
* <p>See <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=151593"/>.
|
||||
|
|
|
@ -42,7 +42,7 @@ public class SimpleAspectInstanceFactory implements AspectInstanceFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the specified aspect class (never <code>null</code>).
|
||||
* Return the specified aspect class (never {@code null}).
|
||||
*/
|
||||
public final Class getAspectClass() {
|
||||
return this.aspectClass;
|
||||
|
@ -81,7 +81,7 @@ public class SimpleAspectInstanceFactory implements AspectInstanceFactory {
|
|||
* Determine a fallback order for the case that the aspect instance
|
||||
* does not express an instance-specific order through implementing
|
||||
* the {@link org.springframework.core.Ordered} interface.
|
||||
* <p>The default implementation simply returns <code>Ordered.LOWEST_PRECEDENCE</code>.
|
||||
* <p>The default implementation simply returns {@code Ordered.LOWEST_PRECEDENCE}.
|
||||
* @param aspectClass the aspect class
|
||||
*/
|
||||
protected int getOrderForAspectClass(Class<?> aspectClass) {
|
||||
|
|
|
@ -71,7 +71,7 @@ public class SingletonAspectInstanceFactory implements AspectInstanceFactory {
|
|||
* Determine a fallback order for the case that the aspect instance
|
||||
* does not express an instance-specific order through implementing
|
||||
* the {@link org.springframework.core.Ordered} interface.
|
||||
* <p>The default implementation simply returns <code>Ordered.LOWEST_PRECEDENCE</code>.
|
||||
* <p>The default implementation simply returns {@code Ordered.LOWEST_PRECEDENCE}.
|
||||
* @param aspectClass the aspect class
|
||||
*/
|
||||
protected int getOrderForAspectClass(Class<?> aspectClass) {
|
||||
|
|
|
@ -50,7 +50,7 @@ public class TypePatternClassFilter implements ClassFilter {
|
|||
* Create a fully configured {@link TypePatternClassFilter} using the
|
||||
* given type pattern.
|
||||
* @param typePattern the type pattern that AspectJ weaver should parse
|
||||
* @throws IllegalArgumentException if the supplied <code>typePattern</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if the supplied {@code typePattern} is {@code null}
|
||||
* or is recognized as invalid
|
||||
*/
|
||||
public TypePatternClassFilter(String typePattern) {
|
||||
|
@ -68,11 +68,11 @@ public class TypePatternClassFilter implements ClassFilter {
|
|||
* <code class="code">
|
||||
* org.springframework.beans.ITestBean+
|
||||
* </code>
|
||||
* This will match the <code>ITestBean</code> interface and any class
|
||||
* This will match the {@code ITestBean} interface and any class
|
||||
* that implements it.
|
||||
* <p>These conventions are established by AspectJ, not Spring AOP.
|
||||
* @param typePattern the type pattern that AspectJ weaver should parse
|
||||
* @throws IllegalArgumentException if the supplied <code>typePattern</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if the supplied {@code typePattern} is {@code null}
|
||||
* or is recognized as invalid
|
||||
*/
|
||||
public void setTypePattern(String typePattern) {
|
||||
|
@ -102,9 +102,9 @@ public class TypePatternClassFilter implements ClassFilter {
|
|||
|
||||
/**
|
||||
* If a type pattern has been specified in XML, the user cannot
|
||||
* write <code>and</code> as "&&" (though && will work).
|
||||
* We also allow <code>and</code> between two sub-expressions.
|
||||
* <p>This method converts back to <code>&&</code> for the AspectJ pointcut parser.
|
||||
* write {@code and} as "&&" (though && will work).
|
||||
* We also allow {@code and} between two sub-expressions.
|
||||
* <p>This method converts back to {@code &&} for the AspectJ pointcut parser.
|
||||
*/
|
||||
private String replaceBooleanOperators(String pcExpr) {
|
||||
pcExpr = StringUtils.replace(pcExpr," and "," && ");
|
||||
|
|
|
@ -103,7 +103,7 @@ public class AnnotationAwareAspectJAutoProxyCreator extends AspectJAwareAdvisorA
|
|||
/**
|
||||
* Check whether the given aspect bean is eligible for auto-proxying.
|
||||
* <p>If no <aop:include> elements were used then "includePatterns" will be
|
||||
* <code>null</code> and all beans are included. If "includePatterns" is non-null,
|
||||
* {@code null} and all beans are included. If "includePatterns" is non-null,
|
||||
* then one of the patterns must match.
|
||||
*/
|
||||
protected boolean isEligibleAspectBean(String beanName) {
|
||||
|
|
|
@ -40,7 +40,7 @@ public interface AspectJAdvisorFactory {
|
|||
/**
|
||||
* Determine whether or not the given class is an aspect, as reported
|
||||
* by AspectJ's {@link org.aspectj.lang.reflect.AjTypeSystem}.
|
||||
* <p>Will simply return <code>false</code> if the supposed aspect is
|
||||
* <p>Will simply return {@code false} if the supposed aspect is
|
||||
* invalid (such as an extension of a concrete aspect class).
|
||||
* Will return true for some aspects that Spring AOP cannot process,
|
||||
* such as those with unsupported instantiation models.
|
||||
|
@ -75,7 +75,7 @@ public interface AspectJAdvisorFactory {
|
|||
* @param aif the aspect instance factory
|
||||
* @param declarationOrderInAspect the declaration order within the aspect
|
||||
* @param aspectName the name of the aspect
|
||||
* @return <code>null</code> if the method is not an AspectJ advice method
|
||||
* @return {@code null} if the method is not an AspectJ advice method
|
||||
* or if it is a pointcut that will be used by other advice but will not
|
||||
* create a Spring advice in its own right
|
||||
*/
|
||||
|
@ -89,7 +89,7 @@ public interface AspectJAdvisorFactory {
|
|||
* @param aif the aspect instance factory
|
||||
* @param declarationOrderInAspect the declaration order within the aspect
|
||||
* @param aspectName the name of the aspect
|
||||
* @return <code>null</code> if the method is not an AspectJ advice method
|
||||
* @return {@code null} if the method is not an AspectJ advice method
|
||||
* or if it is a pointcut that will be used by other advice but will not
|
||||
* create a Spring advice in its own right
|
||||
* @see org.springframework.aop.aspectj.AspectJAroundAdvice
|
||||
|
|
|
@ -72,7 +72,7 @@ public class AspectJProxyFactory extends ProxyCreatorSupport {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a new <code>AspectJProxyFactory</code>.
|
||||
* Create a new {@code AspectJProxyFactory}.
|
||||
* No target, only interfaces. Must add interceptors.
|
||||
*/
|
||||
public AspectJProxyFactory(Class[] interfaces) {
|
||||
|
|
|
@ -109,7 +109,7 @@ public class AspectMetadata {
|
|||
}
|
||||
|
||||
/**
|
||||
* Extract contents from String of form <code>pertarget(contents)</code>.
|
||||
* Extract contents from String of form {@code pertarget(contents)}.
|
||||
*/
|
||||
private String findPerClause(Class<?> aspectClass) {
|
||||
// TODO when AspectJ provides this, we can remove this hack. Hence we don't
|
||||
|
@ -144,7 +144,7 @@ public class AspectMetadata {
|
|||
|
||||
/**
|
||||
* Return a Spring pointcut expression for a singleton aspect.
|
||||
* (e.g. <code>Pointcut.TRUE</code> if it's a singleton).
|
||||
* (e.g. {@code Pointcut.TRUE} if it's a singleton).
|
||||
*/
|
||||
public Pointcut getPerClausePointcut() {
|
||||
return this.perClausePointcut;
|
||||
|
|
|
@ -103,7 +103,7 @@ class InstantiationModelAwarePointcutAdvisorImpl
|
|||
|
||||
/**
|
||||
* This is only of interest for Spring AOP: AspectJ instantiation semantics
|
||||
* are much richer. In AspectJ terminology, all a return of <code>true</code>
|
||||
* are much richer. In AspectJ terminology, all a return of {@code true}
|
||||
* means here is that the aspect is not a SINGLETON.
|
||||
*/
|
||||
public boolean isPerInstance() {
|
||||
|
|
|
@ -144,7 +144,7 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
|
|||
* for the given introduction field.
|
||||
* <p>Resulting Advisors will need to be evaluated for targets.
|
||||
* @param introductionField the field to introspect
|
||||
* @return <code>null</code> if not an Advisor
|
||||
* @return {@code null} if not an Advisor
|
||||
*/
|
||||
private Advisor getDeclareParentsAdvisor(Field introductionField) {
|
||||
DeclareParents declareParents = introductionField.getAnnotation(DeclareParents.class);
|
||||
|
|
|
@ -53,7 +53,7 @@ public class SimpleMetadataAwareAspectInstanceFactory extends SimpleAspectInstan
|
|||
* Determine a fallback order for the case that the aspect instance
|
||||
* does not express an instance-specific order through implementing
|
||||
* the {@link org.springframework.core.Ordered} interface.
|
||||
* <p>The default implementation simply returns <code>Ordered.LOWEST_PRECEDENCE</code>.
|
||||
* <p>The default implementation simply returns {@code Ordered.LOWEST_PRECEDENCE}.
|
||||
* @param aspectClass the aspect class
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -54,7 +54,7 @@ public class SingletonMetadataAwareAspectInstanceFactory extends SingletonAspect
|
|||
/**
|
||||
* Check whether the aspect class carries an
|
||||
* {@link org.springframework.core.annotation.Order} annotation,
|
||||
* falling back to <code>Ordered.LOWEST_PRECEDENCE</code>.
|
||||
* falling back to {@code Ordered.LOWEST_PRECEDENCE}.
|
||||
* @see org.springframework.core.annotation.Order
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -27,15 +27,15 @@ import org.springframework.util.Assert;
|
|||
/**
|
||||
* Orders AspectJ advice/advisors by precedence (<i>not</i> invocation order).
|
||||
*
|
||||
* <p>Given two pieces of advice, <code>a</code> and <code>b</code>:
|
||||
* <p>Given two pieces of advice, {@code a} and {@code b}:
|
||||
* <ul>
|
||||
* <li>if <code>a</code> and <code>b</code> are defined in different
|
||||
* <li>if {@code a} and {@code b} are defined in different
|
||||
* aspects, then the advice in the aspect with the lowest order
|
||||
* value has the highest precedence</li>
|
||||
* <li>if <code>a</code> and <code>b</code> are defined in the same
|
||||
* aspect, then if one of <code>a</code> or <code>b</code> is a form of
|
||||
* <li>if {@code a} and {@code b} are defined in the same
|
||||
* aspect, then if one of {@code a} or {@code b} is a form of
|
||||
* after advice, then the advice declared last in the aspect has the
|
||||
* highest precedence. If neither <code>a</code> nor <code>b</code> is a
|
||||
* highest precedence. If neither {@code a} nor {@code b} is a
|
||||
* form of after advice, then the advice declared first in the aspect has
|
||||
* the highest precedence.</li>
|
||||
* </ul>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/**
|
||||
*
|
||||
* AspectJ integration package. Includes Spring AOP advice implementations for AspectJ 5
|
||||
|
@ -6,7 +5,7 @@
|
|||
* implementation that allows use of the AspectJ pointcut expression language with the Spring AOP
|
||||
* runtime framework.
|
||||
*
|
||||
* <p>Note that use of this package does <i>not</i> require the use of the <code>ajc</code> compiler
|
||||
* <p>Note that use of this package does <i>not</i> require the use of the {@code ajc} compiler
|
||||
* or AspectJ load-time weaver. It is intended to enable the use of a valuable subset of AspectJ
|
||||
* functionality, with consistent semantics, with the proxy-based Spring AOP framework.
|
||||
*
|
||||
|
|
|
@ -40,7 +40,7 @@ import org.springframework.util.StringUtils;
|
|||
* to the resulting bean.
|
||||
*
|
||||
* <p>This base class controls the creation of the {@link ProxyFactoryBean} bean definition
|
||||
* and wraps the original as an inner-bean definition for the <code>target</code> property
|
||||
* and wraps the original as an inner-bean definition for the {@code target} property
|
||||
* of {@link ProxyFactoryBean}.
|
||||
*
|
||||
* <p>Chaining is correctly handled, ensuring that only one {@link ProxyFactoryBean} definition
|
||||
|
@ -48,7 +48,7 @@ import org.springframework.util.StringUtils;
|
|||
* already created the {@link org.springframework.aop.framework.ProxyFactoryBean} then the
|
||||
* interceptor is simply added to the existing definition.
|
||||
*
|
||||
* <p>Subclasses have only to create the <code>BeanDefinition</code> to the interceptor that
|
||||
* <p>Subclasses have only to create the {@code BeanDefinition} to the interceptor that
|
||||
* they wish to add.
|
||||
*
|
||||
* @author Rob Harrop
|
||||
|
@ -118,7 +118,7 @@ public abstract class AbstractInterceptorDrivenBeanDefinitionDecorator implement
|
|||
}
|
||||
|
||||
/**
|
||||
* Subclasses should implement this method to return the <code>BeanDefinition</code>
|
||||
* Subclasses should implement this method to return the {@code BeanDefinition}
|
||||
* for the interceptor they wish to apply to the bean being decorated.
|
||||
*/
|
||||
protected abstract BeanDefinition createInterceptorDefinition(Node node);
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.springframework.util.Assert;
|
|||
/**
|
||||
* {@link org.springframework.beans.factory.parsing.ComponentDefinition}
|
||||
* that bridges the gap between the advisor bean definition configured
|
||||
* by the <code><aop:advisor></code> tag and the component definition
|
||||
* by the {@code <aop:advisor>} tag and the component definition
|
||||
* infrastructure.
|
||||
*
|
||||
* @author Rob Harrop
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.springframework.util.Assert;
|
|||
* <p>Only a single auto-proxy creator can be registered yet multiple concrete
|
||||
* implementations are available. Therefore this class wraps a simple escalation
|
||||
* protocol, allowing classes to request a particular auto-proxy creator and know
|
||||
* that class, <code>or a subclass thereof</code>, will eventually be resident
|
||||
* that class, {@code or a subclass thereof}, will eventually be resident
|
||||
* in the application context.
|
||||
*
|
||||
* @author Rob Harrop
|
||||
|
|
|
@ -21,21 +21,21 @@ import org.springframework.beans.factory.xml.BeanDefinitionParser;
|
|||
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
|
||||
|
||||
/**
|
||||
* <code>NamespaceHandler</code> for the <code>aop</code> namespace.
|
||||
* {@code NamespaceHandler} for the {@code aop} namespace.
|
||||
*
|
||||
* <p>Provides a {@link org.springframework.beans.factory.xml.BeanDefinitionParser} for the
|
||||
* <code><aop:config></code> tag. A <code>config</code> tag can include nested
|
||||
* <code>pointcut</code>, <code>advisor</code> and <code>aspect</code> tags.
|
||||
* {@code <aop:config>} tag. A {@code config} tag can include nested
|
||||
* {@code pointcut}, {@code advisor} and {@code aspect} tags.
|
||||
*
|
||||
* <p>The <code>pointcut</code> tag allows for creation of named
|
||||
* <p>The {@code pointcut} tag allows for creation of named
|
||||
* {@link AspectJExpressionPointcut} beans using a simple syntax:
|
||||
* <pre class="code">
|
||||
* <aop:pointcut id="getNameCalls" expression="execution(* *..ITestBean.getName(..))"/>
|
||||
* </pre>
|
||||
*
|
||||
* <p>Using the <code>advisor</code> tag you can configure an {@link org.springframework.aop.Advisor}
|
||||
* <p>Using the {@code advisor} tag you can configure an {@link org.springframework.aop.Advisor}
|
||||
* and have it applied to all relevant beans in you {@link org.springframework.beans.factory.BeanFactory}
|
||||
* automatically. The <code>advisor</code> tag supports both in-line and referenced
|
||||
* automatically. The {@code advisor} tag supports both in-line and referenced
|
||||
* {@link org.springframework.aop.Pointcut Pointcuts}:
|
||||
*
|
||||
* <pre class="code">
|
||||
|
@ -56,8 +56,8 @@ public class AopNamespaceHandler extends NamespaceHandlerSupport {
|
|||
|
||||
/**
|
||||
* Register the {@link BeanDefinitionParser BeanDefinitionParsers} for the
|
||||
* '<code>config</code>', '<code>spring-configured</code>', '<code>aspectj-autoproxy</code>'
|
||||
* and '<code>scoped-proxy</code>' tags.
|
||||
* '{@code config}', '{@code spring-configured}', '{@code aspectj-autoproxy}'
|
||||
* and '{@code scoped-proxy}' tags.
|
||||
*/
|
||||
public void init() {
|
||||
// In 2.0 XSD as well as in 2.1 XSD.
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.springframework.beans.factory.xml.ParserContext;
|
|||
|
||||
/**
|
||||
* Utility class for handling registration of auto-proxy creators used internally
|
||||
* by the '<code>aop</code>' namespace tags.
|
||||
* by the '{@code aop}' namespace tags.
|
||||
*
|
||||
* <p>Only a single auto-proxy creator can be registered and multiple tags may wish
|
||||
* to register different concrete implementations. As such this class delegates to
|
||||
|
@ -42,12 +42,12 @@ import org.springframework.beans.factory.xml.ParserContext;
|
|||
public abstract class AopNamespaceUtils {
|
||||
|
||||
/**
|
||||
* The <code>proxy-target-class</code> attribute as found on AOP-related XML tags.
|
||||
* The {@code proxy-target-class} attribute as found on AOP-related XML tags.
|
||||
*/
|
||||
public static final String PROXY_TARGET_CLASS_ATTRIBUTE = "proxy-target-class";
|
||||
|
||||
/**
|
||||
* The <code>expose-proxy</code> attribute as found on AOP-related XML tags.
|
||||
* The {@code expose-proxy} attribute as found on AOP-related XML tags.
|
||||
*/
|
||||
private static final String EXPOSE_PROXY_ATTRIBUTE = "expose-proxy";
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.springframework.beans.factory.xml.BeanDefinitionParser;
|
|||
import org.springframework.beans.factory.xml.ParserContext;
|
||||
|
||||
/**
|
||||
* {@link BeanDefinitionParser} for the <code>aspectj-autoproxy</code> tag,
|
||||
* {@link BeanDefinitionParser} for the {@code aspectj-autoproxy} tag,
|
||||
* enabling the automatic application of @AspectJ-style aspects found in
|
||||
* the {@link org.springframework.beans.factory.BeanFactory}.
|
||||
*
|
||||
|
|
|
@ -49,7 +49,7 @@ import org.springframework.util.StringUtils;
|
|||
import org.springframework.util.xml.DomUtils;
|
||||
|
||||
/**
|
||||
* {@link BeanDefinitionParser} for the <code><aop:config></code> tag.
|
||||
* {@link BeanDefinitionParser} for the {@code <aop:config>} tag.
|
||||
*
|
||||
* @author Rob Harrop
|
||||
* @author Juergen Hoeller
|
||||
|
@ -122,8 +122,8 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
|
|||
|
||||
/**
|
||||
* Configures the auto proxy creator needed to support the {@link BeanDefinition BeanDefinitions}
|
||||
* created by the '<code><aop:config/></code>' tag. Will force class proxying if the
|
||||
* '<code>proxy-target-class</code>' attribute is set to '<code>true</code>'.
|
||||
* created by the '{@code <aop:config/>}' tag. Will force class proxying if the
|
||||
* '{@code proxy-target-class}' attribute is set to '{@code true}'.
|
||||
* @see AopNamespaceUtils
|
||||
*/
|
||||
private void configureAutoProxyCreator(ParserContext parserContext, Element element) {
|
||||
|
@ -131,7 +131,7 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
|
|||
}
|
||||
|
||||
/**
|
||||
* Parses the supplied <code><advisor></code> element and registers the resulting
|
||||
* Parses the supplied {@code <advisor>} element and registers the resulting
|
||||
* {@link org.springframework.aop.Advisor} and any resulting {@link org.springframework.aop.Pointcut}
|
||||
* with the supplied {@link BeanDefinitionRegistry}.
|
||||
*/
|
||||
|
@ -168,7 +168,7 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
|
|||
|
||||
/**
|
||||
* Create a {@link RootBeanDefinition} for the advisor described in the supplied. Does <strong>not</strong>
|
||||
* parse any associated '<code>pointcut</code>' or '<code>pointcut-ref</code>' attributes.
|
||||
* parse any associated '{@code pointcut}' or '{@code pointcut-ref}' attributes.
|
||||
*/
|
||||
private AbstractBeanDefinition createAdvisorBeanDefinition(Element advisorElement, ParserContext parserContext) {
|
||||
RootBeanDefinition advisorDefinition = new RootBeanDefinition(DefaultBeanFactoryPointcutAdvisor.class);
|
||||
|
@ -257,9 +257,9 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return <code>true</code> if the supplied node describes an advice type. May be one of:
|
||||
* '<code>before</code>', '<code>after</code>', '<code>after-returning</code>',
|
||||
* '<code>after-throwing</code>' or '<code>around</code>'.
|
||||
* Return {@code true} if the supplied node describes an advice type. May be one of:
|
||||
* '{@code before}', '{@code after}', '{@code after-returning}',
|
||||
* '{@code after-throwing}' or '{@code around}'.
|
||||
*/
|
||||
private boolean isAdviceNode(Node aNode, ParserContext parserContext) {
|
||||
if (!(aNode instanceof Element)) {
|
||||
|
@ -273,7 +273,7 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
|
|||
}
|
||||
|
||||
/**
|
||||
* Parse a '<code>declare-parents</code>' element and register the appropriate
|
||||
* Parse a '{@code declare-parents}' element and register the appropriate
|
||||
* DeclareParentsAdvisor with the BeanDefinitionRegistry encapsulated in the
|
||||
* supplied ParserContext.
|
||||
*/
|
||||
|
@ -304,8 +304,8 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
|
|||
}
|
||||
|
||||
/**
|
||||
* Parses one of '<code>before</code>', '<code>after</code>', '<code>after-returning</code>',
|
||||
* '<code>after-throwing</code>' or '<code>around</code>' and registers the resulting
|
||||
* Parses one of '{@code before}', '{@code after}', '{@code after-returning}',
|
||||
* '{@code after-throwing}' or '{@code around}' and registers the resulting
|
||||
* BeanDefinition with the supplied BeanDefinitionRegistry.
|
||||
* @return the generated advice RootBeanDefinition
|
||||
*/
|
||||
|
@ -427,7 +427,7 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
|
|||
}
|
||||
|
||||
/**
|
||||
* Parses the supplied <code><pointcut></code> and registers the resulting
|
||||
* Parses the supplied {@code <pointcut>} and registers the resulting
|
||||
* Pointcut with the BeanDefinitionRegistry.
|
||||
*/
|
||||
private AbstractBeanDefinition parsePointcut(Element pointcutElement, ParserContext parserContext) {
|
||||
|
@ -460,8 +460,8 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
|
|||
}
|
||||
|
||||
/**
|
||||
* Parses the <code>pointcut</code> or <code>pointcut-ref</code> attributes of the supplied
|
||||
* {@link Element} and add a <code>pointcut</code> property as appropriate. Generates a
|
||||
* Parses the {@code pointcut} or {@code pointcut-ref} attributes of the supplied
|
||||
* {@link Element} and add a {@code pointcut} property as appropriate. Generates a
|
||||
* {@link org.springframework.beans.factory.config.BeanDefinition} for the pointcut if necessary
|
||||
* and returns its bean name, otherwise returns the bean name of the referred pointcut.
|
||||
*/
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.springframework.beans.factory.xml.ParserContext;
|
|||
|
||||
/**
|
||||
* {@link BeanDefinitionDecorator} responsible for parsing the
|
||||
* <code><aop:scoped-proxy/></code> tag.
|
||||
* {@code <aop:scoped-proxy/>} tag.
|
||||
*
|
||||
* @author Rob Harrop
|
||||
* @author Juergen Hoeller
|
||||
|
|
|
@ -93,7 +93,7 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyConfig
|
|||
/**
|
||||
* Check whether the given bean is eligible for advising with this
|
||||
* post-processor's {@link Advisor}.
|
||||
* <p>Implements caching of <code>canApply</code> results per bean name.
|
||||
* <p>Implements caching of {@code canApply} results per bean name.
|
||||
* @param bean the bean instance
|
||||
* @param beanName the name of the bean
|
||||
* @see AopUtils#canApply(Advisor, Class)
|
||||
|
|
|
@ -77,7 +77,7 @@ public interface Advised extends TargetClassAware {
|
|||
* Set whether the proxy should be exposed by the AOP framework as a
|
||||
* ThreadLocal for retrieval via the AopContext class. This is useful
|
||||
* if an advised object needs to call another advised method on itself.
|
||||
* (If it uses <code>this</code>, the invocation will not be advised).
|
||||
* (If it uses {@code this}, the invocation will not be advised).
|
||||
* <p>Default is "false", for optimal performance.
|
||||
*/
|
||||
void setExposeProxy(boolean exposeProxy);
|
||||
|
@ -85,7 +85,7 @@ public interface Advised extends TargetClassAware {
|
|||
/**
|
||||
* Return whether the factory should expose the proxy as a ThreadLocal.
|
||||
* This can be necessary if a target object needs to invoke a method on itself
|
||||
* benefitting from advice. (If it invokes a method on <code>this</code> no advice
|
||||
* benefitting from advice. (If it invokes a method on {@code this} no advice
|
||||
* will apply.) Getting the proxy is analogous to an EJB calling getEJBObject().
|
||||
* @see AopContext
|
||||
*/
|
||||
|
@ -110,7 +110,7 @@ public interface Advised extends TargetClassAware {
|
|||
|
||||
/**
|
||||
* Return the advisors applying to this proxy.
|
||||
* @return a list of Advisors applying to this proxy (never <code>null</code>)
|
||||
* @return a list of Advisors applying to this proxy (never {@code null})
|
||||
*/
|
||||
Advisor[] getAdvisors();
|
||||
|
||||
|
@ -135,7 +135,7 @@ public interface Advised extends TargetClassAware {
|
|||
/**
|
||||
* Remove the given advisor.
|
||||
* @param advisor the advisor to remove
|
||||
* @return <code>true</code> if the advisor was removed; <code>false</code>
|
||||
* @return {@code true} if the advisor was removed; {@code false}
|
||||
* if the advisor was not found and hence could not be removed
|
||||
*/
|
||||
boolean removeAdvisor(Advisor advisor);
|
||||
|
@ -165,7 +165,7 @@ public interface Advised extends TargetClassAware {
|
|||
* @param a the advisor to replace
|
||||
* @param b the advisor to replace it with
|
||||
* @return whether it was replaced. If the advisor wasn't found in the
|
||||
* list of advisors, this method returns <code>false</code> and does nothing.
|
||||
* list of advisors, this method returns {@code false} and does nothing.
|
||||
* @throws AopConfigException in case of invalid advice
|
||||
*/
|
||||
boolean replaceAdvisor(Advisor a, Advisor b) throws AopConfigException;
|
||||
|
@ -174,9 +174,9 @@ public interface Advised extends TargetClassAware {
|
|||
/**
|
||||
* Add the given AOP Alliance advice to the tail of the advice (interceptor) chain.
|
||||
* <p>This will be wrapped in a DefaultPointcutAdvisor with a pointcut that always
|
||||
* applies, and returned from the <code>getAdvisors()</code> method in this wrapped form.
|
||||
* applies, and returned from the {@code getAdvisors()} method in this wrapped form.
|
||||
* <p>Note that the given advice will apply to all invocations on the proxy,
|
||||
* even to the <code>toString()</code> method! Use appropriate advice implementations
|
||||
* even to the {@code toString()} method! Use appropriate advice implementations
|
||||
* or specify appropriate pointcuts to apply to a narrower set of methods.
|
||||
* @param advice advice to add to the tail of the chain
|
||||
* @throws AopConfigException in case of invalid advice
|
||||
|
@ -191,7 +191,7 @@ public interface Advised extends TargetClassAware {
|
|||
* with a pointcut that always applies, and returned from the {@link #getAdvisors()}
|
||||
* method in this wrapped form.
|
||||
* <p>Note: The given advice will apply to all invocations on the proxy,
|
||||
* even to the <code>toString()</code> method! Use appropriate advice implementations
|
||||
* even to the {@code toString()} method! Use appropriate advice implementations
|
||||
* or specify appropriate pointcuts to apply to a narrower set of methods.
|
||||
* @param pos index from 0 (head)
|
||||
* @param advice advice to add at the specified position in the advice chain
|
||||
|
@ -202,8 +202,8 @@ public interface Advised extends TargetClassAware {
|
|||
/**
|
||||
* Remove the Advisor containing the given advice.
|
||||
* @param advice the advice to remove
|
||||
* @return <code>true</code> of the advice was found and removed;
|
||||
* <code>false</code> if there was no such advice
|
||||
* @return {@code true} of the advice was found and removed;
|
||||
* {@code false} if there was no such advice
|
||||
*/
|
||||
boolean removeAdvice(Advice advice);
|
||||
|
||||
|
@ -219,7 +219,7 @@ public interface Advised extends TargetClassAware {
|
|||
|
||||
|
||||
/**
|
||||
* As <code>toString()</code> will normally be delegated to the target,
|
||||
* As {@code toString()} will normally be delegated to the target,
|
||||
* this returns the equivalent for the AOP proxy.
|
||||
* @return a string description of the proxy configuration
|
||||
*/
|
||||
|
|
|
@ -184,7 +184,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the advisor chain factory to use (never <code>null</code>).
|
||||
* Return the advisor chain factory to use (never {@code null}).
|
||||
*/
|
||||
public AdvisorChainFactory getAdvisorChainFactory() {
|
||||
return this.advisorChainFactory;
|
||||
|
@ -221,7 +221,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
|||
* Remove a proxied interface.
|
||||
* <p>Does nothing if the given interface isn't proxied.
|
||||
* @param intf the interface to remove from the proxy
|
||||
* @return <code>true</code> if the interface was removed; <code>false</code>
|
||||
* @return {@code true} if the interface was removed; {@code false}
|
||||
* if the interface was not found and hence could not be removed
|
||||
*/
|
||||
public boolean removeInterface(Class intf) {
|
||||
|
|
|
@ -21,9 +21,9 @@ import org.springframework.core.NamedThreadLocal;
|
|||
/**
|
||||
* Class containing static methods used to obtain information about the current AOP invocation.
|
||||
*
|
||||
* <p>The <code>currentProxy()</code> method is usable if the AOP framework is configured to
|
||||
* <p>The {@code currentProxy()} method is usable if the AOP framework is configured to
|
||||
* expose the current proxy (not the default). It returns the AOP proxy in use. Target objects
|
||||
* or advice can use this to make advised calls, in the same way as <code>getEJBObject()</code>
|
||||
* or advice can use this to make advised calls, in the same way as {@code getEJBObject()}
|
||||
* can be used in EJBs. They can also use it to find advice configuration.
|
||||
*
|
||||
* <p>Spring's AOP framework does not expose proxies by default, as there is a performance cost
|
||||
|
@ -42,7 +42,7 @@ public abstract class AopContext {
|
|||
|
||||
/**
|
||||
* ThreadLocal holder for AOP proxy associated with this thread.
|
||||
* Will contain <code>null</code> unless the "exposeProxy" property on
|
||||
* Will contain {@code null} unless the "exposeProxy" property on
|
||||
* the controlling proxy configuration has been set to "true".
|
||||
* @see ProxyConfig#setExposeProxy
|
||||
*/
|
||||
|
@ -53,7 +53,7 @@ public abstract class AopContext {
|
|||
* Try to return the current AOP proxy. This method is usable only if the
|
||||
* calling method has been invoked via AOP, and the AOP framework has been set
|
||||
* to expose proxies. Otherwise, this method will throw an IllegalStateException.
|
||||
* @return Object the current AOP proxy (never returns <code>null</code>)
|
||||
* @return Object the current AOP proxy (never returns {@code null})
|
||||
* @throws IllegalStateException if the proxy cannot be found, because the
|
||||
* method was invoked outside an AOP invocation context, or because the
|
||||
* AOP framework has not been configured to expose the proxy
|
||||
|
@ -68,10 +68,10 @@ public abstract class AopContext {
|
|||
}
|
||||
|
||||
/**
|
||||
* Make the given proxy available via the <code>currentProxy()</code> method.
|
||||
* Make the given proxy available via the {@code currentProxy()} method.
|
||||
* <p>Note that the caller should be careful to keep the old value as appropriate.
|
||||
* @param proxy the proxy to expose (or <code>null</code> to reset it)
|
||||
* @return the old proxy, which may be <code>null</code> if none was bound
|
||||
* @param proxy the proxy to expose (or {@code null} to reset it)
|
||||
* @return the old proxy, which may be {@code null} if none was bound
|
||||
* @see #currentProxy()
|
||||
*/
|
||||
static Object setCurrentProxy(Object proxy) {
|
||||
|
|
|
@ -33,20 +33,20 @@ public interface AopProxy {
|
|||
* Create a new proxy object.
|
||||
* <p>Uses the AopProxy's default class loader (if necessary for proxy creation):
|
||||
* usually, the thread context class loader.
|
||||
* @return the new proxy object (never <code>null</code>)
|
||||
* @see java.lang.Thread#getContextClassLoader()
|
||||
* @return the new proxy object (never {@code null})
|
||||
* @see Thread#getContextClassLoader()
|
||||
*/
|
||||
Object getProxy();
|
||||
|
||||
/**
|
||||
* Create a new proxy object.
|
||||
* <p>Uses the given class loader (if necessary for proxy creation).
|
||||
* <code>null</code> will simply be passed down and thus lead to the low-level
|
||||
* {@code null} will simply be passed down and thus lead to the low-level
|
||||
* proxy facility's default, which is usually different from the default chosen
|
||||
* by the AopProxy implementation's {@link #getProxy()} method.
|
||||
* @param classLoader the class loader to create the proxy with
|
||||
* (or <code>null</code> for the low-level proxy facility's default)
|
||||
* @return the new proxy object (never <code>null</code>)
|
||||
* (or {@code null} for the low-level proxy facility's default)
|
||||
* @return the new proxy object (never {@code null})
|
||||
*/
|
||||
Object getProxy(ClassLoader classLoader);
|
||||
|
||||
|
|
|
@ -44,9 +44,9 @@ public abstract class AopProxyUtils {
|
|||
* as long as possible without side effects, that is, just for singleton targets.
|
||||
* @param candidate the instance to check (might be an AOP proxy)
|
||||
* @return the target class (or the plain class of the given object as fallback;
|
||||
* never <code>null</code>)
|
||||
* never {@code null})
|
||||
* @see org.springframework.aop.TargetClassAware#getTargetClass()
|
||||
* @see org.springframework.aop.framework.Advised#getTargetSource()
|
||||
* @see Advised#getTargetSource()
|
||||
*/
|
||||
public static Class<?> ultimateTargetClass(Object candidate) {
|
||||
Assert.notNull(candidate, "Candidate object must not be null");
|
||||
|
@ -112,7 +112,7 @@ public abstract class AopProxyUtils {
|
|||
* i.e. all non-Advised interfaces that the proxy implements.
|
||||
* @param proxy the proxy to analyze (usually a JDK dynamic proxy)
|
||||
* @return all user-specified interfaces that the proxy implements,
|
||||
* in the original order (never <code>null</code> or empty)
|
||||
* in the original order (never {@code null} or empty)
|
||||
* @see Advised
|
||||
*/
|
||||
public static Class[] proxiedUserInterfaces(Object proxy) {
|
||||
|
|
|
@ -234,7 +234,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Checks to see whether the supplied <code>Class</code> has already been validated and
|
||||
* Checks to see whether the supplied {@code Class} has already been validated and
|
||||
* validates it if not.
|
||||
*/
|
||||
private void validateClassIfNecessary(Class<?> proxySuperClass) {
|
||||
|
@ -249,7 +249,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Checks for final methods on the <code>Class</code> and writes warnings to the log
|
||||
* Checks for final methods on the {@code Class} and writes warnings to the log
|
||||
* for each one found.
|
||||
*/
|
||||
private void doValidateClass(Class<?> proxySuperClass) {
|
||||
|
@ -376,7 +376,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
* Method interceptor used for static targets with no advice chain. The call
|
||||
* is passed directly back to the target. Used when the proxy needs to be
|
||||
* exposed and it can't be determined that the method won't return
|
||||
* <code>this</code>.
|
||||
* {@code this}.
|
||||
*/
|
||||
private static class StaticUnadvisedInterceptor implements MethodInterceptor, Serializable {
|
||||
|
||||
|
@ -509,7 +509,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
|
||||
|
||||
/**
|
||||
* Dispatcher for the <code>equals</code> method.
|
||||
* Dispatcher for the {@code equals} method.
|
||||
* Ensures that the method call is always handled by this class.
|
||||
*/
|
||||
private static class EqualsInterceptor implements MethodInterceptor, Serializable {
|
||||
|
@ -541,7 +541,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
|
||||
|
||||
/**
|
||||
* Dispatcher for the <code>hashCode</code> method.
|
||||
* Dispatcher for the {@code hashCode} method.
|
||||
* Ensures that the method call is always handled by this class.
|
||||
*/
|
||||
private static class HashCodeInterceptor implements MethodInterceptor, Serializable {
|
||||
|
@ -609,7 +609,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
oldProxy = AopContext.setCurrentProxy(proxy);
|
||||
setProxyContext = true;
|
||||
}
|
||||
// May be <code>null</code>. Get as late as possible to minimize the time we
|
||||
// May be null Get as late as possible to minimize the time we
|
||||
// "own" the target, in case it comes from a pool.
|
||||
target = getTarget();
|
||||
if (target != null) {
|
||||
|
@ -745,11 +745,11 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
* invoke the advice chain. Otherwise a DyanmicAdvisedInterceptor is
|
||||
* used.</dd>
|
||||
* <dt>For non-advised methods:</dt>
|
||||
* <dd>Where it can be determined that the method will not return <code>this</code>
|
||||
* or when <code>ProxyFactory.getExposeProxy()</code> returns <code>false</code>,
|
||||
* <dd>Where it can be determined that the method will not return {@code this}
|
||||
* or when {@code ProxyFactory.getExposeProxy()} returns {@code false},
|
||||
* then a Dispatcher is used. For static targets, the StaticDispatcher is used;
|
||||
* and for dynamic targets, a DynamicUnadvisedInterceptor is used.
|
||||
* If it possible for the method to return <code>this</code> then a
|
||||
* If it possible for the method to return {@code this} then a
|
||||
* StaticUnadvisedInterceptor is used for static targets - the
|
||||
* DynamicUnadvisedInterceptor already considers this.</dd>
|
||||
* </dl>
|
||||
|
|
|
@ -143,7 +143,7 @@ final class JdkDynamicAopProxy implements AopProxy, InvocationHandler, Serializa
|
|||
|
||||
|
||||
/**
|
||||
* Implementation of <code>InvocationHandler.invoke</code>.
|
||||
* Implementation of {@code InvocationHandler.invoke}.
|
||||
* <p>Callers will see exactly the exception thrown by the target,
|
||||
* unless a hook method throws an exception.
|
||||
*/
|
||||
|
|
|
@ -112,7 +112,7 @@ public class ProxyConfig implements Serializable {
|
|||
* Set whether the proxy should be exposed by the AOP framework as a
|
||||
* ThreadLocal for retrieval via the AopContext class. This is useful
|
||||
* if an advised object needs to call another advised method on itself.
|
||||
* (If it uses <code>this</code>, the invocation will not be advised).
|
||||
* (If it uses {@code this}, the invocation will not be advised).
|
||||
* <p>Default is "false", in order to avoid unnecessary extra interception.
|
||||
* This means that no guarantees are provided that AopContext access will
|
||||
* work consistently within any method of the advised object.
|
||||
|
|
|
@ -95,7 +95,7 @@ public class ProxyCreatorSupport extends AdvisedSupport {
|
|||
|
||||
/**
|
||||
* Subclasses should call this to get a new AOP proxy. They should <b>not</b>
|
||||
* create an AOP proxy with <code>this</code> as an argument.
|
||||
* create an AOP proxy with {@code this} as an argument.
|
||||
*/
|
||||
protected final synchronized AopProxy createAopProxy() {
|
||||
if (!this.active) {
|
||||
|
|
|
@ -74,7 +74,7 @@ public class ProxyFactory extends ProxyCreatorSupport {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a ProxyFactory for the specified <code>TargetSource</code>,
|
||||
* Create a ProxyFactory for the specified {@code TargetSource},
|
||||
* making the proxy implement the specified interface.
|
||||
* @param proxyInterface the interface that the proxy should implement
|
||||
* @param targetSource the TargetSource that the proxy should invoke
|
||||
|
@ -103,7 +103,7 @@ public class ProxyFactory extends ProxyCreatorSupport {
|
|||
* or removed interfaces. Can add and remove interceptors.
|
||||
* <p>Uses the given class loader (if necessary for proxy creation).
|
||||
* @param classLoader the class loader to create the proxy with
|
||||
* (or <code>null</code> for the low-level proxy facility's default)
|
||||
* (or {@code null} for the low-level proxy facility's default)
|
||||
* @return the proxy object
|
||||
*/
|
||||
public Object getProxy(ClassLoader classLoader) {
|
||||
|
@ -127,7 +127,7 @@ public class ProxyFactory extends ProxyCreatorSupport {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a proxy for the specified <code>TargetSource</code>,
|
||||
* Create a proxy for the specified {@code TargetSource},
|
||||
* implementing the specified interface.
|
||||
* @param proxyInterface the interface that the proxy should implement
|
||||
* @param targetSource the TargetSource that the proxy should invoke
|
||||
|
@ -140,8 +140,8 @@ public class ProxyFactory extends ProxyCreatorSupport {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a proxy for the specified <code>TargetSource</code> that extends
|
||||
* the target class of the <code>TargetSource</code>.
|
||||
* Create a proxy for the specified {@code TargetSource} that extends
|
||||
* the target class of the {@code TargetSource}.
|
||||
* @param targetSource the TargetSource that the proxy should invoke
|
||||
* @return the proxy object
|
||||
*/
|
||||
|
|
|
@ -233,7 +233,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
|||
* Return a proxy. Invoked when clients obtain beans from this factory bean.
|
||||
* Create an instance of the AOP proxy to be returned by this factory.
|
||||
* The instance will be cached for a singleton, and create on each call to
|
||||
* <code>getObject()</code> for a proxy.
|
||||
* {@code getObject()} for a proxy.
|
||||
* @return a fresh AOP proxy reflecting the current state of this factory
|
||||
*/
|
||||
public Object getObject() throws BeansException {
|
||||
|
@ -351,7 +351,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
|||
|
||||
/**
|
||||
* Return the proxy object to expose.
|
||||
* <p>The default implementation uses a <code>getProxy</code> call with
|
||||
* <p>The default implementation uses a {@code getProxy} call with
|
||||
* the factory's bean class loader. Can be overridden to specify a
|
||||
* custom class loader.
|
||||
* @param aopProxy the prepared AopProxy instance to get the proxy from
|
||||
|
@ -392,7 +392,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
|||
* which concludes the interceptorNames list, is an Advisor or Advice,
|
||||
* or may be a target.
|
||||
* @param beanName bean name to check
|
||||
* @return <code>true</code> if it's an Advisor or Advice
|
||||
* @return {@code true} if it's an Advisor or Advice
|
||||
*/
|
||||
private boolean isNamedBeanAnAdvisorOrAdvice(String beanName) {
|
||||
Class namedBeanClass = this.beanFactory.getType(beanName);
|
||||
|
|
|
@ -253,7 +253,7 @@ public class ReflectiveMethodInvocation implements ProxyMethodInvocation, Clonea
|
|||
* This method provides an invocation-bound alternative to a ThreadLocal.
|
||||
* <p>This map is initialized lazily and is not used in the AOP framework itself.
|
||||
* @return any user attributes associated with this invocation
|
||||
* (never <code>null</code>)
|
||||
* (never {@code null})
|
||||
*/
|
||||
public Map<String, Object> getUserAttributes() {
|
||||
if (this.userAttributes == null) {
|
||||
|
|
|
@ -38,7 +38,7 @@ public interface AdvisorAdapter {
|
|||
|
||||
/**
|
||||
* Does this adapter understand this advice object? Is it valid to
|
||||
* invoke the <code>getInterceptors</code> method with an Advisor that
|
||||
* invoke the {@code getInterceptors} method with an Advisor that
|
||||
* contains this advice as an argument?
|
||||
* @param advice an Advice such as a BeforeAdvice
|
||||
* @return whether this adapter understands the given advice object
|
||||
|
|
|
@ -38,7 +38,7 @@ public interface AdvisorAdapterRegistry {
|
|||
* {@link org.springframework.aop.AfterReturningAdvice},
|
||||
* {@link org.springframework.aop.ThrowsAdvice}.
|
||||
* @param advice object that should be an advice
|
||||
* @return an Advisor wrapping the given advice. Never returns <code>null</code>.
|
||||
* @return an Advisor wrapping the given advice. Never returns {@code null}.
|
||||
* If the advice parameter is an Advisor, return it.
|
||||
* @throws UnknownAdviceTypeException if no registered advisor adapter
|
||||
* can wrap the supposed advice
|
||||
|
|
|
@ -32,10 +32,10 @@ import org.springframework.util.Assert;
|
|||
/**
|
||||
* Interceptor to wrap an after-throwing advice.
|
||||
*
|
||||
* <p>The signatures on handler methods on the <code>ThrowsAdvice</code>
|
||||
* <p>The signatures on handler methods on the {@code ThrowsAdvice}
|
||||
* implementation method argument must be of the form:<br>
|
||||
*
|
||||
* <code>void afterThrowing([Method, args, target], ThrowableSubclass);</code>
|
||||
* {@code void afterThrowing([Method, args, target], ThrowableSubclass);}
|
||||
*
|
||||
* <p>Only the last argument is required.
|
||||
*
|
||||
|
|
|
@ -76,7 +76,7 @@ public abstract class AbstractAdvisorAutoProxyCreator extends AbstractAutoProxyC
|
|||
* Find all eligible Advisors for auto-proxying this class.
|
||||
* @param beanClass the clazz to find advisors for
|
||||
* @param beanName the name of the currently proxied bean
|
||||
* @return the empty List, not <code>null</code>,
|
||||
* @return the empty List, not {@code null},
|
||||
* if there are no pointcuts or interceptors
|
||||
* @see #findCandidateAdvisors
|
||||
* @see #sortAdvisors
|
||||
|
|
|
@ -147,7 +147,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyConfig
|
|||
/**
|
||||
* Set the ordering which will apply to this class's implementation
|
||||
* of Ordered, used when applying multiple BeanPostProcessors.
|
||||
* <p>Default value is <code>Integer.MAX_VALUE</code>, meaning that it's non-ordered.
|
||||
* <p>Default value is {@code Integer.MAX_VALUE}, meaning that it's non-ordered.
|
||||
* @param order ordering value
|
||||
*/
|
||||
public final void setOrder(int order) {
|
||||
|
@ -243,7 +243,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyConfig
|
|||
|
||||
/**
|
||||
* Return the owning BeanFactory.
|
||||
* May be <code>null</code>, as this object doesn't need to belong to a bean factory.
|
||||
* May be {@code null}, as this object doesn't need to belong to a bean factory.
|
||||
*/
|
||||
protected BeanFactory getBeanFactory() {
|
||||
return this.beanFactory;
|
||||
|
@ -390,10 +390,10 @@ public abstract class AbstractAutoProxyCreator extends ProxyConfig
|
|||
}
|
||||
|
||||
/**
|
||||
* Subclasses should override this method to return <code>true</code> if the
|
||||
* Subclasses should override this method to return {@code true} if the
|
||||
* given bean should not be considered for auto-proxying by this post-processor.
|
||||
* <p>Sometimes we need to be able to avoid this happening if it will lead to
|
||||
* a circular reference. This implementation returns <code>false</code>.
|
||||
* a circular reference. This implementation returns {@code false}.
|
||||
* @param beanClass the class of the bean
|
||||
* @param beanName the name of the bean
|
||||
* @return whether to skip the given bean
|
||||
|
@ -404,7 +404,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyConfig
|
|||
|
||||
/**
|
||||
* Create a target source for bean instances. Uses any TargetSourceCreators if set.
|
||||
* Returns <code>null</code> if no custom TargetSource should be used.
|
||||
* Returns {@code null} if no custom TargetSource should be used.
|
||||
* <p>This implementation uses the "customTargetSourceCreators" property.
|
||||
* Subclasses can override this method to use a different mechanism.
|
||||
* @param beanClass the class of the bean to create a TargetSource for
|
||||
|
@ -497,7 +497,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyConfig
|
|||
* Return whether the Advisors returned by the subclass are pre-filtered
|
||||
* to match the bean's target class already, allowing the ClassFilter check
|
||||
* to be skipped when building advisors chains for AOP invocations.
|
||||
* <p>Default is <code>false</code>. Subclasses may override this if they
|
||||
* <p>Default is {@code false}. Subclasses may override this if they
|
||||
* will always return pre-filtered Advisors.
|
||||
* @return whether the Advisors are pre-filtered
|
||||
* @see #getAdvicesAndAdvisorsForBean
|
||||
|
@ -581,10 +581,10 @@ public abstract class AbstractAutoProxyCreator extends ProxyConfig
|
|||
* @param beanName the name of the bean
|
||||
* @param customTargetSource the TargetSource returned by the
|
||||
* {@link #getCustomTargetSource} method: may be ignored.
|
||||
* Will be <code>null</code> if no custom target source is in use.
|
||||
* Will be {@code null} if no custom target source is in use.
|
||||
* @return an array of additional interceptors for the particular bean;
|
||||
* or an empty array if no additional interceptors but just the common ones;
|
||||
* or <code>null</code> if no proxy at all, not even with the common interceptors.
|
||||
* or {@code null} if no proxy at all, not even with the common interceptors.
|
||||
* See constants DO_NOT_PROXY and PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS.
|
||||
* @throws BeansException in case of errors
|
||||
* @see #DO_NOT_PROXY
|
||||
|
|
|
@ -33,7 +33,7 @@ public abstract class AutoProxyUtils {
|
|||
/**
|
||||
* Bean definition attribute that may indicate whether a given bean is supposed
|
||||
* to be proxied with its target class (in case of it getting proxied in the first
|
||||
* place). The value is <code>Boolean.TRUE</code> or <code>Boolean.FALSE</code>.
|
||||
* place). The value is {@code Boolean.TRUE} or {@code Boolean.FALSE}.
|
||||
* <p>Proxy factories can set this attribute if they built a target class proxy
|
||||
* for a specific bean, and want to enforce that that bean can always be cast
|
||||
* to its target class (even if AOP advices get applied through auto-proxying).
|
||||
|
|
|
@ -107,7 +107,7 @@ public class BeanFactoryAdvisorRetrievalHelper {
|
|||
|
||||
/**
|
||||
* Determine whether the aspect bean with the given name is eligible.
|
||||
* <p>The default implementation always returns <code>true</code>.
|
||||
* <p>The default implementation always returns {@code true}.
|
||||
* @param beanName the name of the aspect bean
|
||||
* @return whether the bean is eligible
|
||||
*/
|
||||
|
|
|
@ -24,10 +24,10 @@ import org.springframework.beans.factory.BeanNameAware;
|
|||
* no special code to handle any particular aspects, such as pooling aspects.
|
||||
*
|
||||
* <p>It's possible to filter out advisors - for example, to use multiple post processors
|
||||
* of this type in the same factory - by setting the <code>usePrefix</code> property
|
||||
* of this type in the same factory - by setting the {@code usePrefix} property
|
||||
* to true, in which case only advisors beginning with the DefaultAdvisorAutoProxyCreator's
|
||||
* bean name followed by a dot (like "aapc.") will be used. This default prefix can be
|
||||
* changed from the bean name by setting the <code>advisorBeanNamePrefix</code> property.
|
||||
* changed from the bean name by setting the {@code advisorBeanNamePrefix} property.
|
||||
* The separator (.) will also be used in this case.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
|
|
|
@ -35,7 +35,7 @@ public class ProxyCreationContext {
|
|||
|
||||
/**
|
||||
* Return the name of the currently proxied bean instance.
|
||||
* @return the name of the bean, or <code>null</code> if none available
|
||||
* @return the name of the bean, or {@code null} if none available
|
||||
*/
|
||||
public static String getCurrentProxiedBeanName() {
|
||||
return currentProxiedBeanName.get();
|
||||
|
@ -43,7 +43,7 @@ public class ProxyCreationContext {
|
|||
|
||||
/**
|
||||
* Set the name of the currently proxied bean instance.
|
||||
* @param beanName the name of the bean, or <code>null</code> to reset it
|
||||
* @param beanName the name of the bean, or {@code null} to reset it
|
||||
*/
|
||||
static void setCurrentProxiedBeanName(String beanName) {
|
||||
if (beanName != null) {
|
||||
|
|
|
@ -35,7 +35,7 @@ public interface TargetSourceCreator {
|
|||
* Create a special TargetSource for the given bean, if any.
|
||||
* @param beanClass the class of the bean to create a TargetSource for
|
||||
* @param beanName the name of the bean
|
||||
* @return a special TargetSource or <code>null</code> if this TargetSourceCreator isn't
|
||||
* @return a special TargetSource or {@code null} if this TargetSourceCreator isn't
|
||||
* interested in the particular bean
|
||||
*/
|
||||
TargetSource getTargetSource(Class<?> beanClass, String beanName);
|
||||
|
|
|
@ -184,14 +184,14 @@ public abstract class AbstractBeanFactoryBasedTargetSourceCreator
|
|||
|
||||
/**
|
||||
* Subclasses must implement this method to return a new AbstractPrototypeBasedTargetSource
|
||||
* if they wish to create a custom TargetSource for this bean, or <code>null</code> if they are
|
||||
* if they wish to create a custom TargetSource for this bean, or {@code null} if they are
|
||||
* not interested it in, in which case no special target source will be created.
|
||||
* Subclasses should not call <code>setTargetBeanName</code> or <code>setBeanFactory</code>
|
||||
* Subclasses should not call {@code setTargetBeanName} or {@code setBeanFactory}
|
||||
* on the AbstractPrototypeBasedTargetSource: This class' implementation of
|
||||
* <code>getTargetSource()</code> will do that.
|
||||
* {@code getTargetSource()} will do that.
|
||||
* @param beanClass the class of the bean to create a TargetSource for
|
||||
* @param beanName the name of the bean
|
||||
* @return the AbstractPrototypeBasedTargetSource, or <code>null</code> if we don't match this
|
||||
* @return the AbstractPrototypeBasedTargetSource, or {@code null} if we don't match this
|
||||
*/
|
||||
protected abstract AbstractBeanFactoryBasedTargetSource createBeanFactoryBasedTargetSource(
|
||||
Class<?> beanClass, String beanName);
|
||||
|
|
|
@ -22,10 +22,10 @@ import org.aopalliance.intercept.MethodInvocation;
|
|||
|
||||
/**
|
||||
* Base class for monitoring interceptors, such as performance monitors.
|
||||
* Provides <code>prefix</code> and <code>suffix</code> properties
|
||||
* Provides {@code prefix} and {@code suffix} properties
|
||||
* that help to classify/group performance monitoring results.
|
||||
*
|
||||
* <p>Subclasses should call the <code>createInvocationTraceName(MethodInvocation)</code>
|
||||
* <p>Subclasses should call the {@code createInvocationTraceName(MethodInvocation)}
|
||||
* method to create a name for the given trace that includes information about the
|
||||
* method invocation under trace along with the prefix and suffix added as appropriate.
|
||||
*
|
||||
|
@ -87,7 +87,7 @@ public abstract class AbstractMonitoringInterceptor extends AbstractTraceInterce
|
|||
|
||||
|
||||
/**
|
||||
* Create a <code>String</code> name for the given <code>MethodInvocation</code>
|
||||
* Create a {@code String} name for the given {@code MethodInvocation}
|
||||
* that can be used for trace/logging purposes. This name is made up of the
|
||||
* configured prefix, followed by the fully-qualified name of the method being
|
||||
* invoked, followed by the configured suffix.
|
||||
|
|
|
@ -26,16 +26,16 @@ import org.apache.commons.logging.LogFactory;
|
|||
import org.springframework.aop.support.AopUtils;
|
||||
|
||||
/**
|
||||
* Base <code>MethodInterceptor</code> implementation for tracing.
|
||||
* Base {@code MethodInterceptor} implementation for tracing.
|
||||
*
|
||||
* <p>By default, log messages are written to the log for the interceptor class,
|
||||
* not the class which is being intercepted. Setting the <code>useDynamicLogger</code>
|
||||
* bean property to <code>true</code> causes all log messages to be written to
|
||||
* the <code>Log</code> for the target class being intercepted.
|
||||
* not the class which is being intercepted. Setting the {@code useDynamicLogger}
|
||||
* bean property to {@code true} causes all log messages to be written to
|
||||
* the {@code Log} for the target class being intercepted.
|
||||
*
|
||||
* <p>Subclasses must implement the <code>invokeUnderTrace</code> method, which
|
||||
* <p>Subclasses must implement the {@code invokeUnderTrace} method, which
|
||||
* is invoked by this class ONLY when a particular invocation SHOULD be traced.
|
||||
* Subclasses should write to the <code>Log</code> instance provided.
|
||||
* Subclasses should write to the {@code Log} instance provided.
|
||||
*
|
||||
* @author Rob Harrop
|
||||
* @author Juergen Hoeller
|
||||
|
@ -46,8 +46,8 @@ import org.springframework.aop.support.AopUtils;
|
|||
public abstract class AbstractTraceInterceptor implements MethodInterceptor, Serializable {
|
||||
|
||||
/**
|
||||
* The default <code>Log</code> instance used to write trace messages.
|
||||
* This instance is mapped to the implementing <code>Class</code>.
|
||||
* The default {@code Log} instance used to write trace messages.
|
||||
* This instance is mapped to the implementing {@code Class}.
|
||||
*/
|
||||
protected transient Log defaultLogger = LogFactory.getLog(getClass());
|
||||
|
||||
|
@ -61,9 +61,9 @@ public abstract class AbstractTraceInterceptor implements MethodInterceptor, Ser
|
|||
/**
|
||||
* Set whether to use a dynamic logger or a static logger.
|
||||
* Default is a static logger for this trace interceptor.
|
||||
* <p>Used to determine which <code>Log</code> instance should be used to write
|
||||
* <p>Used to determine which {@code Log} instance should be used to write
|
||||
* log messages for a particular method invocation: a dynamic one for the
|
||||
* <code>Class</code> getting called, or a static one for the <code>Class</code>
|
||||
* {@code Class} getting called, or a static one for the {@code Class}
|
||||
* of the trace interceptor.
|
||||
* <p><b>NOTE:</b> Specify either this property or "loggerName", not both.
|
||||
* @see #getLoggerForInvocation(org.aopalliance.intercept.MethodInvocation)
|
||||
|
@ -99,9 +99,9 @@ public abstract class AbstractTraceInterceptor implements MethodInterceptor, Ser
|
|||
|
||||
|
||||
/**
|
||||
* Determines whether or not logging is enabled for the particular <code>MethodInvocation</code>.
|
||||
* Determines whether or not logging is enabled for the particular {@code MethodInvocation}.
|
||||
* If not, the method invocation proceeds as normal, otherwise the method invocation is passed
|
||||
* to the <code>invokeUnderTrace</code> method for handling.
|
||||
* to the {@code invokeUnderTrace} method for handling.
|
||||
* @see #invokeUnderTrace(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log)
|
||||
*/
|
||||
public Object invoke(MethodInvocation invocation) throws Throwable {
|
||||
|
@ -115,13 +115,13 @@ public abstract class AbstractTraceInterceptor implements MethodInterceptor, Ser
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the appropriate <code>Log</code> instance to use for the given
|
||||
* <code>MethodInvocation</code>. If the <code>useDynamicLogger</code> flag
|
||||
* is set, the <code>Log</code> instance will be for the target class of the
|
||||
* <code>MethodInvocation</code>, otherwise the <code>Log</code> will be the
|
||||
* Return the appropriate {@code Log} instance to use for the given
|
||||
* {@code MethodInvocation}. If the {@code useDynamicLogger} flag
|
||||
* is set, the {@code Log} instance will be for the target class of the
|
||||
* {@code MethodInvocation}, otherwise the {@code Log} will be the
|
||||
* default static logger.
|
||||
* @param invocation the <code>MethodInvocation</code> being traced
|
||||
* @return the <code>Log</code> instance to use
|
||||
* @param invocation the {@code MethodInvocation} being traced
|
||||
* @return the {@code Log} instance to use
|
||||
* @see #setUseDynamicLogger
|
||||
*/
|
||||
protected Log getLoggerForInvocation(MethodInvocation invocation) {
|
||||
|
@ -146,12 +146,12 @@ public abstract class AbstractTraceInterceptor implements MethodInterceptor, Ser
|
|||
|
||||
/**
|
||||
* Determine whether the interceptor should kick in, that is,
|
||||
* whether the <code>invokeUnderTrace</code> method should be called.
|
||||
* <p>Default behavior is to check whether the given <code>Log</code>
|
||||
* whether the {@code invokeUnderTrace} method should be called.
|
||||
* <p>Default behavior is to check whether the given {@code Log}
|
||||
* instance is enabled. Subclasses can override this to apply the
|
||||
* interceptor in other cases as well.
|
||||
* @param invocation the <code>MethodInvocation</code> being traced
|
||||
* @param logger the <code>Log</code> instance to check
|
||||
* @param invocation the {@code MethodInvocation} being traced
|
||||
* @param logger the {@code Log} instance to check
|
||||
* @see #invokeUnderTrace
|
||||
* @see #isLogEnabled
|
||||
*/
|
||||
|
@ -161,9 +161,9 @@ public abstract class AbstractTraceInterceptor implements MethodInterceptor, Ser
|
|||
|
||||
/**
|
||||
* Determine whether the given {@link Log} instance is enabled.
|
||||
* <p>Default is <code>true</code> when the "trace" level is enabled.
|
||||
* <p>Default is {@code true} when the "trace" level is enabled.
|
||||
* Subclasses can override this to change the level under which 'tracing' occurs.
|
||||
* @param logger the <code>Log</code> instance to check
|
||||
* @param logger the {@code Log} instance to check
|
||||
*/
|
||||
protected boolean isLogEnabled(Log logger) {
|
||||
return logger.isTraceEnabled();
|
||||
|
@ -172,16 +172,16 @@ public abstract class AbstractTraceInterceptor implements MethodInterceptor, Ser
|
|||
|
||||
/**
|
||||
* Subclasses must override this method to perform any tracing around the
|
||||
* supplied <code>MethodInvocation</code>. Subclasses are responsible for
|
||||
* ensuring that the <code>MethodInvocation</code> actually executes by
|
||||
* calling <code>MethodInvocation.proceed()</code>.
|
||||
* <p>By default, the passed-in <code>Log</code> instance will have log level
|
||||
* supplied {@code MethodInvocation}. Subclasses are responsible for
|
||||
* ensuring that the {@code MethodInvocation} actually executes by
|
||||
* calling {@code MethodInvocation.proceed()}.
|
||||
* <p>By default, the passed-in {@code Log} instance will have log level
|
||||
* "trace" enabled. Subclasses do not have to check for this again, unless
|
||||
* they overwrite the <code>isInterceptorEnabled</code> method to modify
|
||||
* they overwrite the {@code isInterceptorEnabled} method to modify
|
||||
* the default behavior.
|
||||
* @param logger the <code>Log</code> to write trace messages to
|
||||
* @return the result of the call to <code>MethodInvocation.proceed()</code>
|
||||
* @throws Throwable if the call to <code>MethodInvocation.proceed()</code>
|
||||
* @param logger the {@code Log} to write trace messages to
|
||||
* @return the result of the call to {@code MethodInvocation.proceed()}
|
||||
* @throws Throwable if the call to {@code MethodInvocation.proceed()}
|
||||
* encountered any errors
|
||||
* @see #isInterceptorEnabled
|
||||
* @see #isLogEnabled
|
||||
|
|
|
@ -30,19 +30,19 @@ import org.springframework.core.task.AsyncTaskExecutor;
|
|||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
/**
|
||||
* AOP Alliance <code>MethodInterceptor</code> that processes method invocations
|
||||
* AOP Alliance {@code MethodInterceptor} that processes method invocations
|
||||
* asynchronously, using a given {@link org.springframework.core.task.AsyncTaskExecutor}.
|
||||
* Typically used with the {@link org.springframework.scheduling.annotation.Async} annotation.
|
||||
*
|
||||
* <p>In terms of target method signatures, any parameter types are supported.
|
||||
* However, the return type is constrained to either <code>void</code> or
|
||||
* <code>java.util.concurrent.Future</code>. In the latter case, the Future handle
|
||||
* However, the return type is constrained to either {@code void} or
|
||||
* {@code java.util.concurrent.Future}. In the latter case, the Future handle
|
||||
* returned from the proxy will be an actual asynchronous Future that can be used
|
||||
* to track the result of the asynchronous method execution. However, since the
|
||||
* target method needs to implement the same signature, it will have to return
|
||||
* a temporary Future handle that just passes the return value through
|
||||
* (like Spring's {@link org.springframework.scheduling.annotation.AsyncResult}
|
||||
* or EJB 3.1's <code>javax.ejb.AsyncResult</code>).
|
||||
* or EJB 3.1's {@code javax.ejb.AsyncResult}).
|
||||
*
|
||||
* <p>As of Spring 3.1.2 the {@code AnnotationAsyncExecutionInterceptor} subclass is
|
||||
* preferred for use due to its support for executor qualification in conjunction with
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.springframework.util.StopWatch;
|
|||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* <code>MethodInterceptor</code> implementation that allows for highly customizable
|
||||
* {@code MethodInterceptor} implementation that allows for highly customizable
|
||||
* method-level tracing, using placeholders.
|
||||
*
|
||||
* <p>Trace messages are written on method entry, and if the method invocation succeeds
|
||||
|
@ -40,19 +40,19 @@ import org.springframework.util.StringUtils;
|
|||
* messages. The placeholders available are:
|
||||
*
|
||||
* <p><ul>
|
||||
* <li><code>$[methodName]</code> - replaced with the name of the method being invoked</li>
|
||||
* <li><code>$[targetClassName]</code> - replaced with the name of the class that is
|
||||
* <li>{@code $[methodName]} - replaced with the name of the method being invoked</li>
|
||||
* <li>{@code $[targetClassName]} - replaced with the name of the class that is
|
||||
* the target of the invocation</li>
|
||||
* <li><code>$[targetClassShortName]</code> - replaced with the short name of the class
|
||||
* <li>{@code $[targetClassShortName]} - replaced with the short name of the class
|
||||
* that is the target of the invocation</li>
|
||||
* <li><code>$[returnValue]</code> - replaced with the value returned by the invocation</li>
|
||||
* <li><code>$[argumentTypes]</code> - replaced with a comma-separated list of the
|
||||
* <li>{@code $[returnValue]} - replaced with the value returned by the invocation</li>
|
||||
* <li>{@code $[argumentTypes]} - replaced with a comma-separated list of the
|
||||
* short class names of the method arguments</li>
|
||||
* <li><code>$[arguments]</code> - replaced with a comma-separated list of the
|
||||
* <code>String</code> representation of the method arguments</li>
|
||||
* <li><code>$[exception]</code> - replaced with the <code>String</code> representation
|
||||
* of any <code>Throwable</code> raised during the invocation</li>
|
||||
* <li><code>$[invocationTime]</code> - replaced with the time, in milliseconds,
|
||||
* <li>{@code $[arguments]} - replaced with a comma-separated list of the
|
||||
* {@code String} representation of the method arguments</li>
|
||||
* <li>{@code $[exception]} - replaced with the {@code String} representation
|
||||
* of any {@code Throwable} raised during the invocation</li>
|
||||
* <li>{@code $[invocationTime]} - replaced with the time, in milliseconds,
|
||||
* taken by the method invocation</li>
|
||||
* </ul>
|
||||
*
|
||||
|
@ -70,56 +70,56 @@ import org.springframework.util.StringUtils;
|
|||
public class CustomizableTraceInterceptor extends AbstractTraceInterceptor {
|
||||
|
||||
/**
|
||||
* The <code>$[methodName]</code> placeholder.
|
||||
* The {@code $[methodName]} placeholder.
|
||||
* Replaced with the name of the method being invoked.
|
||||
*/
|
||||
public static final String PLACEHOLDER_METHOD_NAME = "$[methodName]";
|
||||
|
||||
/**
|
||||
* The <code>$[targetClassName]</code> placeholder.
|
||||
* Replaced with the fully-qualifed name of the <code>Class</code>
|
||||
* The {@code $[targetClassName]} placeholder.
|
||||
* Replaced with the fully-qualifed name of the {@code Class}
|
||||
* of the method invocation target.
|
||||
*/
|
||||
public static final String PLACEHOLDER_TARGET_CLASS_NAME = "$[targetClassName]";
|
||||
|
||||
/**
|
||||
* The <code>$[targetClassShortName]</code> placeholder.
|
||||
* Replaced with the short name of the <code>Class</code> of the
|
||||
* The {@code $[targetClassShortName]} placeholder.
|
||||
* Replaced with the short name of the {@code Class} of the
|
||||
* method invocation target.
|
||||
*/
|
||||
public static final String PLACEHOLDER_TARGET_CLASS_SHORT_NAME = "$[targetClassShortName]";
|
||||
|
||||
/**
|
||||
* The <code>$[returnValue]</code> placeholder.
|
||||
* Replaced with the <code>String</code> representation of the value
|
||||
* The {@code $[returnValue]} placeholder.
|
||||
* Replaced with the {@code String} representation of the value
|
||||
* returned by the method invocation.
|
||||
*/
|
||||
public static final String PLACEHOLDER_RETURN_VALUE = "$[returnValue]";
|
||||
|
||||
/**
|
||||
* The <code>$[argumentTypes]</code> placeholder.
|
||||
* The {@code $[argumentTypes]} placeholder.
|
||||
* Replaced with a comma-separated list of the argument types for the
|
||||
* method invocation. Argument types are written as short class names.
|
||||
*/
|
||||
public static final String PLACEHOLDER_ARGUMENT_TYPES = "$[argumentTypes]";
|
||||
|
||||
/**
|
||||
* The <code>$[arguments]</code> placeholder.
|
||||
* The {@code $[arguments]} placeholder.
|
||||
* Replaced with a comma separated list of the argument values for the
|
||||
* method invocation. Relies on the <code>toString()</code> method of
|
||||
* method invocation. Relies on the {@code toString()} method of
|
||||
* each argument type.
|
||||
*/
|
||||
public static final String PLACEHOLDER_ARGUMENTS = "$[arguments]";
|
||||
|
||||
/**
|
||||
* The <code>$[exception]</code> placeholder.
|
||||
* Replaced with the <code>String</code> representation of any
|
||||
* <code>Throwable</code> raised during method invocation.
|
||||
* The {@code $[exception]} placeholder.
|
||||
* Replaced with the {@code String} representation of any
|
||||
* {@code Throwable} raised during method invocation.
|
||||
*/
|
||||
public static final String PLACEHOLDER_EXCEPTION = "$[exception]";
|
||||
|
||||
/**
|
||||
* The <code>$[invocationTime]</code> placeholder.
|
||||
* The {@code $[invocationTime]} placeholder.
|
||||
* Replaced with the time taken by the invocation (in milliseconds).
|
||||
*/
|
||||
public static final String PLACEHOLDER_INVOCATION_TIME = "$[invocationTime]";
|
||||
|
@ -143,12 +143,12 @@ public class CustomizableTraceInterceptor extends AbstractTraceInterceptor {
|
|||
"Exception thrown in method '" + PLACEHOLDER_METHOD_NAME + "' of class [" + PLACEHOLDER_TARGET_CLASS_NAME + "]";
|
||||
|
||||
/**
|
||||
* The <code>Pattern</code> used to match placeholders.
|
||||
* The {@code Pattern} used to match placeholders.
|
||||
*/
|
||||
private static final Pattern PATTERN = Pattern.compile("\\$\\[\\p{Alpha}+\\]");
|
||||
|
||||
/**
|
||||
* The <code>Set</code> of allowed placeholders.
|
||||
* The {@code Set} of allowed placeholders.
|
||||
*/
|
||||
private static final Set ALLOWED_PLACEHOLDERS =
|
||||
new Constants(CustomizableTraceInterceptor.class).getValues("PLACEHOLDER_");
|
||||
|
@ -174,10 +174,10 @@ public class CustomizableTraceInterceptor extends AbstractTraceInterceptor {
|
|||
* Set the template used for method entry log messages.
|
||||
* This template can contain any of the following placeholders:
|
||||
* <ul>
|
||||
* <li><code>$[targetClassName]</code></li>
|
||||
* <li><code>$[targetClassShortName]</code></li>
|
||||
* <li><code>$[argumentTypes]</code></li>
|
||||
* <li><code>$[arguments]</code></li>
|
||||
* <li>{@code $[targetClassName]}</li>
|
||||
* <li>{@code $[targetClassShortName]}</li>
|
||||
* <li>{@code $[argumentTypes]}</li>
|
||||
* <li>{@code $[arguments]}</li>
|
||||
* </ul>
|
||||
*/
|
||||
public void setEnterMessage(String enterMessage) throws IllegalArgumentException {
|
||||
|
@ -196,12 +196,12 @@ public class CustomizableTraceInterceptor extends AbstractTraceInterceptor {
|
|||
* Set the template used for method exit log messages.
|
||||
* This template can contain any of the following placeholders:
|
||||
* <ul>
|
||||
* <li><code>$[targetClassName]</code></li>
|
||||
* <li><code>$[targetClassShortName]</code></li>
|
||||
* <li><code>$[argumentTypes]</code></li>
|
||||
* <li><code>$[arguments]</code></li>
|
||||
* <li><code>$[returnValue]</code></li>
|
||||
* <li><code>$[invocationTime]</code></li>
|
||||
* <li>{@code $[targetClassName]}</li>
|
||||
* <li>{@code $[targetClassShortName]}</li>
|
||||
* <li>{@code $[argumentTypes]}</li>
|
||||
* <li>{@code $[arguments]}</li>
|
||||
* <li>{@code $[returnValue]}</li>
|
||||
* <li>{@code $[invocationTime]}</li>
|
||||
* </ul>
|
||||
*/
|
||||
public void setExitMessage(String exitMessage) {
|
||||
|
@ -216,11 +216,11 @@ public class CustomizableTraceInterceptor extends AbstractTraceInterceptor {
|
|||
* Set the template used for method exception log messages.
|
||||
* This template can contain any of the following placeholders:
|
||||
* <ul>
|
||||
* <li><code>$[targetClassName]</code></li>
|
||||
* <li><code>$[targetClassShortName]</code></li>
|
||||
* <li><code>$[argumentTypes]</code></li>
|
||||
* <li><code>$[arguments]</code></li>
|
||||
* <li><code>$[exception]</code></li>
|
||||
* <li>{@code $[targetClassName]}</li>
|
||||
* <li>{@code $[targetClassShortName]}</li>
|
||||
* <li>{@code $[argumentTypes]}</li>
|
||||
* <li>{@code $[arguments]}</li>
|
||||
* <li>{@code $[exception]}</li>
|
||||
* </ul>
|
||||
*/
|
||||
public void setExceptionMessage(String exceptionMessage) {
|
||||
|
@ -235,10 +235,10 @@ public class CustomizableTraceInterceptor extends AbstractTraceInterceptor {
|
|||
|
||||
|
||||
/**
|
||||
* Writes a log message before the invocation based on the value of <code>enterMessage</code>.
|
||||
* Writes a log message before the invocation based on the value of {@code enterMessage}.
|
||||
* If the invocation succeeds, then a log message is written on exit based on the value
|
||||
* <code>exitMessage</code>. If an exception occurs during invocation, then a message is
|
||||
* written based on the value of <code>exceptionMessage</code>.
|
||||
* {@code exitMessage}. If an exception occurs during invocation, then a message is
|
||||
* written based on the value of {@code exceptionMessage}.
|
||||
* @see #setEnterMessage
|
||||
* @see #setExitMessage
|
||||
* @see #setExceptionMessage
|
||||
|
@ -277,7 +277,7 @@ public class CustomizableTraceInterceptor extends AbstractTraceInterceptor {
|
|||
}
|
||||
|
||||
/**
|
||||
* Writes the supplied message to the supplied <code>Log</code> instance.
|
||||
* Writes the supplied message to the supplied {@code Log} instance.
|
||||
* @see #writeToLog(org.apache.commons.logging.Log, String, Throwable)
|
||||
*/
|
||||
protected void writeToLog(Log logger, String message) {
|
||||
|
@ -286,8 +286,8 @@ public class CustomizableTraceInterceptor extends AbstractTraceInterceptor {
|
|||
|
||||
/**
|
||||
* Writes the supplied message and {@link Throwable} to the
|
||||
* supplied <code>Log</code> instance. By default messages are written
|
||||
* at <code>TRACE</code> level. Sub-classes can override this method
|
||||
* supplied {@code Log} instance. By default messages are written
|
||||
* at {@code TRACE} level. Sub-classes can override this method
|
||||
* to control which level the message is written at.
|
||||
*/
|
||||
protected void writeToLog(Log logger, String message, Throwable ex) {
|
||||
|
@ -303,16 +303,16 @@ public class CustomizableTraceInterceptor extends AbstractTraceInterceptor {
|
|||
* Replace the placeholders in the given message with the supplied values,
|
||||
* or values derived from those supplied.
|
||||
* @param message the message template containing the placeholders to be replaced
|
||||
* @param methodInvocation the <code>MethodInvocation</code> being logged.
|
||||
* Used to derive values for all placeholders except <code>$[exception]</code>
|
||||
* and <code>$[returnValue]</code>.
|
||||
* @param methodInvocation the {@code MethodInvocation} being logged.
|
||||
* Used to derive values for all placeholders except {@code $[exception]}
|
||||
* and {@code $[returnValue]}.
|
||||
* @param returnValue any value returned by the invocation.
|
||||
* Used to replace the <code>$[returnValue]</code> placeholder. May be <code>null</code>.
|
||||
* @param throwable any <code>Throwable</code> raised during the invocation.
|
||||
* The value of <code>Throwable.toString()</code> is replaced for the
|
||||
* <code>$[exception]</code> placeholder. May be <code>null</code>.
|
||||
* Used to replace the {@code $[returnValue]} placeholder. May be {@code null}.
|
||||
* @param throwable any {@code Throwable} raised during the invocation.
|
||||
* The value of {@code Throwable.toString()} is replaced for the
|
||||
* {@code $[exception]} placeholder. May be {@code null}.
|
||||
* @param invocationTime the value to write in place of the
|
||||
* <code>$[invocationTime]</code> placeholder
|
||||
* {@code $[invocationTime]} placeholder
|
||||
* @return the formatted output to write to the log
|
||||
*/
|
||||
protected String replacePlaceholders(String message, MethodInvocation methodInvocation,
|
||||
|
@ -360,12 +360,12 @@ public class CustomizableTraceInterceptor extends AbstractTraceInterceptor {
|
|||
}
|
||||
|
||||
/**
|
||||
* Adds the <code>String</code> representation of the method return value
|
||||
* to the supplied <code>StringBuffer</code>. Correctly handles
|
||||
* <code>null</code> and <code>void</code> results.
|
||||
* @param methodInvocation the <code>MethodInvocation</code> that returned the value
|
||||
* @param matcher the <code>Matcher</code> containing the matched placeholder
|
||||
* @param output the <code>StringBuffer</code> to write output to
|
||||
* Adds the {@code String} representation of the method return value
|
||||
* to the supplied {@code StringBuffer}. Correctly handles
|
||||
* {@code null} and {@code void} results.
|
||||
* @param methodInvocation the {@code MethodInvocation} that returned the value
|
||||
* @param matcher the {@code Matcher} containing the matched placeholder
|
||||
* @param output the {@code StringBuffer} to write output to
|
||||
* @param returnValue the value returned by the method invocation.
|
||||
*/
|
||||
private void appendReturnValue(
|
||||
|
@ -383,14 +383,14 @@ public class CustomizableTraceInterceptor extends AbstractTraceInterceptor {
|
|||
}
|
||||
|
||||
/**
|
||||
* Adds a comma-separated list of the short <code>Class</code> names of the
|
||||
* Adds a comma-separated list of the short {@code Class} names of the
|
||||
* method argument types to the output. For example, if a method has signature
|
||||
* <code>put(java.lang.String, java.lang.Object)</code> then the value returned
|
||||
* will be <code>String, Object</code>.
|
||||
* @param methodInvocation the <code>MethodInvocation</code> being logged.
|
||||
* Arguments will be retrieved from the corresponding <code>Method</code>.
|
||||
* @param matcher the <code>Matcher</code> containing the state of the output
|
||||
* @param output the <code>StringBuffer</code> containing the output
|
||||
* {@code put(java.lang.String, java.lang.Object)} then the value returned
|
||||
* will be {@code String, Object}.
|
||||
* @param methodInvocation the {@code MethodInvocation} being logged.
|
||||
* Arguments will be retrieved from the corresponding {@code Method}.
|
||||
* @param matcher the {@code Matcher} containing the state of the output
|
||||
* @param output the {@code StringBuffer} containing the output
|
||||
*/
|
||||
private void appendArgumentTypes(MethodInvocation methodInvocation, Matcher matcher, StringBuffer output) {
|
||||
Class[] argumentTypes = methodInvocation.getMethod().getParameterTypes();
|
||||
|
@ -402,9 +402,9 @@ public class CustomizableTraceInterceptor extends AbstractTraceInterceptor {
|
|||
}
|
||||
|
||||
/**
|
||||
* Checks to see if the supplied <code>String</code> has any placeholders
|
||||
* Checks to see if the supplied {@code String} has any placeholders
|
||||
* that are not specified as constants on this class and throws an
|
||||
* <code>IllegalArgumentException</code> if so.
|
||||
* {@code IllegalArgumentException} if so.
|
||||
*/
|
||||
private void checkForInvalidPlaceholders(String message) throws IllegalArgumentException {
|
||||
Matcher matcher = PATTERN.matcher(message);
|
||||
|
@ -417,8 +417,8 @@ public class CustomizableTraceInterceptor extends AbstractTraceInterceptor {
|
|||
}
|
||||
|
||||
/**
|
||||
* Replaces <code>$</code> in inner class names with <code>\$</code>.
|
||||
* <p>This code is equivalent to JDK 1.5's <code>quoteReplacement</code>
|
||||
* Replaces {@code $} in inner class names with {@code \$}.
|
||||
* <p>This code is equivalent to JDK 1.5's {@code quoteReplacement}
|
||||
* method in the Matcher class itself. We're keeping our own version
|
||||
* here for JDK 1.4 compliance reasons only.
|
||||
*/
|
||||
|
|
|
@ -19,13 +19,13 @@ package org.springframework.aop.interceptor;
|
|||
import org.aopalliance.intercept.MethodInvocation;
|
||||
|
||||
/**
|
||||
* AOP Alliance <code>MethodInterceptor</code> that can be introduced in a chain
|
||||
* AOP Alliance {@code MethodInterceptor} that can be introduced in a chain
|
||||
* to display verbose information about intercepted invocations to the logger.
|
||||
*
|
||||
* <p>Logs full invocation details on method entry and method exit,
|
||||
* including invocation arguments and invocation count. This is only
|
||||
* intended for debugging purposes; use <code>SimpleTraceInterceptor</code>
|
||||
* or <code>CustomizableTraceInterceptor</code> for pure tracing purposes.
|
||||
* intended for debugging purposes; use {@code SimpleTraceInterceptor}
|
||||
* or {@code CustomizableTraceInterceptor} for pure tracing purposes.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @author Juergen Hoeller
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.springframework.beans.factory.NamedBean;
|
|||
/**
|
||||
* Convenient methods for creating advisors that may be used when autoproxying beans
|
||||
* created with the Spring IoC container, binding the bean name to the current
|
||||
* invocation. May support a <code>bean()</code> pointcut designator with AspectJ.
|
||||
* invocation. May support a {@code bean()} pointcut designator with AspectJ.
|
||||
*
|
||||
* <p>Typically used in Spring auto-proxying, where the bean name is known
|
||||
* at proxy creation time.
|
||||
|
@ -52,7 +52,7 @@ public abstract class ExposeBeanNameAdvisors {
|
|||
* Find the bean name for the current invocation. Assumes that an ExposeBeanNameAdvisor
|
||||
* has been included in the interceptor chain, and that the invocation is exposed
|
||||
* with ExposeInvocationInterceptor.
|
||||
* @return the bean name (never <code>null</code>)
|
||||
* @return the bean name (never {@code null})
|
||||
* @throws IllegalStateException if the bean name has not been exposed
|
||||
*/
|
||||
public static String getBeanName() throws IllegalStateException {
|
||||
|
@ -63,7 +63,7 @@ public abstract class ExposeBeanNameAdvisors {
|
|||
* Find the bean name for the given invocation. Assumes that an ExposeBeanNameAdvisor
|
||||
* has been included in the interceptor chain.
|
||||
* @param mi MethodInvocation that should contain the bean name as an attribute
|
||||
* @return the bean name (never <code>null</code>)
|
||||
* @return the bean name (never {@code null})
|
||||
* @throws IllegalStateException if the bean name has not been exposed
|
||||
*/
|
||||
public static String getBeanName(MethodInvocation mi) throws IllegalStateException {
|
||||
|
|
|
@ -101,7 +101,7 @@ public class ExposeInvocationInterceptor implements MethodInterceptor, Ordered,
|
|||
/**
|
||||
* Required to support serialization. Replaces with canonical instance
|
||||
* on deserialization, protecting Singleton pattern.
|
||||
* <p>Alternative to overriding the <code>equals</code> method.
|
||||
* <p>Alternative to overriding the {@code equals} method.
|
||||
*/
|
||||
private Object readResolve() {
|
||||
return INSTANCE;
|
||||
|
|
|
@ -22,10 +22,10 @@ import org.apache.commons.logging.Log;
|
|||
import org.springframework.util.StopWatch;
|
||||
|
||||
/**
|
||||
* Simple AOP Alliance <code>MethodInterceptor</code> for performance monitoring.
|
||||
* Simple AOP Alliance {@code MethodInterceptor} for performance monitoring.
|
||||
* This interceptor has no effect on the intercepted method call.
|
||||
*
|
||||
* <p>Uses a <code>StopWatch</code> for the actual performance measuring.
|
||||
* <p>Uses a {@code StopWatch} for the actual performance measuring.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @author Dmitriy Kopylenko
|
||||
|
|
|
@ -20,11 +20,11 @@ import org.aopalliance.intercept.MethodInvocation;
|
|||
import org.apache.commons.logging.Log;
|
||||
|
||||
/**
|
||||
* Simple AOP Alliance <code>MethodInterceptor</code> that can be introduced
|
||||
* Simple AOP Alliance {@code MethodInterceptor} that can be introduced
|
||||
* in a chain to display verbose trace information about intercepted method
|
||||
* invocations, with method entry and method exit info.
|
||||
*
|
||||
* <p>Consider using <code>CustomizableTraceInterceptor</code> for more
|
||||
* <p>Consider using {@code CustomizableTraceInterceptor} for more
|
||||
* advanced needs.
|
||||
*
|
||||
* @author Dmitriy Kopylenko
|
||||
|
|
|
@ -46,7 +46,7 @@ public abstract class AbstractExpressionPointcut implements ExpressionPointcut,
|
|||
* Return location information about the pointcut expression
|
||||
* if available. This is useful in debugging.
|
||||
* @return location information as a human-readable String,
|
||||
* or <code>null</code> if none is available
|
||||
* or {@code null} if none is available
|
||||
*/
|
||||
public String getLocation() {
|
||||
return this.location;
|
||||
|
|
|
@ -34,8 +34,8 @@ import org.springframework.util.StringUtils;
|
|||
* </ul>
|
||||
*
|
||||
* <p>Note: the regular expressions must be a match. For example,
|
||||
* <code>.*get.*</code> will match com.mycom.Foo.getBar().
|
||||
* <code>get.*</code> will not.
|
||||
* {@code .*get.*} will match com.mycom.Foo.getBar().
|
||||
* {@code get.*} will not.
|
||||
*
|
||||
* <p>This base class is serializable. Subclasses should declare all fields transient
|
||||
* - the initPatternRepresentation method in this class will be invoked again on the
|
||||
|
@ -172,17 +172,17 @@ public abstract class AbstractRegexpMethodPointcut extends StaticMethodMatcherPo
|
|||
|
||||
/**
|
||||
* Does the pattern at the given index match this string?
|
||||
* @param pattern <code>String</code> pattern to match
|
||||
* @param pattern {@code String} pattern to match
|
||||
* @param patternIndex index of pattern from 0
|
||||
* @return <code>true</code> if there is a match, else <code>false</code>.
|
||||
* @return {@code true} if there is a match, else {@code false}.
|
||||
*/
|
||||
protected abstract boolean matches(String pattern, int patternIndex);
|
||||
|
||||
/**
|
||||
* Does the exclusion pattern at the given index match this string?
|
||||
* @param pattern <code>String</code> pattern to match.
|
||||
* @param pattern {@code String} pattern to match.
|
||||
* @param patternIndex index of pattern starting from 0.
|
||||
* @return <code>true</code> if there is a match, else <code>false</code>.
|
||||
* @return {@code true} if there is a match, else {@code false}.
|
||||
*/
|
||||
protected abstract boolean matchesExclusion(String pattern, int patternIndex);
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ public abstract class AopUtils {
|
|||
* <p>Returns the target class for an AOP proxy and the plain class else.
|
||||
* @param candidate the instance to check (might be an AOP proxy)
|
||||
* @return the target class (or the plain class of the given object as fallback;
|
||||
* never <code>null</code>)
|
||||
* never {@code null})
|
||||
* @see org.springframework.aop.TargetClassAware#getTargetClass()
|
||||
* @see org.springframework.aop.framework.AopProxyUtils#ultimateTargetClass(Object)
|
||||
*/
|
||||
|
@ -161,17 +161,17 @@ public abstract class AopUtils {
|
|||
/**
|
||||
* Given a method, which may come from an interface, and a target class used
|
||||
* in the current AOP invocation, find the corresponding target method if there
|
||||
* is one. E.g. the method may be <code>IFoo.bar()</code> and the target class
|
||||
* may be <code>DefaultFoo</code>. In this case, the method may be
|
||||
* <code>DefaultFoo.bar()</code>. This enables attributes on that method to be found.
|
||||
* is one. E.g. the method may be {@code IFoo.bar()} and the target class
|
||||
* may be {@code DefaultFoo}. In this case, the method may be
|
||||
* {@code DefaultFoo.bar()}. This enables attributes on that method to be found.
|
||||
* <p><b>NOTE:</b> In contrast to {@link org.springframework.util.ClassUtils#getMostSpecificMethod},
|
||||
* this method resolves Java 5 bridge methods in order to retrieve attributes
|
||||
* from the <i>original</i> method definition.
|
||||
* @param method the method to be invoked, which may come from an interface
|
||||
* @param targetClass the target class for the current invocation.
|
||||
* May be <code>null</code> or may not even implement the method.
|
||||
* May be {@code null} or may not even implement the method.
|
||||
* @return the specific target method, or the original method if the
|
||||
* <code>targetClass</code> doesn't implement it or is <code>null</code>
|
||||
* {@code targetClass} doesn't implement it or is {@code null}
|
||||
* @see org.springframework.util.ClassUtils#getMostSpecificMethod
|
||||
*/
|
||||
public static Method getMostSpecificMethod(Method method, Class<?> targetClass) {
|
||||
|
@ -268,7 +268,7 @@ public abstract class AopUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Determine the sublist of the <code>candidateAdvisors</code> list
|
||||
* Determine the sublist of the {@code candidateAdvisors} list
|
||||
* that is applicable to the given class.
|
||||
* @param candidateAdvisors the Advisors to evaluate
|
||||
* @param clazz the target class
|
||||
|
|
|
@ -28,9 +28,9 @@ import org.springframework.util.ObjectUtils;
|
|||
* Convenient class for building up pointcuts. All methods return
|
||||
* ComposablePointcut, so we can use a concise idiom like:
|
||||
*
|
||||
* <code>
|
||||
* {@code
|
||||
* Pointcut pc = new ComposablePointcut().union(classFilter).intersection(methodMatcher).intersection(pointcut);
|
||||
* </code>
|
||||
* }
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @author Juergen Hoeller
|
||||
|
@ -49,8 +49,8 @@ public class ComposablePointcut implements Pointcut, Serializable {
|
|||
|
||||
|
||||
/**
|
||||
* Create a default ComposablePointcut, with <code>ClassFilter.TRUE</code>
|
||||
* and <code>MethodMatcher.TRUE</code>.
|
||||
* Create a default ComposablePointcut, with {@code ClassFilter.TRUE}
|
||||
* and {@code MethodMatcher.TRUE}.
|
||||
*/
|
||||
public ComposablePointcut() {
|
||||
this.classFilter = ClassFilter.TRUE;
|
||||
|
@ -69,7 +69,7 @@ public class ComposablePointcut implements Pointcut, Serializable {
|
|||
|
||||
/**
|
||||
* Create a ComposablePointcut for the given ClassFilter,
|
||||
* with <code>MethodMatcher.TRUE</code>.
|
||||
* with {@code MethodMatcher.TRUE}.
|
||||
* @param classFilter the ClassFilter to use
|
||||
*/
|
||||
public ComposablePointcut(ClassFilter classFilter) {
|
||||
|
@ -80,7 +80,7 @@ public class ComposablePointcut implements Pointcut, Serializable {
|
|||
|
||||
/**
|
||||
* Create a ComposablePointcut for the given MethodMatcher,
|
||||
* with <code>ClassFilter.TRUE</code>.
|
||||
* with {@code ClassFilter.TRUE}.
|
||||
* @param methodMatcher the MethodMatcher to use
|
||||
*/
|
||||
public ComposablePointcut(MethodMatcher methodMatcher) {
|
||||
|
|
|
@ -39,7 +39,7 @@ public class DefaultBeanFactoryPointcutAdvisor extends AbstractBeanFactoryPointc
|
|||
|
||||
/**
|
||||
* Specify the pointcut targeting the advice.
|
||||
* <p>Default is <code>Pointcut.TRUE</code>.
|
||||
* <p>Default is {@code Pointcut.TRUE}.
|
||||
* @see #setAdviceBeanName
|
||||
*/
|
||||
public void setPointcut(Pointcut pointcut) {
|
||||
|
|
|
@ -62,7 +62,7 @@ public class DefaultIntroductionAdvisor implements IntroductionAdvisor, ClassFil
|
|||
* Create a DefaultIntroductionAdvisor for the given advice.
|
||||
* @param advice the Advice to apply
|
||||
* @param introductionInfo the IntroductionInfo that describes
|
||||
* the interface to introduce (may be <code>null</code>)
|
||||
* the interface to introduce (may be {@code null})
|
||||
*/
|
||||
public DefaultIntroductionAdvisor(Advice advice, IntroductionInfo introductionInfo) {
|
||||
Assert.notNull(advice, "Advice must not be null");
|
||||
|
|
|
@ -42,14 +42,14 @@ public class DefaultPointcutAdvisor extends AbstractGenericPointcutAdvisor imple
|
|||
/**
|
||||
* Create an empty DefaultPointcutAdvisor.
|
||||
* <p>Advice must be set before use using setter methods.
|
||||
* Pointcut will normally be set also, but defaults to <code>Pointcut.TRUE</code>.
|
||||
* Pointcut will normally be set also, but defaults to {@code Pointcut.TRUE}.
|
||||
*/
|
||||
public DefaultPointcutAdvisor() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a DefaultPointcutAdvisor that matches all methods.
|
||||
* <p><code>Pointcut.TRUE</code> will be used as Pointcut.
|
||||
* <p>{@code Pointcut.TRUE} will be used as Pointcut.
|
||||
* @param advice the Advice to use
|
||||
*/
|
||||
public DefaultPointcutAdvisor(Advice advice) {
|
||||
|
@ -69,7 +69,7 @@ public class DefaultPointcutAdvisor extends AbstractGenericPointcutAdvisor imple
|
|||
|
||||
/**
|
||||
* Specify the pointcut targeting the advice.
|
||||
* <p>Default is <code>Pointcut.TRUE</code>.
|
||||
* <p>Default is {@code Pointcut.TRUE}.
|
||||
* @see #setAdvice
|
||||
*/
|
||||
public void setPointcut(Pointcut pointcut) {
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.springframework.aop.ProxyMethodInvocation;
|
|||
* object will have its <i>own</i> delegate (whereas DelegatingIntroductionInterceptor
|
||||
* shares the same delegate, and hence the same state across all targets).
|
||||
*
|
||||
* <p>The <code>suppressInterface</code> method can be used to suppress interfaces
|
||||
* <p>The {@code suppressInterface} method can be used to suppress interfaces
|
||||
* implemented by the delegate class but which should not be introduced to the
|
||||
* owning AOP proxy.
|
||||
*
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.springframework.util.Assert;
|
|||
* All interfaces except IntroductionInterceptor are picked up from
|
||||
* the subclass or delegate by default.
|
||||
*
|
||||
* <p>The <code>suppressInterface</code> method can be used to suppress interfaces
|
||||
* <p>The {@code suppressInterface} method can be used to suppress interfaces
|
||||
* implemented by the delegate but which should not be introduced to the owning
|
||||
* AOP proxy.
|
||||
*
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.util.regex.Pattern;
|
|||
import java.util.regex.PatternSyntaxException;
|
||||
|
||||
/**
|
||||
* Regular expression pointcut based on the <code>java.util.regex</code> package.
|
||||
* Regular expression pointcut based on the {@code java.util.regex} package.
|
||||
* Supports the following JavaBean properties:
|
||||
* <ul>
|
||||
* <li>pattern: regular expression for the fully-qualified method names to match
|
||||
|
@ -30,8 +30,8 @@ import java.util.regex.PatternSyntaxException;
|
|||
* </ul>
|
||||
*
|
||||
* <p>Note: the regular expressions must be a match. For example,
|
||||
* <code>.*get.*</code> will match com.mycom.Foo.getBar().
|
||||
* <code>get.*</code> will not.
|
||||
* {@code .*get.*} will match com.mycom.Foo.getBar().
|
||||
* {@code get.*} will not.
|
||||
*
|
||||
* @author Dmitriy Kopylenko
|
||||
* @author Rob Harrop
|
||||
|
@ -51,7 +51,7 @@ public class JdkRegexpMethodPointcut extends AbstractRegexpMethodPointcut {
|
|||
|
||||
|
||||
/**
|
||||
* Initialize {@link Pattern Patterns} from the supplied <code>String[]</code>.
|
||||
* Initialize {@link Pattern Patterns} from the supplied {@code String[]}.
|
||||
*/
|
||||
@Override
|
||||
protected void initPatternRepresentation(String[] patterns) throws PatternSyntaxException {
|
||||
|
@ -59,7 +59,7 @@ public class JdkRegexpMethodPointcut extends AbstractRegexpMethodPointcut {
|
|||
}
|
||||
|
||||
/**
|
||||
* Initialize exclusion {@link Pattern Patterns} from the supplied <code>String[]</code>.
|
||||
* Initialize exclusion {@link Pattern Patterns} from the supplied {@code String[]}.
|
||||
*/
|
||||
@Override
|
||||
protected void initExcludedPatternRepresentation(String[] excludedPatterns) throws PatternSyntaxException {
|
||||
|
@ -67,8 +67,8 @@ public class JdkRegexpMethodPointcut extends AbstractRegexpMethodPointcut {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the {@link Pattern} at index <code>patternIndex</code>
|
||||
* matches the supplied candidate <code>String</code>.
|
||||
* Returns {@code true} if the {@link Pattern} at index {@code patternIndex}
|
||||
* matches the supplied candidate {@code String}.
|
||||
*/
|
||||
@Override
|
||||
protected boolean matches(String pattern, int patternIndex) {
|
||||
|
@ -77,8 +77,8 @@ public class JdkRegexpMethodPointcut extends AbstractRegexpMethodPointcut {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the exclusion {@link Pattern} at index <code>patternIndex</code>
|
||||
* matches the supplied candidate <code>String</code>.
|
||||
* Returns {@code true} if the exclusion {@link Pattern} at index {@code patternIndex}
|
||||
* matches the supplied candidate {@code String}.
|
||||
*/
|
||||
@Override
|
||||
protected boolean matchesExclusion(String candidate, int patternIndex) {
|
||||
|
@ -88,7 +88,7 @@ public class JdkRegexpMethodPointcut extends AbstractRegexpMethodPointcut {
|
|||
|
||||
|
||||
/**
|
||||
* Compiles the supplied <code>String[]</code> into an array of
|
||||
* Compiles the supplied {@code String[]} into an array of
|
||||
* {@link Pattern} objects and returns that array.
|
||||
*/
|
||||
private Pattern[] compilePatterns(String[] source) throws PatternSyntaxException {
|
||||
|
|
|
@ -82,10 +82,10 @@ public abstract class MethodMatchers {
|
|||
* (if applicable).
|
||||
* @param mm the MethodMatcher to apply (may be an IntroductionAwareMethodMatcher)
|
||||
* @param method the candidate method
|
||||
* @param targetClass the target class (may be <code>null</code>, in which case
|
||||
* @param targetClass the target class (may be {@code null}, in which case
|
||||
* the candidate class must be taken to be the method's declaring class)
|
||||
* @param hasIntroductions <code>true</code> if the object on whose behalf we are
|
||||
* asking is the subject on one or more introductions; <code>false</code> otherwise
|
||||
* @param hasIntroductions {@code true} if the object on whose behalf we are
|
||||
* asking is the subject on one or more introductions; {@code false} otherwise
|
||||
* @return whether or not this method matches statically
|
||||
*/
|
||||
public static boolean matches(MethodMatcher mm, Method method, Class targetClass, boolean hasIntroductions) {
|
||||
|
|
|
@ -42,7 +42,7 @@ public class NameMatchMethodPointcut extends StaticMethodMatcherPointcut impleme
|
|||
|
||||
/**
|
||||
* Convenience method when we have only a single method name to match.
|
||||
* Use either this method or <code>setMappedNames</code>, not both.
|
||||
* Use either this method or {@code setMappedNames}, not both.
|
||||
* @see #setMappedNames
|
||||
*/
|
||||
public void setMappedName(String mappedName) {
|
||||
|
|
|
@ -53,7 +53,7 @@ public class NameMatchMethodPointcutAdvisor extends AbstractGenericPointcutAdvis
|
|||
|
||||
/**
|
||||
* Convenience method when we have only a single method name to match.
|
||||
* Use either this method or <code>setMappedNames</code>, not both.
|
||||
* Use either this method or {@code setMappedNames}, not both.
|
||||
* @see #setMappedNames
|
||||
* @see NameMatchMethodPointcut#setMappedName
|
||||
*/
|
||||
|
|
|
@ -128,7 +128,7 @@ public class RegexpMethodPointcutAdvisor extends AbstractGenericPointcutAdvisor
|
|||
/**
|
||||
* Create the actual pointcut: By default, a {@link JdkRegexpMethodPointcut}
|
||||
* will be used.
|
||||
* @return the Pointcut instance (never <code>null</code>)
|
||||
* @return the Pointcut instance (never {@code null})
|
||||
*/
|
||||
protected AbstractRegexpMethodPointcut createPointcut() {
|
||||
return new JdkRegexpMethodPointcut();
|
||||
|
|
|
@ -64,9 +64,9 @@ public class AnnotationMatchingPointcut implements Pointcut {
|
|||
/**
|
||||
* Create a new AnnotationMatchingPointcut for the given annotation type.
|
||||
* @param classAnnotationType the annotation type to look for at the class level
|
||||
* (can be <code>null</code>)
|
||||
* (can be {@code null})
|
||||
* @param methodAnnotationType the annotation type to look for at the method level
|
||||
* (can be <code>null</code>)
|
||||
* (can be {@code null})
|
||||
*/
|
||||
public AnnotationMatchingPointcut(
|
||||
Class<? extends Annotation> classAnnotationType, Class<? extends Annotation> methodAnnotationType) {
|
||||
|
|
|
@ -94,8 +94,8 @@ public abstract class AbstractBeanFactoryBasedTargetSource
|
|||
/**
|
||||
* Specify the target class explicitly, to avoid any kind of access to the
|
||||
* target bean (for example, to avoid initialization of a FactoryBean instance).
|
||||
* <p>Default is to detect the type automatically, through a <code>getType</code>
|
||||
* call on the BeanFactory (or even a full <code>getBean</code> call as fallback).
|
||||
* <p>Default is to detect the type automatically, through a {@code getType}
|
||||
* call on the BeanFactory (or even a full {@code getBean} call as fallback).
|
||||
*/
|
||||
public void setTargetClass(Class targetClass) {
|
||||
this.targetClass = targetClass;
|
||||
|
@ -103,7 +103,7 @@ public abstract class AbstractBeanFactoryBasedTargetSource
|
|||
|
||||
/**
|
||||
* Set the owning BeanFactory. We need to save a reference so that we can
|
||||
* use the <code>getBean</code> method on every invocation.
|
||||
* use the {@code getBean} method on every invocation.
|
||||
*/
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
if (this.targetBeanName == null) {
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.springframework.aop.TargetSource;
|
|||
* lazily create a user-managed object.
|
||||
*
|
||||
* <p>Creation of the lazy target object is controlled by the user by implementing
|
||||
* the {@link #createObject()} method. This <code>TargetSource</code> will invoke
|
||||
* the {@link #createObject()} method. This {@code TargetSource} will invoke
|
||||
* this method the first time the proxy is accessed.
|
||||
*
|
||||
* <p>Useful when you need to pass a reference to some dependency to an object
|
||||
|
@ -57,11 +57,11 @@ public abstract class AbstractLazyCreationTargetSource implements TargetSource {
|
|||
}
|
||||
|
||||
/**
|
||||
* This default implementation returns <code>null</code> if the
|
||||
* target is <code>null</code> (it is hasn't yet been initialized),
|
||||
* This default implementation returns {@code null} if the
|
||||
* target is {@code null} (it is hasn't yet been initialized),
|
||||
* or the target class if the target has already been initialized.
|
||||
* <p>Subclasses may wish to override this method in order to provide
|
||||
* a meaningful value when the target is still <code>null</code>.
|
||||
* a meaningful value when the target is still {@code null}.
|
||||
* @see #isInitialized()
|
||||
*/
|
||||
public synchronized Class<?> getTargetClass() {
|
||||
|
|
|
@ -102,7 +102,7 @@ public abstract class AbstractPoolingTargetSource extends AbstractPrototypeBased
|
|||
/**
|
||||
* Return the given object to the pool.
|
||||
* @param target object that must have been acquired from the pool
|
||||
* via a call to <code>getTarget()</code>
|
||||
* via a call to {@code getTarget()}
|
||||
* @throws Exception to allow pooling APIs to throw exception
|
||||
* @see #getTarget
|
||||
*/
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
|||
* new-instance-per-invocation strategy.
|
||||
*
|
||||
* <p>Such TargetSources must run in a {@link BeanFactory}, as it needs to
|
||||
* call the <code>getBean</code> method to create a new prototype instance.
|
||||
* call the {@code getBean} method to create a new prototype instance.
|
||||
* Therefore, this base class extends {@link AbstractBeanFactoryBasedTargetSource}.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
|
@ -102,7 +102,7 @@ public abstract class AbstractPrototypeBasedTargetSource extends AbstractBeanFac
|
|||
/**
|
||||
* Replaces this object with a SingletonTargetSource on serialization.
|
||||
* Protected as otherwise it won't be invoked for subclasses.
|
||||
* (The <code>writeReplace()</code> method must be visible to the class
|
||||
* (The {@code writeReplace()} method must be visible to the class
|
||||
* being serialized.)
|
||||
* <p>With this implementation of this method, there is no need to mark
|
||||
* non-serializable fields in this class or subclasses as transient.
|
||||
|
|
|
@ -27,19 +27,19 @@ import org.springframework.core.Constants;
|
|||
* TargetSource implementation that holds objects in a configurable
|
||||
* Jakarta Commons Pool.
|
||||
*
|
||||
* <p>By default, an instance of <code>GenericObjectPool</code> is created.
|
||||
* Subclasses may change the type of <code>ObjectPool</code> used by
|
||||
* overriding the <code>createObjectPool()</code> method.
|
||||
* <p>By default, an instance of {@code GenericObjectPool} is created.
|
||||
* Subclasses may change the type of {@code ObjectPool} used by
|
||||
* overriding the {@code createObjectPool()} method.
|
||||
*
|
||||
* <p>Provides many configuration properties mirroring those of the Commons Pool
|
||||
* <code>GenericObjectPool</code> class; these properties are passed to the
|
||||
* <code>GenericObjectPool</code> during construction. If creating a subclass of this
|
||||
* class to change the <code>ObjectPool</code> implementation type, pass in the values
|
||||
* {@code GenericObjectPool} class; these properties are passed to the
|
||||
* {@code GenericObjectPool} during construction. If creating a subclass of this
|
||||
* class to change the {@code ObjectPool} implementation type, pass in the values
|
||||
* of configuration properties that are relevant to your chosen implementation.
|
||||
*
|
||||
* <p>The <code>testOnBorrow</code>, <code>testOnReturn</code> and <code>testWhileIdle</code>
|
||||
* <p>The {@code testOnBorrow}, {@code testOnReturn} and {@code testWhileIdle}
|
||||
* properties are explictly not mirrored because the implementation of
|
||||
* <code>PoolableObjectFactory</code> used by this class does not implement
|
||||
* {@code PoolableObjectFactory} used by this class does not implement
|
||||
* meaningful validation. All exposed Commons Pool properties use the corresponding
|
||||
* Commons Pool defaults: for example,
|
||||
*
|
||||
|
@ -74,7 +74,7 @@ public class CommonsPoolTargetSource extends AbstractPoolingTargetSource
|
|||
private byte whenExhaustedAction = GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION;
|
||||
|
||||
/**
|
||||
* The Jakarta Commons <code>ObjectPool</code> used to pool target objects
|
||||
* The Jakarta Commons {@code ObjectPool} used to pool target objects
|
||||
*/
|
||||
private ObjectPool pool;
|
||||
|
||||
|
@ -217,7 +217,7 @@ public class CommonsPoolTargetSource extends AbstractPoolingTargetSource
|
|||
* Subclasses can override this if they want to return a specific Commons pool.
|
||||
* They should apply any configuration properties to the pool here.
|
||||
* <p>Default is a GenericObjectPool instance with the given pool size.
|
||||
* @return an empty Commons <code>ObjectPool</code>.
|
||||
* @return an empty Commons {@code ObjectPool}.
|
||||
* @see org.apache.commons.pool.impl.GenericObjectPool
|
||||
* @see #setMaxSize
|
||||
*/
|
||||
|
@ -235,7 +235,7 @@ public class CommonsPoolTargetSource extends AbstractPoolingTargetSource
|
|||
|
||||
|
||||
/**
|
||||
* Borrow an object from the <code>ObjectPool</code>.
|
||||
* Borrow an object from the {@code ObjectPool}.
|
||||
*/
|
||||
@Override
|
||||
public Object getTarget() throws Exception {
|
||||
|
@ -243,7 +243,7 @@ public class CommonsPoolTargetSource extends AbstractPoolingTargetSource
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the specified object to the underlying <code>ObjectPool</code>.
|
||||
* Returns the specified object to the underlying {@code ObjectPool}.
|
||||
*/
|
||||
@Override
|
||||
public void releaseTarget(Object target) throws Exception {
|
||||
|
@ -260,7 +260,7 @@ public class CommonsPoolTargetSource extends AbstractPoolingTargetSource
|
|||
|
||||
|
||||
/**
|
||||
* Closes the underlying <code>ObjectPool</code> when destroying this object.
|
||||
* Closes the underlying {@code ObjectPool} when destroying this object.
|
||||
*/
|
||||
public void destroy() throws Exception {
|
||||
logger.debug("Closing Commons ObjectPool");
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.springframework.aop.TargetSource;
|
|||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* Canonical <code>TargetSource</code> when there is no target
|
||||
* Canonical {@code TargetSource} when there is no target
|
||||
* (or just the target class known), and behavior is supplied
|
||||
* by interfaces and advisors only.
|
||||
*
|
||||
|
@ -47,7 +47,7 @@ public class EmptyTargetSource implements TargetSource, Serializable {
|
|||
|
||||
/**
|
||||
* Return an EmptyTargetSource for the given target Class.
|
||||
* @param targetClass the target Class (may be <code>null</code>)
|
||||
* @param targetClass the target Class (may be {@code null})
|
||||
* @see #getTargetClass()
|
||||
*/
|
||||
public static EmptyTargetSource forClass(Class targetClass) {
|
||||
|
@ -56,7 +56,7 @@ public class EmptyTargetSource implements TargetSource, Serializable {
|
|||
|
||||
/**
|
||||
* Return an EmptyTargetSource for the given target Class.
|
||||
* @param targetClass the target Class (may be <code>null</code>)
|
||||
* @param targetClass the target Class (may be {@code null})
|
||||
* @param isStatic whether the TargetSource should be marked as static
|
||||
* @see #getTargetClass()
|
||||
*/
|
||||
|
@ -76,9 +76,9 @@ public class EmptyTargetSource implements TargetSource, Serializable {
|
|||
|
||||
/**
|
||||
* Create a new instance of the {@link EmptyTargetSource} class.
|
||||
* <p>This constructor is <code>private</code> to enforce the
|
||||
* <p>This constructor is {@code private} to enforce the
|
||||
* Singleton pattern / factory method pattern.
|
||||
* @param targetClass the target class to expose (may be <code>null</code>)
|
||||
* @param targetClass the target class to expose (may be {@code null})
|
||||
* @param isStatic whether the TargetSource is marked as static
|
||||
*/
|
||||
private EmptyTargetSource(Class targetClass, boolean isStatic) {
|
||||
|
@ -87,21 +87,21 @@ public class EmptyTargetSource implements TargetSource, Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Always returns the specified target Class, or <code>null</code> if none.
|
||||
* Always returns the specified target Class, or {@code null} if none.
|
||||
*/
|
||||
public Class<?> getTargetClass() {
|
||||
return this.targetClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Always returns <code>true</code>.
|
||||
* Always returns {@code true}.
|
||||
*/
|
||||
public boolean isStatic() {
|
||||
return this.isStatic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Always returns <code>null</code>.
|
||||
* Always returns {@code null}.
|
||||
*/
|
||||
public Object getTarget() {
|
||||
return null;
|
||||
|
|
|
@ -26,9 +26,9 @@ import org.springframework.beans.BeansException;
|
|||
* the actual target object should not be initialized until first use.
|
||||
* When the target bean is defined in an
|
||||
* {@link org.springframework.context.ApplicationContext} (or a
|
||||
* <code>BeanFactory</code> that is eagerly pre-instantiating singleton beans)
|
||||
* {@code BeanFactory} that is eagerly pre-instantiating singleton beans)
|
||||
* it must be marked as "lazy-init" too, else it will be instantiated by said
|
||||
* <code>ApplicationContext</code> (or <code>BeanFactory</code>) on startup.
|
||||
* {@code ApplicationContext} (or {@code BeanFactory}) on startup.
|
||||
* <p>For example:
|
||||
*
|
||||
* <pre class="code">
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.springframework.core.NamedThreadLocal;
|
|||
* for example, if one caller makes repeated calls on the AOP proxy.
|
||||
*
|
||||
* <p>Cleanup of thread-bound objects is performed on BeanFactory destruction,
|
||||
* calling their <code>DisposableBean.destroy()</code> method if available.
|
||||
* calling their {@code DisposableBean.destroy()} method if available.
|
||||
* Be aware that many thread-bound objects can be around until the application
|
||||
* actually shuts down.
|
||||
*
|
||||
|
|
|
@ -56,7 +56,7 @@ public abstract class AbstractRefreshableTargetSource implements TargetSource, R
|
|||
* Set the delay between refresh checks, in milliseconds.
|
||||
* Default is -1, indicating no refresh checks at all.
|
||||
* <p>Note that an actual refresh will only happen when
|
||||
* {@link #requiresRefresh()} returns <code>true</code>.
|
||||
* {@link #requiresRefresh()} returns {@code true}.
|
||||
*/
|
||||
public void setRefreshCheckDelay(long refreshCheckDelay) {
|
||||
this.refreshCheckDelay = refreshCheckDelay;
|
||||
|
@ -131,7 +131,7 @@ public abstract class AbstractRefreshableTargetSource implements TargetSource, R
|
|||
/**
|
||||
* Determine whether a refresh is required.
|
||||
* Invoked for each refresh check, after the refresh check delay has elapsed.
|
||||
* <p>The default implementation always returns <code>true</code>, triggering
|
||||
* <p>The default implementation always returns {@code true}, triggering
|
||||
* a refresh every time the delay has elapsed. To be overridden by subclasses
|
||||
* with an appropriate check of the underlying target resource.
|
||||
* @return whether a refresh is required
|
||||
|
@ -143,7 +143,7 @@ public abstract class AbstractRefreshableTargetSource implements TargetSource, R
|
|||
/**
|
||||
* Obtain a fresh target object.
|
||||
* <p>Only invoked if a refresh check has found that a refresh is required
|
||||
* (that is, {@link #requiresRefresh()} has returned <code>true</code>).
|
||||
* (that is, {@link #requiresRefresh()} has returned {@code true}).
|
||||
* @return the fresh target object
|
||||
*/
|
||||
protected abstract Object freshTarget();
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.springframework.util.Assert;
|
|||
/**
|
||||
* Refreshable TargetSource that fetches fresh target beans from a BeanFactory.
|
||||
*
|
||||
* <p>Can be subclassed to override <code>requiresRefresh()</code> to suppress
|
||||
* <p>Can be subclassed to override {@code requiresRefresh()} to suppress
|
||||
* unnecessary refreshes. By default, a refresh will be performed every time
|
||||
* the "refreshCheckDelay" has elapsed.
|
||||
*
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue