SEC-1953: Polish

This commit is contained in:
Rob Winch 2013-06-30 21:51:25 -05:00
parent 7412fe0748
commit 4d282cbe0d
2 changed files with 20 additions and 4 deletions

View File

@ -74,9 +74,7 @@ import org.springframework.util.Assert;
*/
@Configuration
public class GlobalMethodSecurityConfiguration implements ImportAware {
@Autowired
private ApplicationContext context;
@Autowired(required=false)
private ObjectPostProcessor<Object> objectPostProcessor = new ObjectPostProcessor<Object>() {
@Override
public <T> T postProcess(T object) {
@ -337,6 +335,16 @@ public class GlobalMethodSecurityConfiguration implements ImportAware {
.fromMap(annotationAttributes);
}
@Autowired
public void setApplicationContext(ApplicationContext context) {
this.context = context;
}
@Autowired(required=false)
public void setObjectPostProcessor(ObjectPostProcessor<Object> objectPostProcessor) {
this.objectPostProcessor = objectPostProcessor;
}
@SuppressWarnings("unchecked")
private <T> T lazyBean(Class<T> interfaceName) {
LazyInitTargetSource lazyTargetSource = new LazyInitTargetSource();

View File

@ -49,10 +49,8 @@ import org.springframework.security.web.access.intercept.FilterSecurityIntercept
public abstract class WebSecurityConfigurerAdapter implements SecurityConfigurer<Filter,WebSecurity> {
private final Log logger = LogFactory.getLog(getClass());
@Autowired
private ApplicationContext context;
@Autowired(required=false)
private ObjectPostProcessor<Object> objectPostProcessor = new ObjectPostProcessor<Object>() {
@Override
public <T> T postProcess(T object) {
@ -290,6 +288,16 @@ public abstract class WebSecurityConfigurerAdapter implements SecurityConfigurer
.httpBasic();
}
@Autowired
public void setApplicationContext(ApplicationContext context) {
this.context = context;
}
@Autowired(required=false)
public void setObjectPostProcessor(ObjectPostProcessor<Object> objectPostProcessor) {
this.objectPostProcessor = objectPostProcessor;
}
/**
* Delays the use of the {@link AuthenticationManager} build from the
* {@link AuthenticationManagerBuilder} to ensure that it has been fully