Java 5 code style
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2007 the original author or authors.
|
||||
* Copyright 2002-2009 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.
|
||||
@@ -24,7 +24,7 @@ import org.springframework.beans.factory.config.BeanDefinition;
|
||||
*
|
||||
* <p>The default scope is "singleton", and the default is to <i>not</i> create
|
||||
* scoped-proxies.
|
||||
*
|
||||
*
|
||||
* @author Mark Fisher
|
||||
* @since 2.5
|
||||
* @see ScopeMetadataResolver
|
||||
@@ -37,36 +37,32 @@ public class ScopeMetadata {
|
||||
private ScopedProxyMode scopedProxyMode = ScopedProxyMode.NO;
|
||||
|
||||
|
||||
/**
|
||||
* Get the name of the scope.
|
||||
* @return said scope name
|
||||
*/
|
||||
public String getScopeName() {
|
||||
return scopeName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the name of the scope.
|
||||
* @param scopeName said scope name
|
||||
*/
|
||||
public void setScopeName(String scopeName) {
|
||||
this.scopeName = scopeName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the proxy-mode to be applied to the scoped instance.
|
||||
* @return said scoped-proxy mode
|
||||
* Get the name of the scope.
|
||||
*/
|
||||
public ScopedProxyMode getScopedProxyMode() {
|
||||
return scopedProxyMode;
|
||||
public String getScopeName() {
|
||||
return this.scopeName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the proxy-mode to be applied to the scoped instance.
|
||||
* @param scopedProxyMode said scoped-proxy mode
|
||||
*/
|
||||
public void setScopedProxyMode(ScopedProxyMode scopedProxyMode) {
|
||||
this.scopedProxyMode = scopedProxyMode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the proxy-mode to be applied to the scoped instance.
|
||||
*/
|
||||
public ScopedProxyMode getScopedProxyMode() {
|
||||
return this.scopedProxyMode;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2007 the original author or authors.
|
||||
* Copyright 2002-2009 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 @@ package org.springframework.context.annotation;
|
||||
* @see ScopeMetadata
|
||||
*/
|
||||
public enum ScopedProxyMode {
|
||||
|
||||
|
||||
/**
|
||||
* Do not create a scoped proxy.
|
||||
* <p>This proxy-mode is not typically useful when used with a
|
||||
@@ -37,16 +37,16 @@ public enum ScopedProxyMode {
|
||||
* is to be used as a dependency.
|
||||
*/
|
||||
NO,
|
||||
|
||||
|
||||
/**
|
||||
* Create a JDK dynamic proxy implementing <i>all</i> interfaces exposed by
|
||||
* the class of the target object.
|
||||
*/
|
||||
INTERFACES,
|
||||
|
||||
|
||||
/**
|
||||
* Create a class-based proxy (requires CGLIB).
|
||||
*/
|
||||
TARGET_CLASS
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2009 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.
|
||||
@@ -40,10 +40,11 @@ import org.springframework.core.NamedThreadLocal;
|
||||
*/
|
||||
public abstract class LocaleContextHolder {
|
||||
|
||||
private static final ThreadLocal localeContextHolder = new NamedThreadLocal("Locale context");
|
||||
private static final ThreadLocal<LocaleContext> localeContextHolder =
|
||||
new NamedThreadLocal<LocaleContext>("Locale context");
|
||||
|
||||
private static final ThreadLocal inheritableLocaleContextHolder =
|
||||
new NamedInheritableThreadLocal("Locale context");
|
||||
private static final ThreadLocal<LocaleContext> inheritableLocaleContextHolder =
|
||||
new NamedInheritableThreadLocal<LocaleContext>("Locale context");
|
||||
|
||||
|
||||
/**
|
||||
@@ -87,9 +88,9 @@ public abstract class LocaleContextHolder {
|
||||
* @return the current LocaleContext, or <code>null</code> if none
|
||||
*/
|
||||
public static LocaleContext getLocaleContext() {
|
||||
LocaleContext localeContext = (LocaleContext) localeContextHolder.get();
|
||||
LocaleContext localeContext = localeContextHolder.get();
|
||||
if (localeContext == null) {
|
||||
localeContext = (LocaleContext) inheritableLocaleContextHolder.get();
|
||||
localeContext = inheritableLocaleContextHolder.get();
|
||||
}
|
||||
return localeContext;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2009 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.
|
||||
@@ -63,8 +63,13 @@ public class AspectJWeavingEnabler
|
||||
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
|
||||
LoadTimeWeaver weaverToUse = this.loadTimeWeaver;
|
||||
if (weaverToUse == null && InstrumentationLoadTimeWeaver.isInstrumentationAvailable()) {
|
||||
weaverToUse = new InstrumentationLoadTimeWeaver(this.beanClassLoader);
|
||||
if (weaverToUse == null) {
|
||||
if (InstrumentationLoadTimeWeaver.isInstrumentationAvailable()) {
|
||||
weaverToUse = new InstrumentationLoadTimeWeaver(this.beanClassLoader);
|
||||
}
|
||||
else {
|
||||
throw new IllegalStateException("No LoadTimeWeaver available");
|
||||
}
|
||||
}
|
||||
weaverToUse.addTransformer(new AspectJClassBypassingClassFileTransformer(
|
||||
new ClassPreProcessorAgentAdapter()));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2009 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.
|
||||
@@ -30,9 +30,8 @@ import org.springframework.util.Assert;
|
||||
* to beans that implement the {@link LoadTimeWeaverAware} interface.
|
||||
*
|
||||
* <p>{@link org.springframework.context.ApplicationContext Application contexts}
|
||||
* will automatically register this with their underlying
|
||||
* {@link BeanFactory bean factory}, provided that a default
|
||||
* <code>LoadTimeWeaver</code> is actually available.
|
||||
* will automatically register this with their underlying {@link BeanFactory bean factory},
|
||||
* provided that a default <code>LoadTimeWeaver</code> is actually available.
|
||||
*
|
||||
* <p>Applications should not use this class directly.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user