From 49420d633ef5cb57ad4241ea5dad814d3875831f Mon Sep 17 00:00:00 2001 From: dsyer Date: Mon, 7 Sep 2009 17:27:25 +0000 Subject: [PATCH] RESOLVED - issue BATCH-1395: Remove or deprecate old application context creation pattern Deprecated the osgi context factory. --- ...sgiBundleXmlApplicationContextFactory.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/OsgiBundleXmlApplicationContextFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/OsgiBundleXmlApplicationContextFactory.java index ea6d2c52a..c4e7aad9d 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/OsgiBundleXmlApplicationContextFactory.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/OsgiBundleXmlApplicationContextFactory.java @@ -24,8 +24,15 @@ import org.springframework.context.ConfigurableApplicationContext; import org.springframework.osgi.context.BundleContextAware; import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext; -public class OsgiBundleXmlApplicationContextFactory implements BundleContextAware, - ApplicationContextFactory, ApplicationContextAware { +/** + * @author Dave Syer + * + * @deprecated with no plans to replace (stateful creation of application + * context should no longer be required as it was in Spring Batch 1.1.x) + * + */ +public class OsgiBundleXmlApplicationContextFactory implements BundleContextAware, ApplicationContextFactory, + ApplicationContextAware { private BundleContext bundleContext; @@ -36,13 +43,12 @@ public class OsgiBundleXmlApplicationContextFactory implements BundleContextAwar private String displayName; /** - * @param path - * the resource path to the xml to load for the child context. + * @param path the resource path to the xml to load for the child context. */ public void setPath(String path) { this.path = path; } - + /** * @param displayName the display name for the application context created. */ @@ -55,8 +61,7 @@ public class OsgiBundleXmlApplicationContextFactory implements BundleContextAwar * * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext) */ - public void setApplicationContext(ApplicationContext applicationContext) - throws BeansException { + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { parent = applicationContext; } @@ -78,8 +83,7 @@ public class OsgiBundleXmlApplicationContextFactory implements BundleContextAwar * @see ApplicationContextFactory#createApplicationContext() */ public ConfigurableApplicationContext createApplicationContext() { - OsgiBundleXmlApplicationContext context = new OsgiBundleXmlApplicationContext( - new String[] { path }, parent); + OsgiBundleXmlApplicationContext context = new OsgiBundleXmlApplicationContext(new String[] { path }, parent); String displayName = bundleContext.getBundle().getSymbolicName() + ":" + this.displayName; context.setDisplayName(displayName); context.setBundleContext(bundleContext);