You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by gn...@apache.org on 2009/07/10 19:21:11 UTC

svn commit: r793044 - in /felix/trunk/karaf/gshell: gshell-admin/src/main/resources/OSGI-INF/blueprint/ gshell-config/src/main/resources/OSGI-INF/blueprint/ gshell-console/src/main/java/org/apache/felix/karaf/gshell/console/commands/ gshell-features/sr...

Author: gnodet
Date: Fri Jul 10 17:21:11 2009
New Revision: 793044

URL: http://svn.apache.org/viewvc?rev=793044&view=rev
Log:
Make things as lazy as possible

Modified:
    felix/trunk/karaf/gshell/gshell-admin/src/main/resources/OSGI-INF/blueprint/gshell-admin.xml
    felix/trunk/karaf/gshell/gshell-config/src/main/resources/OSGI-INF/blueprint/gshell-config.xml
    felix/trunk/karaf/gshell/gshell-console/src/main/java/org/apache/felix/karaf/gshell/console/commands/NamespaceHandler.java
    felix/trunk/karaf/gshell/gshell-features/src/main/resources/OSGI-INF/blueprint/gshell-features.xml
    felix/trunk/karaf/gshell/gshell-ssh/src/main/java/org/apache/felix/karaf/gshell/ssh/SshAction.java
    felix/trunk/karaf/gshell/gshell-ssh/src/main/resources/OSGI-INF/blueprint/gshell-ssh.xml

Modified: felix/trunk/karaf/gshell/gshell-admin/src/main/resources/OSGI-INF/blueprint/gshell-admin.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-admin/src/main/resources/OSGI-INF/blueprint/gshell-admin.xml?rev=793044&r1=793043&r2=793044&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-admin/src/main/resources/OSGI-INF/blueprint/gshell-admin.xml (original)
+++ felix/trunk/karaf/gshell/gshell-admin/src/main/resources/OSGI-INF/blueprint/gshell-admin.xml Fri Jul 10 17:21:11 2009
@@ -17,7 +17,8 @@
     limitations under the License.
 
 -->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           default-activation="lazy">
 
     <command-bundle xmlns="http://felix.apache.org/karaf/xmlns/gshell/v1.0.0">
         <command name="admin/create">

Modified: felix/trunk/karaf/gshell/gshell-config/src/main/resources/OSGI-INF/blueprint/gshell-config.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-config/src/main/resources/OSGI-INF/blueprint/gshell-config.xml?rev=793044&r1=793043&r2=793044&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-config/src/main/resources/OSGI-INF/blueprint/gshell-config.xml (original)
+++ felix/trunk/karaf/gshell/gshell-config/src/main/resources/OSGI-INF/blueprint/gshell-config.xml Fri Jul 10 17:21:11 2009
@@ -17,7 +17,8 @@
     limitations under the License.
 
 -->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           default-activation="lazy">
 
     <command-bundle xmlns="http://felix.apache.org/karaf/xmlns/gshell/v1.0.0">
         <command name="config/cancel">

Modified: felix/trunk/karaf/gshell/gshell-console/src/main/java/org/apache/felix/karaf/gshell/console/commands/NamespaceHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-console/src/main/java/org/apache/felix/karaf/gshell/console/commands/NamespaceHandler.java?rev=793044&r1=793043&r2=793044&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-console/src/main/java/org/apache/felix/karaf/gshell/console/commands/NamespaceHandler.java (original)
+++ felix/trunk/karaf/gshell/gshell-console/src/main/java/org/apache/felix/karaf/gshell/console/commands/NamespaceHandler.java Fri Jul 10 17:21:11 2009
@@ -159,6 +159,7 @@
         }
 
         MutableServiceMetadata commandService = context.createMetadata(MutableServiceMetadata.class);
+        commandService.setActivation(MutableServiceMetadata.ACTIVATION_LAZY);
         commandService.setId(getName());
         commandService.addInterface(Function.class.getName());
         commandService.addInterface(CompletableFunction.class.getName());

