polishing
This commit is contained in:
parent
341ec4ed41
commit
62785abc72
|
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -26,8 +26,8 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||||
* Base class for dynamic TargetSources that can create new prototype bean
|
* Base class for dynamic TargetSources that can create new prototype bean
|
||||||
* instances to support a pooling or new-instance-per-invocation strategy.
|
* instances to support a pooling or new-instance-per-invocation strategy.
|
||||||
*
|
*
|
||||||
* <p>Such TargetSources must run in a BeanFactory, as it needs to call the
|
* <p>Such TargetSources must run in a {@link BeanFactory}, as it needs to
|
||||||
* <code>getBean</code> method to create a new prototype instance.
|
* call the <code>getBean</code> method to create a new prototype instance.
|
||||||
* Therefore, this base class extends {@link AbstractBeanFactoryBasedTargetSource}.
|
* Therefore, this base class extends {@link AbstractBeanFactoryBasedTargetSource}.
|
||||||
*
|
*
|
||||||
* @author Rod Johnson
|
* @author Rod Johnson
|
||||||
|
|
@ -56,8 +56,8 @@ public abstract class AbstractPrototypeBasedTargetSource extends AbstractBeanFac
|
||||||
* @throws BeansException if bean creation failed
|
* @throws BeansException if bean creation failed
|
||||||
*/
|
*/
|
||||||
protected Object newPrototypeInstance() throws BeansException {
|
protected Object newPrototypeInstance() throws BeansException {
|
||||||
if (this.logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
this.logger.debug("Creating new instance of bean '" + getTargetBeanName() + "'");
|
logger.debug("Creating new instance of bean '" + getTargetBeanName() + "'");
|
||||||
}
|
}
|
||||||
return getBeanFactory().getBean(getTargetBeanName());
|
return getBeanFactory().getBean(getTargetBeanName());
|
||||||
}
|
}
|
||||||
|
|
@ -78,7 +78,7 @@ public abstract class AbstractPrototypeBasedTargetSource extends AbstractBeanFac
|
||||||
((DisposableBean) target).destroy();
|
((DisposableBean) target).destroy();
|
||||||
}
|
}
|
||||||
catch (Throwable ex) {
|
catch (Throwable ex) {
|
||||||
this.logger.error("Couldn't invoke destroy method of bean with name '" + getTargetBeanName() + "'", ex);
|
logger.error("Couldn't invoke destroy method of bean with name '" + getTargetBeanName() + "'", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -385,7 +385,7 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
|
||||||
if (equinoxResolveMethod != null) {
|
if (equinoxResolveMethod != null) {
|
||||||
URL url = original.getURL();
|
URL url = original.getURL();
|
||||||
if (url.getProtocol().startsWith("bundle")) {
|
if (url.getProtocol().startsWith("bundle")) {
|
||||||
return new UrlResource((URL) ReflectionUtils.invokeMethod(equinoxResolveMethod, null, new Object[] {url}));
|
return new UrlResource((URL) ReflectionUtils.invokeMethod(equinoxResolveMethod, null, url));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return original;
|
return original;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue