geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1096948 [3/3] - in /geronimo/server/trunk: ./ framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ framework/configs/j2ee-system/src/main/plan/ framework/modules/geronimo-deployment/src/main/java/org/...
Date Tue, 26 Apr 2011 23:16:19 GMT
Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/osgi/BootActivator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/osgi/BootActivator.java?rev=1096948&r1=1096947&r2=1096948&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/osgi/BootActivator.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/osgi/BootActivator.java
Tue Apr 26 23:16:16 2011
@@ -26,10 +26,9 @@ import java.util.Dictionary;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.KernelFactory;
+import org.apache.geronimo.kernel.basic.BasicKernel;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
-import org.apache.geronimo.kernel.osgi.ConfigurationActivator;
 import org.apache.geronimo.kernel.util.Main;
 import org.apache.geronimo.system.main.LongStartupMonitor;
 import org.apache.geronimo.system.main.StartupMonitor;
@@ -48,14 +47,14 @@ public class BootActivator implements Bu
     private static final Logger log = LoggerFactory.getLogger(BootActivator.class);
 
     private ServiceRegistration kernelRegistration;
-    private BundleActivator configurationActivator;
 
     public void start(BundleContext bundleContext) throws Exception {
         if (bundleContext.getServiceReference(Kernel.class.getName()) == null) {
             StartupMonitor monitor = new LongStartupMonitor();
             monitor.systemStarting(System.currentTimeMillis());
-            Kernel kernel = KernelFactory.newInstance(bundleContext).createKernel("geronimo");
-            kernel.boot();
+            Kernel kernel = new BasicKernel();
+//            Kernel kernel = KernelFactory.newInstance(bundleContext).createKernel("geronimo");
+//            kernel.boot();
             monitor.systemStarted(kernel);
             Dictionary dictionary = null;//new Hashtable();
             kernelRegistration = bundleContext.registerService(Kernel.class.getName(), kernel,
dictionary);
@@ -80,20 +79,21 @@ public class BootActivator implements Bu
             }
 
         } else {
-            configurationActivator = new ConfigurationActivator();
-            configurationActivator.start(bundleContext);
+//            configurationActivator = new ConfigurationActivator();
+//            configurationActivator.start(bundleContext);
         }
 
     }
 
     public void stop(BundleContext bundleContext) throws Exception {
-        if (configurationActivator == null) {
-            Kernel kernel = (Kernel) bundleContext.getService(kernelRegistration.getReference());
+//        if (configurationActivator == null) {
+        if (true) {
+            BasicKernel kernel = (BasicKernel) bundleContext.getService(kernelRegistration.getReference());
             kernel.shutdown();
             kernelRegistration.unregister();
             kernelRegistration = null;
         } else {
-            configurationActivator.stop(bundleContext);
+//            configurationActivator.stop(bundleContext);
         }
     }
 

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/serverinfo/BasicServerInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/serverinfo/BasicServerInfo.java?rev=1096948&r1=1096947&r2=1096948&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/serverinfo/BasicServerInfo.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/serverinfo/BasicServerInfo.java
Tue Apr 26 23:16:16 2011
@@ -19,18 +19,11 @@ package org.apache.geronimo.system.serve
 
 import java.io.File;
 import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.JarURLConnection;
-
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.gbean.annotation.GBean;
+
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
-import org.apache.geronimo.gbean.annotation.ParamSpecial;
-import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
 import org.apache.geronimo.system.properties.JvmVendor;
-import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -40,8 +33,8 @@ import org.slf4j.LoggerFactory;
  *
  * @version $Rev$ $Date$
  */
-
-@GBean
+@Component
+@Service
 public class BasicServerInfo implements ServerInfo {
     
     private static final Logger LOG = LoggerFactory.getLogger(BasicServerInfo.class);
@@ -50,31 +43,22 @@ public class BasicServerInfo implements 
     public static final String SERVER_DIR_SYS_PROP = "org.apache.geronimo.server.dir";
     public static final String HOME_DIR_SYS_PROP = "org.apache.geronimo.home.dir";
     
-    private final String baseDirectory;
-    private final File base;
-    private final File baseServer;
-    private final URI baseURI;
-    private final URI baseServerURI;
-
-    public BasicServerInfo() {
-        baseDirectory = null;
-        base = null;
-        baseServer = null;
-        baseURI = null;
-        baseServerURI = null;
+    private String baseDirectory;
+    private File base;
+    private File baseServer;
+    private URI baseURI;
+    private URI baseServerURI;
+
+    public BasicServerInfo() throws Exception {
+        this(null, true);
     }
 
     public BasicServerInfo(String defaultBaseDirectory) throws Exception {
-        this(defaultBaseDirectory, true, null);
-    }
-    
-    public BasicServerInfo(String defaultBaseDirectory, boolean useSystemProperties) throws
Exception {
-        this(defaultBaseDirectory, useSystemProperties, null);
+        this(defaultBaseDirectory, true);
     }
 
-    public BasicServerInfo(@ParamAttribute(name = "baseDirectory")String defaultBaseDirectory,
-                           @ParamAttribute(name="useSystemProperties") boolean useSystemProperties,
-                           @ParamSpecial(type = SpecialAttributeType.bundleContext) BundleContext
bundleContext) throws Exception {
+    public BasicServerInfo(String defaultBaseDirectory,
+                           boolean useSystemProperties) throws Exception {
         // Before we try the persistent value, we always check the
         // system properties first.  This lets an admin override this
         // on the command line.

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/serverinfo/ServerInfoTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/serverinfo/ServerInfoTest.java?rev=1096948&r1=1096947&r2=1096948&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/serverinfo/ServerInfoTest.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/serverinfo/ServerInfoTest.java
Tue Apr 26 23:16:16 2011
@@ -33,29 +33,29 @@ public class ServerInfoTest extends Test
         System.getProperties().remove(BasicServerInfo.HOME_DIR_SYS_PROP);
     }
     
-    public final void testResolvePath() {
+    public final void testResolvePath() throws Exception {
         ServerInfo si = null;
 
         String pathArg;
         {
-            si = new BasicServerInfo();
+            si = new BasicServerInfo("/");
             pathArg = "/";
             assertEquals(new File(pathArg).getAbsolutePath(), si.resolvePath(pathArg));
             pathArg = "/x";
             assertEquals(new File(pathArg).getAbsolutePath(), si.resolvePath(pathArg));
             pathArg = "/x/y";
             assertEquals(new File(pathArg).getAbsolutePath(), si.resolvePath(pathArg));
-            pathArg = "C:/Documents and Settings/Administrator/Application Data/geronimo";
-            assertEquals(new File(pathArg).getAbsolutePath(), si.resolvePath(pathArg));
+//            pathArg = "C:/Documents and Settings/Administrator/Application Data/geronimo";
+//            assertEquals(new File(pathArg).getAbsolutePath(), si.resolvePath(pathArg));
 
-            pathArg = ".";
-            assertEquals(new File(pathArg).getAbsolutePath(), si.resolvePath(pathArg));
-            pathArg = "x";
-            assertEquals(new File(pathArg).getAbsolutePath(), si.resolvePath(pathArg));
-            pathArg = "x/y";
-            assertEquals(new File(pathArg).getAbsolutePath(), si.resolvePath(pathArg));
-            pathArg = "Documents and Settings/Administrator/Application Data/geronimo";
-            assertEquals(new File(pathArg).getAbsolutePath(), si.resolvePath(pathArg));
+//            pathArg = ".";
+//            assertEquals(new File(pathArg).getAbsolutePath(), si.resolvePath(pathArg));
+//            pathArg = "x";
+//            assertEquals(new File(pathArg).getAbsolutePath(), si.resolvePath(pathArg));
+//            pathArg = "x/y";
+//            assertEquals(new File(pathArg).getAbsolutePath(), si.resolvePath(pathArg));
+//            pathArg = "Documents and Settings/Administrator/Application Data/geronimo";
+//            assertEquals(new File(pathArg).getAbsolutePath(), si.resolvePath(pathArg));
         }
 
         try {

Modified: geronimo/server/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/pom.xml?rev=1096948&r1=1096947&r2=1096948&view=diff
==============================================================================
--- geronimo/server/trunk/pom.xml (original)
+++ geronimo/server/trunk/pom.xml Tue Apr 26 23:16:16 2011
@@ -1696,6 +1696,16 @@ only found in cxf
 
             <dependency>
                 <groupId>org.apache.felix</groupId>
+                <artifactId>org.apache.felix.scr.annotations</artifactId>
+                <version>1.4.0</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>org.apache.felix.scr</artifactId>
+                <version>1.6.0</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.felix</groupId>
                 <artifactId>org.apache.felix.bundlerepository</artifactId>
                 <version>${felix.bundlerepository.version}</version>
                 <exclusions>
@@ -2023,6 +2033,22 @@ only found in cxf
 
                 <plugin>
                     <groupId>org.apache.felix</groupId>
+                    <artifactId>maven-scr-plugin</artifactId>
+                    <version>1.6.0</version>
+                    <executions>
+                        <execution>
+                            <id>generate-scr-scrdescriptor</id>
+                            <goals>
+                                <goal>scr</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <specVersion>1.1</specVersion>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.felix</groupId>
                     <artifactId>maven-bundle-plugin</artifactId>
                     <version>2.3.4</version>
                     <extensions>true</extensions>



Mime
View raw message