felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r999086 - in /felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell: Activator.java Shell.java
Date Mon, 20 Sep 2010 19:40:29 GMT
Author: rickhall
Date: Mon Sep 20 19:40:29 2010
New Revision: 999086

URL: http://svn.apache.org/viewvc?rev=999086&view=rev
Log:
Use BundleContext.getProperty() rather System.getProperty(). (FELIX-2543)

Modified:
    felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Activator.java
    felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Shell.java

Modified: felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Activator.java?rev=999086&r1=999085&r2=999086&view=diff
==============================================================================
--- felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Activator.java (original)
+++ felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Activator.java Mon Sep
20 19:40:29 2010
@@ -34,15 +34,17 @@ import org.osgi.util.tracker.ServiceTrac
 
 public class Activator implements BundleActivator, Runnable
 {
+    private BundleContext context;
     private ServiceTracker commandProcessorTracker;
     private Set<ServiceRegistration> regs = new HashSet<ServiceRegistration>();
     private CommandSession session;
     private Shell shell;
     private Thread thread;
 
-    public void start(final BundleContext context) throws Exception
+    public void start(final BundleContext ctxt) throws Exception
     {
-        commandProcessorTracker = processorTracker(context);
+        context = ctxt;
+        commandProcessorTracker = processorTracker();
     }
 
     public void stop(BundleContext context) throws Exception
@@ -68,7 +70,8 @@ public class Activator implements Bundle
         try
         {
             Thread.sleep(100);    // wait for gosh command to be registered
-            String args = System.getProperty("gosh.args", "");
+            String args = context.getProperty("gosh.args");
+            args = (args == null) ? "" : args;
             session.execute("gosh --login " + args);
         }
         catch (Exception e)
@@ -120,7 +123,7 @@ public class Activator implements Bundle
         thread.start();
     }
 
-    private ServiceTracker processorTracker(BundleContext context)
+    private ServiceTracker processorTracker()
     {
         ServiceTracker t = new ServiceTracker(context, CommandProcessor.class.getName(),
             null)
@@ -147,5 +150,4 @@ public class Activator implements Bundle
         t.open();
         return t;
     }
-
-}
+}
\ No newline at end of file

Modified: felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Shell.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Shell.java?rev=999086&r1=999085&r2=999086&view=diff
==============================================================================
--- felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Shell.java (original)
+++ felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Shell.java Mon Sep 20
19:40:29 2010
@@ -49,7 +49,8 @@ public class Shell
     {
         this.context = context;
         this.processor = processor;
-        String baseDir = System.getProperty("gosh.home", System.getProperty("user.dir"));
+        String baseDir = context.getProperty("gosh.home");
+        baseDir = (baseDir == null) ? context.getProperty("user.dir") : baseDir;
         baseURI = new File(baseDir).toURI();
     }
 



Mime
View raw message