geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r551191 - /geronimo/xbean/trunk/xbean-server/src/main/java/org/apache/xbean/server/spring/loader/SpringLoader.java
Date Wed, 27 Jun 2007 15:10:44 GMT
Author: jstrachan
Date: Wed Jun 27 08:10:43 2007
New Revision: 551191

URL: http://svn.apache.org/viewvc?view=rev&rev=551191
Log:
made it easy to expose the created ApplicationContext

Modified:
    geronimo/xbean/trunk/xbean-server/src/main/java/org/apache/xbean/server/spring/loader/SpringLoader.java

Modified: geronimo/xbean/trunk/xbean-server/src/main/java/org/apache/xbean/server/spring/loader/SpringLoader.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-server/src/main/java/org/apache/xbean/server/spring/loader/SpringLoader.java?view=diff&rev=551191&r1=551190&r2=551191
==============================================================================
--- geronimo/xbean/trunk/xbean-server/src/main/java/org/apache/xbean/server/spring/loader/SpringLoader.java
(original)
+++ geronimo/xbean/trunk/xbean-server/src/main/java/org/apache/xbean/server/spring/loader/SpringLoader.java
Wed Jun 27 08:10:43 2007
@@ -49,6 +49,7 @@
     private File baseDir = new File(".").getAbsoluteFile();
     private List beanFactoryPostProcessors = Collections.EMPTY_LIST;
     private List xmlPreprocessors = Collections.EMPTY_LIST;
+    private AbstractXmlApplicationContext applicationContext;  
 
     /**
      * Creates an empty SpringLoader.  Note this loader is not usable until a kernel is specified.
@@ -130,7 +131,7 @@
     public ServiceName load(String location) throws Exception {
         String resolvedLocation = baseDir.toURI().resolve(location).getPath();
         String configLocation = "/" + resolvedLocation + ".xml";
-        AbstractXmlApplicationContext applicationContext = createXmlApplicationContext(configLocation);
+        applicationContext = createXmlApplicationContext(configLocation);
 
         for (Iterator iter = beanFactoryPostProcessors.iterator(); iter.hasNext();) {
             BeanFactoryPostProcessor processor = (BeanFactoryPostProcessor) iter.next();
@@ -150,6 +151,13 @@
         ServiceFactory springConfigurationServiceFactory = new SpringConfigurationServiceFactory(applicationContext);
         kernel.registerService(serviceName, springConfigurationServiceFactory);
         return serviceName;
+    }
+
+    /**
+     * Returns the last Spring application context that was read via the call to {@link #load(String)}
+     */
+    public AbstractXmlApplicationContext getApplicationContext() {
+        return applicationContext;
     }
 
     /**



Mime
View raw message