Polishing (typo fixes etc, aligned with 5.0.x)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,39 +23,38 @@ import org.springframework.cache.interceptor.CacheOperation;
|
||||
|
||||
/**
|
||||
* Strategy interface for parsing known caching annotation types.
|
||||
* {@link AnnotationCacheOperationSource} delegates to such
|
||||
* parsers for supporting specific annotation types such as Spring's own
|
||||
* {@link Cacheable}, {@link CachePut} or {@link CacheEvict}.
|
||||
* {@link AnnotationCacheOperationSource} delegates to such parsers
|
||||
* for supporting specific annotation types such as Spring's own
|
||||
* {@link Cacheable}, {@link CachePut} and{@link CacheEvict}.
|
||||
*
|
||||
* @author Costin Leau
|
||||
* @author Stephane Nicoll
|
||||
* @since 3.1
|
||||
* @see AnnotationCacheOperationSource
|
||||
* @see SpringCacheAnnotationParser
|
||||
*/
|
||||
public interface CacheAnnotationParser {
|
||||
|
||||
/**
|
||||
* Parses the cache definition for the given class,
|
||||
* based on a known annotation type.
|
||||
* <p>This essentially parses a known cache annotation into Spring's
|
||||
* metadata attribute class. Returns {@code null} if the class
|
||||
* is not cacheable.
|
||||
* Parse the cache definition for the given class,
|
||||
* based on an annotation type understood by this parser.
|
||||
* <p>This essentially parses a known cache annotation into Spring's metadata
|
||||
* attribute class. Returns {@code null} if the class is not cacheable.
|
||||
* @param type the annotated class
|
||||
* @return CacheOperation the configured caching operation,
|
||||
* or {@code null} if none was found
|
||||
* @return the configured caching operation, or {@code null} if none found
|
||||
* @see AnnotationCacheOperationSource#findCacheOperations(Class)
|
||||
*/
|
||||
Collection<CacheOperation> parseCacheAnnotations(Class<?> type);
|
||||
|
||||
/**
|
||||
* Parses the cache definition for the given method,
|
||||
* based on a known annotation type.
|
||||
* <p>This essentially parses a known cache annotation into Spring's
|
||||
* metadata attribute class. Returns {@code null} if the method
|
||||
* is not cacheable.
|
||||
* Parse the cache definition for the given method,
|
||||
* based on an annotation type understood by this parser.
|
||||
* <p>This essentially parses a known cache annotation into Spring's metadata
|
||||
* attribute class. Returns {@code null} if the method is not cacheable.
|
||||
* @param method the annotated method
|
||||
* @return CacheOperation the configured caching operation,
|
||||
* or {@code null} if none was found
|
||||
* @return the configured caching operation, or {@code null} if none found
|
||||
* @see AnnotationCacheOperationSource#findCacheOperations(Method)
|
||||
*/
|
||||
Collection<CacheOperation> parseCacheAnnotations(Method method);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -55,7 +55,7 @@ public abstract class AbstractFallbackCacheOperationSource implements CacheOpera
|
||||
* Canonical value held in cache to indicate no caching attribute was
|
||||
* found for this method and we don't need to look again.
|
||||
*/
|
||||
private final static Collection<CacheOperation> NULL_CACHING_ATTRIBUTE = Collections.emptyList();
|
||||
private static final Collection<CacheOperation> NULL_CACHING_ATTRIBUTE = Collections.emptyList();
|
||||
|
||||
|
||||
/**
|
||||
@@ -163,23 +163,21 @@ public abstract class AbstractFallbackCacheOperationSource implements CacheOpera
|
||||
|
||||
|
||||
/**
|
||||
* Subclasses need to implement this to return the caching attribute
|
||||
* for the given method, if any.
|
||||
* @param method the method to retrieve the attribute for
|
||||
* @return all caching attribute associated with this method
|
||||
* (or {@code null} if none)
|
||||
*/
|
||||
protected abstract Collection<CacheOperation> findCacheOperations(Method method);
|
||||
|
||||
/**
|
||||
* Subclasses need to implement this to return the caching attribute
|
||||
* for the given class, if any.
|
||||
* Subclasses need to implement this to return the caching attribute for the
|
||||
* given class, if any.
|
||||
* @param clazz the class to retrieve the attribute for
|
||||
* @return all caching attribute associated with this class
|
||||
* (or {@code null} if none)
|
||||
* @return all caching attribute associated with this class, or {@code null} if none
|
||||
*/
|
||||
protected abstract Collection<CacheOperation> findCacheOperations(Class<?> clazz);
|
||||
|
||||
/**
|
||||
* Subclasses need to implement this to return the caching attribute for the
|
||||
* given method, if any.
|
||||
* @param method the method to retrieve the attribute for
|
||||
* @return all caching attribute associated with this method, or {@code null} if none
|
||||
*/
|
||||
protected abstract Collection<CacheOperation> findCacheOperations(Method method);
|
||||
|
||||
/**
|
||||
* Should only public methods be allowed to have caching semantics?
|
||||
* <p>The default implementation returns {@code false}.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -53,8 +53,8 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life
|
||||
/**
|
||||
* Name of the ConversionService bean in the factory.
|
||||
* If none is supplied, default conversion rules apply.
|
||||
* @see org.springframework.core.convert.ConversionService
|
||||
* @since 3.0
|
||||
* @see org.springframework.core.convert.ConversionService
|
||||
*/
|
||||
String CONVERSION_SERVICE_BEAN_NAME = "conversionService";
|
||||
|
||||
@@ -196,7 +196,7 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life
|
||||
* will already have been instantiated before. Use a BeanFactoryPostProcessor
|
||||
* to intercept the BeanFactory setup process before beans get touched.
|
||||
* <p>Generally, this internal factory will only be accessible while the context
|
||||
* is active, that is, inbetween {@link #refresh()} and {@link #close()}.
|
||||
* is active, that is, in-between {@link #refresh()} and {@link #close()}.
|
||||
* The {@link #isActive()} flag can be used to check whether the context
|
||||
* is in an appropriate state.
|
||||
* @return the underlying bean factory
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -334,7 +334,7 @@ public abstract class AbstractReflectiveMBeanInfoAssembler extends AbstractMBean
|
||||
/**
|
||||
* Iterate through all methods on the MBean class and gives subclasses the chance
|
||||
* to vote on their inclusion. If a particular method corresponds to the accessor
|
||||
* or mutator of an attribute that is inclued in the managment interface, then
|
||||
* or mutator of an attribute that is included in the management interface, then
|
||||
* the corresponding operation is exposed with the "role" descriptor
|
||||
* field set to the appropriate value.
|
||||
* @param managedBean the bean instance (might be an AOP proxy)
|
||||
@@ -358,25 +358,23 @@ public abstract class AbstractReflectiveMBeanInfoAssembler extends AbstractMBean
|
||||
|
||||
ModelMBeanOperationInfo info = null;
|
||||
PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
|
||||
if (pd != null) {
|
||||
if ((method.equals(pd.getReadMethod()) && includeReadAttribute(method, beanKey)) ||
|
||||
(method.equals(pd.getWriteMethod()) && includeWriteAttribute(method, beanKey))) {
|
||||
// Attributes need to have their methods exposed as
|
||||
// operations to the JMX server as well.
|
||||
info = createModelMBeanOperationInfo(method, pd.getName(), beanKey);
|
||||
Descriptor desc = info.getDescriptor();
|
||||
if (method.equals(pd.getReadMethod())) {
|
||||
desc.setField(FIELD_ROLE, ROLE_GETTER);
|
||||
}
|
||||
else {
|
||||
desc.setField(FIELD_ROLE, ROLE_SETTER);
|
||||
}
|
||||
desc.setField(FIELD_VISIBILITY, ATTRIBUTE_OPERATION_VISIBILITY);
|
||||
if (isExposeClassDescriptor()) {
|
||||
desc.setField(FIELD_CLASS, getClassForDescriptor(managedBean).getName());
|
||||
}
|
||||
info.setDescriptor(desc);
|
||||
if (pd != null && ((method.equals(pd.getReadMethod()) && includeReadAttribute(method, beanKey)) ||
|
||||
(method.equals(pd.getWriteMethod()) && includeWriteAttribute(method, beanKey)))) {
|
||||
// Attributes need to have their methods exposed as
|
||||
// operations to the JMX server as well.
|
||||
info = createModelMBeanOperationInfo(method, pd.getName(), beanKey);
|
||||
Descriptor desc = info.getDescriptor();
|
||||
if (method.equals(pd.getReadMethod())) {
|
||||
desc.setField(FIELD_ROLE, ROLE_GETTER);
|
||||
}
|
||||
else {
|
||||
desc.setField(FIELD_ROLE, ROLE_SETTER);
|
||||
}
|
||||
desc.setField(FIELD_VISIBILITY, ATTRIBUTE_OPERATION_VISIBILITY);
|
||||
if (isExposeClassDescriptor()) {
|
||||
desc.setField(FIELD_CLASS, getClassForDescriptor(managedBean).getName());
|
||||
}
|
||||
info.setDescriptor(desc);
|
||||
}
|
||||
|
||||
// allow getters and setters to be marked as operations directly
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -127,7 +127,7 @@ public class ScheduledExecutorTask {
|
||||
/**
|
||||
* Set the period between repeated task executions, in milliseconds.
|
||||
* <p>Default is -1, leading to one-time execution. In case of a positive value,
|
||||
* the task will be executed repeatedly, with the given interval inbetween executions.
|
||||
* the task will be executed repeatedly, with the given interval in-between executions.
|
||||
* <p>Note that the semantics of the period value vary between fixed-rate and
|
||||
* fixed-delay execution.
|
||||
* <p><b>Note:</b> A period of 0 (for example as fixed delay) is <i>not</i> supported,
|
||||
|
||||
Reference in New Issue
Block a user