geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r577052 - in /geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/lookup: EnvironmentLookup.java IOLookup.java LookupFactorySupport.java
Date Tue, 18 Sep 2007 20:57:12 GMT
Author: jdillon
Date: Tue Sep 18 13:57:12 2007
New Revision: 577052

URL: http://svn.apache.org/viewvc?rev=577052&view=rev
Log:
Add some set helpers

Modified:
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/lookup/EnvironmentLookup.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/lookup/IOLookup.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/lookup/LookupFactorySupport.java

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/lookup/EnvironmentLookup.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/lookup/EnvironmentLookup.java?rev=577052&r1=577051&r2=577052&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/lookup/EnvironmentLookup.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/lookup/EnvironmentLookup.java
Tue Sep 18 13:57:12 2007
@@ -20,9 +20,11 @@
 package org.apache.geronimo.gshell.lookup;
 
 import org.apache.geronimo.gshell.shell.Environment;
+import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.InstantiationStrategy;
 import org.codehaus.plexus.component.factory.ComponentFactory;
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 
 /**
  * Lookup factory for {@link Environment} instances.
@@ -33,5 +35,10 @@
 public class EnvironmentLookup
     extends LookupFactorySupport
 {
-    // empty
+    public static void set(final PlexusContainer container, final Environment env) throws
ComponentLookupException {
+        assert container != null;
+        
+        EnvironmentLookup lookup = (EnvironmentLookup) container.lookup(ComponentFactory.class,
EnvironmentLookup.class.getSimpleName());
+        lookup.set(env);
+    }
 }

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/lookup/IOLookup.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/lookup/IOLookup.java?rev=577052&r1=577051&r2=577052&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/lookup/IOLookup.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/lookup/IOLookup.java
Tue Sep 18 13:57:12 2007
@@ -20,9 +20,12 @@
 package org.apache.geronimo.gshell.lookup;
 
 import org.apache.geronimo.gshell.command.IO;
+import org.apache.geronimo.gshell.shell.Environment;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.InstantiationStrategy;
 import org.codehaus.plexus.component.factory.ComponentFactory;
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+import org.codehaus.plexus.PlexusContainer;
 
 /**
  * Lookup factory for {@link IO} instances.
@@ -33,5 +36,10 @@
 public class IOLookup
     extends LookupFactorySupport
 {
-    // empty
+    public static void set(final PlexusContainer container, final IO io) throws ComponentLookupException
{
+        assert container != null;
+
+        IOLookup lookup = (IOLookup) container.lookup(ComponentFactory.class, IOLookup.class.getSimpleName());
+        lookup.set(io);
+    }
 }

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/lookup/LookupFactorySupport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/lookup/LookupFactorySupport.java?rev=577052&r1=577051&r2=577052&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/lookup/LookupFactorySupport.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/lookup/LookupFactorySupport.java
Tue Sep 18 13:57:12 2007
@@ -46,10 +46,10 @@
 
         Object prev = get();
         if (prev == null) {
-            log.debug("Registered instance: {}", obj);
+            log.trace("Registered instance: {}", obj);
         }
         else {
-            log.debug("Replacing previous instance with: {}", obj);
+            log.trace("Replacing previous instance with: {}", obj);
         }
         
         holder.set(obj);
@@ -66,7 +66,7 @@
             throw new IllegalStateException("Instance not registered");
         }
         
-        log.debug("Handing out: {}", obj);
+        log.trace("Handing out: {}", obj);
 
         return obj;
     }



Mime
View raw message