Broadly remove deprecated core classes and methods
Issue: SPR-14430
This commit is contained in:
@@ -172,14 +172,6 @@ public abstract class CacheAspectSupport extends AbstractCacheInvoker
|
||||
this.beanFactory = beanFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated as of 4.3, in favor of {@link #setBeanFactory}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setApplicationContext(ApplicationContext applicationContext) {
|
||||
this.beanFactory = applicationContext;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cache.interceptor;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Default key generator. Returns {@value #NO_PARAM_KEY} if no
|
||||
* parameters are provided, the parameter itself if only one is given or
|
||||
* a hash code computed from all given parameters' hash code values.
|
||||
* Uses the constant value {@value #NULL_PARAM_KEY} for any
|
||||
* {@code null} parameters given.
|
||||
*
|
||||
* <p>NOTE: As this implementation returns only a hash of the parameters
|
||||
* it is possible for key collisions to occur. Since Spring 4.0 the
|
||||
* {@link SimpleKeyGenerator} is used when no explicit key generator
|
||||
* has been defined. This class remains for applications that do not
|
||||
* wish to migrate to the {@link SimpleKeyGenerator}.
|
||||
*
|
||||
* @author Costin Leau
|
||||
* @author Chris Beams
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.1
|
||||
* @deprecated as of Spring 4.0, in favor of {@link SimpleKeyGenerator}
|
||||
* or custom {@link KeyGenerator} implementations based on hash codes
|
||||
*/
|
||||
@Deprecated
|
||||
public class DefaultKeyGenerator implements KeyGenerator {
|
||||
|
||||
public static final int NO_PARAM_KEY = 0;
|
||||
|
||||
public static final int NULL_PARAM_KEY = 53;
|
||||
|
||||
|
||||
@Override
|
||||
public Object generate(Object target, Method method, Object... params) {
|
||||
if (params.length == 0) {
|
||||
return NO_PARAM_KEY;
|
||||
}
|
||||
if (params.length == 1) {
|
||||
Object param = params[0];
|
||||
if (param == null) {
|
||||
return NULL_PARAM_KEY;
|
||||
}
|
||||
if (!param.getClass().isArray()) {
|
||||
return param;
|
||||
}
|
||||
}
|
||||
return Arrays.deepHashCode(params);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -128,21 +128,6 @@ public abstract class AbstractCacheManager implements CacheManager, Initializing
|
||||
return this.cacheMap.get(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dynamically register an additional Cache with this manager.
|
||||
* @param cache the Cache to register
|
||||
* @deprecated as of Spring 4.3, in favor of {@link #getMissingCache(String)}
|
||||
*/
|
||||
@Deprecated
|
||||
protected final void addCache(Cache cache) {
|
||||
String name = cache.getName();
|
||||
synchronized (this.cacheMap) {
|
||||
if (this.cacheMap.put(name, decorateCache(cache)) == null) {
|
||||
updateCacheNames(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the exposed {@link #cacheNames} set with the given name.
|
||||
* <p>This will always be called within a full {@link #cacheMap} lock
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2015 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.format.number;
|
||||
|
||||
/**
|
||||
* A BigDecimal formatter for currency values.
|
||||
*
|
||||
* @author Keith Donald
|
||||
* @author Juergen Hoeller
|
||||
* @since 4.2
|
||||
* @deprecated as of Spring 4.2, in favor of the more clearly named
|
||||
* {@link CurrencyStyleFormatter}
|
||||
*/
|
||||
@Deprecated
|
||||
public class CurrencyFormatter extends CurrencyStyleFormatter {
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2015 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.format.number;
|
||||
|
||||
/**
|
||||
* A general-purpose Number formatter.
|
||||
*
|
||||
* @author Keith Donald
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @deprecated as of Spring 4.2, in favor of the more clearly named
|
||||
* {@link NumberStyleFormatter}
|
||||
*/
|
||||
@Deprecated
|
||||
public class NumberFormatter extends NumberStyleFormatter {
|
||||
|
||||
/**
|
||||
* Create a new NumberFormatter without a pattern.
|
||||
*/
|
||||
public NumberFormatter() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new NumberFormatter with the specified pattern.
|
||||
* @param pattern the format pattern
|
||||
* @see #setPattern
|
||||
*/
|
||||
public NumberFormatter(String pattern) {
|
||||
super(pattern);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2015 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.format.number;
|
||||
|
||||
/**
|
||||
* A Number formatter for percent values.
|
||||
*
|
||||
* @author Keith Donald
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @deprecated as of Spring 4.2, in favor of the more clearly named
|
||||
* {@link PercentStyleFormatter}
|
||||
*/
|
||||
@Deprecated
|
||||
public class PercentFormatter extends PercentStyleFormatter {
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -301,15 +301,4 @@ public abstract class JmxUtils {
|
||||
return getMXBeanInterface(clazz.getSuperclass());
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether MXBean support is available, i.e. whether we're running
|
||||
* on Java 6 or above.
|
||||
* @return {@code true} if available; {@code false} otherwise
|
||||
* @deprecated as of Spring 4.0, since Java 6 is required anyway now
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean isMXBeanSupportAvailable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -68,37 +68,6 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class MBeanRegistrationSupport {
|
||||
|
||||
/**
|
||||
* Constant indicating that registration should fail when
|
||||
* attempting to register an MBean under a name that already exists.
|
||||
* <p>This is the default registration behavior.
|
||||
* @deprecated since Spring 3.2, in favor of {@link RegistrationPolicy#FAIL_ON_EXISTING}
|
||||
*/
|
||||
@Deprecated
|
||||
public static final int REGISTRATION_FAIL_ON_EXISTING = 0;
|
||||
|
||||
/**
|
||||
* Constant indicating that registration should ignore the affected MBean
|
||||
* when attempting to register an MBean under a name that already exists.
|
||||
* @deprecated since Spring 3.2, in favor of {@link RegistrationPolicy#IGNORE_EXISTING}
|
||||
*/
|
||||
@Deprecated
|
||||
public static final int REGISTRATION_IGNORE_EXISTING = 1;
|
||||
|
||||
/**
|
||||
* Constant indicating that registration should replace the affected MBean
|
||||
* when attempting to register an MBean under a name that already exists.
|
||||
* @deprecated since Spring 3.2, in favor of {@link RegistrationPolicy#REPLACE_EXISTING}
|
||||
*/
|
||||
@Deprecated
|
||||
public static final int REGISTRATION_REPLACE_EXISTING = 2;
|
||||
|
||||
|
||||
/**
|
||||
* Constants for this class.
|
||||
*/
|
||||
private static final Constants constants = new Constants(MBeanRegistrationSupport.class);
|
||||
|
||||
/**
|
||||
* {@code Log} instance for this class.
|
||||
*/
|
||||
@@ -137,35 +106,6 @@ public class MBeanRegistrationSupport {
|
||||
return this.server;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the registration behavior by the name of the corresponding constant,
|
||||
* e.g. "REGISTRATION_IGNORE_EXISTING".
|
||||
* @see #setRegistrationBehavior
|
||||
* @see #REGISTRATION_FAIL_ON_EXISTING
|
||||
* @see #REGISTRATION_IGNORE_EXISTING
|
||||
* @see #REGISTRATION_REPLACE_EXISTING
|
||||
* @deprecated since Spring 3.2, in favor of {@link #setRegistrationPolicy(RegistrationPolicy)}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setRegistrationBehaviorName(String registrationBehavior) {
|
||||
setRegistrationBehavior(constants.asNumber(registrationBehavior).intValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify what action should be taken when attempting to register an MBean
|
||||
* under an {@link javax.management.ObjectName} that already exists.
|
||||
* <p>Default is REGISTRATION_FAIL_ON_EXISTING.
|
||||
* @see #setRegistrationBehaviorName(String)
|
||||
* @see #REGISTRATION_FAIL_ON_EXISTING
|
||||
* @see #REGISTRATION_IGNORE_EXISTING
|
||||
* @see #REGISTRATION_REPLACE_EXISTING
|
||||
* @deprecated since Spring 3.2, in favor of {@link #setRegistrationPolicy(RegistrationPolicy)}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setRegistrationBehavior(int registrationBehavior) {
|
||||
setRegistrationPolicy(RegistrationPolicy.valueOf(registrationBehavior));
|
||||
}
|
||||
|
||||
/**
|
||||
* The policy to use when attempting to register an MBean
|
||||
* under an {@link javax.management.ObjectName} that already exists.
|
||||
@@ -180,8 +120,7 @@ public class MBeanRegistrationSupport {
|
||||
|
||||
/**
|
||||
* Actually register the MBean with the server. The behavior when encountering
|
||||
* an existing MBean can be configured using the {@link #setRegistrationBehavior(int)}
|
||||
* and {@link #setRegistrationBehaviorName(String)} methods.
|
||||
* an existing MBean can be configured using {@link #setRegistrationPolicy}.
|
||||
* @param mbean the MBean instance
|
||||
* @param objectName the suggested ObjectName for the MBean
|
||||
* @throws JMException if the registration failed
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -44,24 +44,4 @@ public enum RegistrationPolicy {
|
||||
*/
|
||||
REPLACE_EXISTING;
|
||||
|
||||
/**
|
||||
* Translate from an {@link MBeanRegistrationSupport} registration behavior constant
|
||||
* to a {@link RegistrationPolicy} enum value.
|
||||
* @param registrationBehavior one of the now-deprecated REGISTRATION_* constants
|
||||
* available in {@link MBeanRegistrationSupport}.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
static RegistrationPolicy valueOf(int registrationBehavior) {
|
||||
switch (registrationBehavior) {
|
||||
case MBeanRegistrationSupport.REGISTRATION_IGNORE_EXISTING:
|
||||
return RegistrationPolicy.IGNORE_EXISTING;
|
||||
case MBeanRegistrationSupport.REGISTRATION_REPLACE_EXISTING:
|
||||
return RegistrationPolicy.REPLACE_EXISTING;
|
||||
case MBeanRegistrationSupport.REGISTRATION_FAIL_ON_EXISTING:
|
||||
return RegistrationPolicy.FAIL_ON_EXISTING;
|
||||
}
|
||||
throw new IllegalArgumentException(
|
||||
"Unknown MBean registration behavior: " + registrationBehavior);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2007 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -44,7 +44,7 @@ public abstract class LangNamespaceUtils {
|
||||
* @return the {@link ScriptFactoryPostProcessor} bean definition (new or already registered)
|
||||
*/
|
||||
public static BeanDefinition registerScriptFactoryPostProcessorIfNecessary(BeanDefinitionRegistry registry) {
|
||||
BeanDefinition beanDefinition = null;
|
||||
BeanDefinition beanDefinition;
|
||||
if (registry.containsBeanDefinition(SCRIPT_FACTORY_POST_PROCESSOR_BEAN_NAME)) {
|
||||
beanDefinition = registry.getBeanDefinition(SCRIPT_FACTORY_POST_PROCESSOR_BEAN_NAME);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -28,7 +28,7 @@ import org.springframework.util.StringUtils;
|
||||
* @author Mark Fisher
|
||||
* @since 2.5
|
||||
*/
|
||||
public class ScriptingDefaultsParser implements BeanDefinitionParser {
|
||||
class ScriptingDefaultsParser implements BeanDefinitionParser {
|
||||
|
||||
private static final String REFRESH_CHECK_DELAY_ATTRIBUTE = "refresh-check-delay";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user