geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bsny...@apache.org
Subject svn commit: r463089 - /geronimo/plugins/spring/trunk/modules/spring-integration-service/src/java/org/apache/geronimo/plugins/spring/SpringGBean.java
Date Thu, 12 Oct 2006 00:49:35 GMT
Author: bsnyder
Date: Wed Oct 11 17:49:34 2006
New Revision: 463089

URL: http://svn.apache.org/viewvc?view=rev&rev=463089
Log:
Added a method to grab the Spring context.

Modified:
    geronimo/plugins/spring/trunk/modules/spring-integration-service/src/java/org/apache/geronimo/plugins/spring/SpringGBean.java

Modified: geronimo/plugins/spring/trunk/modules/spring-integration-service/src/java/org/apache/geronimo/plugins/spring/SpringGBean.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/spring/trunk/modules/spring-integration-service/src/java/org/apache/geronimo/plugins/spring/SpringGBean.java?view=diff&rev=463089&r1=463088&r2=463089
==============================================================================
--- geronimo/plugins/spring/trunk/modules/spring-integration-service/src/java/org/apache/geronimo/plugins/spring/SpringGBean.java
(original)
+++ geronimo/plugins/spring/trunk/modules/spring-integration-service/src/java/org/apache/geronimo/plugins/spring/SpringGBean.java
Wed Oct 11 17:49:34 2006
@@ -1,6 +1,6 @@
 /**
  *
- * Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2006 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -22,6 +22,9 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.context.ApplicationContext;
+
 /**
  * A GBean that starts up configurations from the <a href="http://springframework.org/">Spring
Framework</a>
  *
@@ -38,6 +41,8 @@
     private String configFileName;
     private String contextName;
 
+    private ApplicationContext springContext;
+
     public SpringGBean() {
     }
 
@@ -57,12 +62,23 @@
         return this.contextName;
     }
 
+    public ApplicationContext getSpringContext() {
+        return springContext;
+    }
+
     public void doStart() throws Exception {
-        log.debug("Started");
+        String config = getConfigFileName();
+
+        if(config != null && !config.equals("")) {
+            springContext = new ClassPathXmlApplicationContext(config);
+            log.info("Spring integration started");
+        } else {
+            log.info("Unable to load Spring config file [" + config + "]");
+        }
     }
 
     public void doStop() throws Exception {
-        log.debug("Stopped");
+        log.info("Spring integration stopped");
     }
 
     public void doFail() {



Mime
View raw message