Modified: felix/trunk/karaf/gshell/gshell-features/src/main/resources/OSGI-INF/blueprint/gshell-features.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-features/src/main/resources/OSGI-INF/blueprint/gshell-features.xml?rev=793044&r1=793043&r2=793044&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/resources/OSGI-INF/blueprint/gshell-features.xml (original)
+++ felix/trunk/karaf/gshell/gshell-features/src/main/resources/OSGI-INF/blueprint/gshell-features.xml Fri Jul 10 17:21:11 2009
@@ -18,7 +18,8 @@
 
 -->
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
-           xmlns:ext="http://geronimo.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
+           xmlns:ext="http://geronimo.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
+           default-activation="lazy">
 
     <ext:property-placeholder placeholder-prefix="$(" placeholder-suffix=")"/>
 

Modified: felix/trunk/karaf/gshell/gshell-ssh/src/main/java/org/apache/felix/karaf/gshell/ssh/SshAction.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-ssh/src/main/java/org/apache/felix/karaf/gshell/ssh/SshAction.java?rev=793044&r1=793043&r2=793044&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-ssh/src/main/java/org/apache/felix/karaf/gshell/ssh/SshAction.java (original)
+++ felix/trunk/karaf/gshell/gshell-ssh/src/main/java/org/apache/felix/karaf/gshell/ssh/SshAction.java Fri Jul 10 17:21:11 2009
@@ -60,12 +60,17 @@
     private BlueprintContainer container;
 
 	private ClientSession session;
+    private String sshClientId;
 
     public void setBlueprintContainer(final BlueprintContainer container) {
         assert container != null;
         this.container = container;
     }
 
+    public void setSshClientId(String sshClientId) {
+        this.sshClientId = sshClientId;
+    }
+
     @Override
     protected Object doExecute() throws Exception {
 
@@ -87,9 +92,9 @@
         }
 
         // Create the client from prototype
-        SshClient client = (SshClient) container.getComponentInstance(SshClient.class.getName());
+        SshClient client = (SshClient) container.getComponentInstance(sshClientId);
         log.debug("Created client: {}", client);
-        client.start();;
+        client.start();
 
         try {
             ConnectFuture future = client.connect(hostname, port);

Modified: felix/trunk/karaf/gshell/gshell-ssh/src/main/resources/OSGI-INF/blueprint/gshell-ssh.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-ssh/src/main/resources/OSGI-INF/blueprint/gshell-ssh.xml?rev=793044&r1=793043&r2=793044&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-ssh/src/main/resources/OSGI-INF/blueprint/gshell-ssh.xml (original)
+++ felix/trunk/karaf/gshell/gshell-ssh/src/main/resources/OSGI-INF/blueprint/gshell-ssh.xml Fri Jul 10 17:21:11 2009
@@ -20,7 +20,8 @@
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
            xmlns:bp="http://www.osgi.org/xmlns/blueprint/v1.0.0"
            xmlns:cm="http://www.osgi.org/xmlns/blueprint-cm/v1.0.0"
-           xmlns:ext="http://geronimo.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
+           xmlns:ext="http://geronimo.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
+           default-activation="lazy">
 
     <ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]"/>
 
@@ -35,6 +36,9 @@
     <command-bundle xmlns="http://felix.apache.org/karaf/xmlns/gshell/v1.0.0">
         <command name="ssh/ssh">
             <action class="org.apache.felix.karaf.gshell.ssh.SshAction">
+                <property name="sshClientId">
+                    <bp:idref component-id="sshClient"/>
+                </property>
             </action>
         </command>
         <command name="ssh/sshd">
@@ -46,8 +50,7 @@
         </command>
     </command-bundle>
 
-    <bean id="sshClient" class="org.apache.sshd.SshClient" factory-method="setUpDefaultClient" init-method="start"
-          destroy-method="stop">
+    <bean id="sshClient" class="org.apache.sshd.SshClient" factory-method="setUpDefaultClient" scope="prototype">
     </bean>
 
     <bean id="sshServer" class="org.apache.sshd.SshServer" factory-method="setUpDefaultServer" scope="prototype">
@@ -79,7 +82,7 @@
     </bean>
 
     <bean id="sshServerFactory" class="org.apache.felix.karaf.gshell.ssh.SshServerFactory" init-method="start"
-          destroy-method="stop">
+          destroy-method="stop" activation="eager">
         <argument ref="sshServer"/>
         <property name="start" value="$[karaf.startRemoteShell]"/>
     </bean>