servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r601861 [2/2] - in /servicemix/branches/servicemix-4.0: ./ bundles/ bundles/junit/ bundles/mina/ itests/tests/ jbi/itests/ openejb/ runtime/gshell/gshell-core/ runtime/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/remote/clien...
Date Thu, 06 Dec 2007 21:23:29 GMT
Modified: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/pom.xml?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/pom.xml (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/pom.xml Thu Dec  6 13:23:26 2007
@@ -129,6 +129,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.geronimo.gshell.remote</groupId>
+            <artifactId>gshell-remote-client</artifactId>
+            <version>${gshell.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.gshell.remote</groupId>
             <artifactId>gshell-remote-common</artifactId>
             <version>${gshell.version}</version>
         </dependency>

Added: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/remote/client/SpringRshCommand.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/remote/client/SpringRshCommand.java?rev=601861&view=auto
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/remote/client/SpringRshCommand.java (added)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/remote/client/SpringRshCommand.java Thu Dec  6 13:23:26 2007
@@ -0,0 +1,120 @@
+package org.apache.geronimo.gshell.remote.client;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import jline.Terminal;
+import org.apache.geronimo.gshell.ExitNotification;
+import org.apache.geronimo.gshell.support.OsgiCommandSupport;
+import org.apache.geronimo.gshell.clp.Argument;
+import org.apache.geronimo.gshell.clp.Option;
+import org.apache.geronimo.gshell.command.annotation.CommandComponent;
+import org.apache.geronimo.gshell.console.PromptReader;
+import org.apache.geronimo.gshell.remote.client.handler.ClientMessageHandler;
+import org.apache.geronimo.gshell.remote.client.proxy.RemoteShellProxy;
+import org.apache.geronimo.gshell.remote.crypto.CryptoContext;
+import org.apache.geronimo.gshell.whisper.transport.TransportFactoryLocator;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: gnodet
+ * Date: Dec 6, 2007
+ * Time: 8:38:02 AM
+ * To change this template use File | Settings | File Templates.
+ */
+@CommandComponent(id="gshell-remote:rsh", description="Connect to a remote GShell server")
+public class SpringRshCommand extends OsgiCommandSupport {
+
+    @Option(name="-b", aliases={"--bind"}, metaVar="URI", description="Bind local address to URI")
+    private URI local;
+
+    @Option(name="-u", aliases={"--username"}, metaVar="USERNAME", description="Remote user name")
+    private String username;
+
+    @Option(name="-p", aliases={"--password"}, metaVar="PASSWORD", description="Remote user password")
+    private String password;
+
+    @Argument(metaVar="URI", required=true, index=0, description="Connect to remote server at URI")
+    private URI remote;
+
+    @Argument(metaVar="COMMAND", index=1, multiValued=true, description="Execute COMMAND in remote shell")
+    private List<String> command = new ArrayList<String>();
+
+    private Terminal terminal;
+
+    private CryptoContext crypto;
+
+    private TransportFactoryLocator locator;
+
+    private List<ClientMessageHandler> handlers;
+
+    public SpringRshCommand(final Terminal terminal,
+                            final CryptoContext crypto,
+                            final TransportFactoryLocator locator,
+                            final List<ClientMessageHandler> handlers) {
+        this.terminal = terminal;
+        this.crypto = crypto;
+        this.locator = locator;
+        this.handlers = handlers;
+    }
+
+    protected OsgiCommandSupport createCommand() throws Exception {
+        return new SpringRshCommand(terminal, crypto, locator, handlers);
+    }
+
+    protected Object doExecute() throws Exception {
+        io.info("Connecting to: {}", remote);
+
+        RshClient client = new RshClient(crypto, locator, handlers);
+        client.initialize();
+        PromptReader prompter = new PromptReader(terminal, io);
+        prompter.initialize();      
+
+        client.connect(remote, local);
+
+        io.info("Connected");
+
+        // If the username/password was not configured via cli, then prompt the user for the values
+        if (username == null || password == null) {
+            if (username == null) {
+                username = prompter.readLine("Username: ");
+            }
+
+            if (password == null) {
+                password = prompter.readPassword("Password: ");
+            }
+
+            //
+            // TODO: Handle null inputs...
+            //
+        }
+
+        client.login(username, password);
+
+        // client.echo("HELLO");
+        // Thread.sleep(1 * 1000);
+
+        RemoteShellProxy shell = new RemoteShellProxy(client, io, terminal);
+
+        Object rv = SUCCESS;
+
+        try {
+            shell.run(command.toArray());
+        }
+        catch (ExitNotification n) {
+            // Make sure that we catch this notification, so that our parent shell doesn't exit when the remote shell does
+            rv = n.code;
+        }
+
+        shell.close();
+
+        io.verbose("Disconnecting");
+
+        client.close();
+
+        io.verbose("Disconnected");
+
+        return rv;
+    }
+}

Modified: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java Thu Dec  6 13:23:26 2007
@@ -89,7 +89,7 @@
 	    	}
 	        
 	        // If a command was specified on the command line, then just execute that command.
-			if (args != null && args.length > 0 && (args.length > 1 || args[0].length() > 0)) {
+			if (args != null && args.length > 0) {
                 System.out.println("Executing 1 command: " + Arrays.toString(args));
 				Object value = shell.execute((Object[])args);
 	        	if (mainService != null) {

Copied: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/support/OsgiCommandSupport.java (from r601554, servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/OsgiCommandSupport.java)
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/support/OsgiCommandSupport.java?p2=servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/support/OsgiCommandSupport.java&p1=servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/OsgiCommandSupport.java&r1=601554&r2=601861&rev=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/OsgiCommandSupport.java (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/support/OsgiCommandSupport.java Thu Dec  6 13:23:26 2007
@@ -14,10 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.geronimo.gshell.osgi;
-
-import java.util.List;
-import java.util.ArrayList;
+package org.apache.geronimo.gshell.support;
 
 import org.apache.geronimo.gshell.clp.CommandLineProcessor;
 import org.apache.geronimo.gshell.clp.Option;
@@ -28,7 +25,6 @@
 import org.apache.geronimo.gshell.command.Variables;
 import org.apache.geronimo.gshell.command.annotation.CommandComponent;
 import org.apache.geronimo.gshell.common.Arguments;
-import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -81,10 +77,16 @@
     }
 
     public Object execute(final CommandContext context, final Object... args) throws Exception {
-        OsgiCommandSupport cmd = getClass().newInstance();
+        ClassLoader cl = getClass().getClassLoader();
+        Thread.currentThread().setContextClassLoader(cl);
+        OsgiCommandSupport cmd = createCommand();
         cmd.setBundleContext(bundleContext);
         cmd.init(context);
         return cmd.doExecute(args);
+    }
+
+    protected OsgiCommandSupport createCommand() throws Exception {
+        return getClass().newInstance();
     }
 
     public void init(final CommandContext context) {

Modified: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-osgi.xml
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-osgi.xml?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-osgi.xml (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-osgi.xml Thu Dec  6 13:23:26 2007
@@ -50,6 +50,8 @@
 
     <osgi:service ref="echo" interface="org.apache.geronimo.gshell.command.Command" />
 
+    <osgi:service ref="rsh" interface="org.apache.geronimo.gshell.command.Command" />
+
     <osgix:property-placeholder persistent-id="org.apache.servicemix.shell">
         <osgix:default-properties>
             <prop key="startLocalConsole">true</prop>

Modified: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-remote.xml
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-remote.xml?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-remote.xml (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-remote.xml Thu Dec  6 13:23:26 2007
@@ -38,7 +38,7 @@
                 </bean>
                 <bean class="org.apache.geronimo.gshell.remote.server.handler.EchoHandler" />
                 <bean class="org.apache.geronimo.gshell.remote.server.handler.SpringExecuteHandler" />
-                <bean class="org.apache.geronimo.gshell.remote.server.handler.LoginHandler">
+                <bean class="org.apache.geronimo.gshell.remote.server.handler.LoginHandler" init-method="initialize">
                     <constructor-arg ref="timeoutManager" />
                 </bean>
                 <bean class="org.apache.geronimo.gshell.remote.server.handler.SpringOpenShellHandler">
@@ -49,7 +49,7 @@
         </constructor-arg>
     </bean>
 
-    <bean id="timeoutManager" class="org.apache.geronimo.gshell.remote.server.timeout.DefaultTimeoutManager" />
+    <bean id="timeoutManager" class="org.apache.geronimo.gshell.remote.server.timeout.DefaultTimeoutManager" init-method="initialize"/>
 
     <bean id="transportFactoryLocator" class="org.apache.geronimo.gshell.whisper.transport.SpringTransportFactoryLocator">
         <property name="factories">
@@ -80,6 +80,17 @@
         <property name="server" ref="rshServer" />
         <property name="start" value="${startRemoteShell}" />
         <property name="location" value="${remoteShellLocation}" />
+    </bean>
+
+    <bean id="rsh" class="org.apache.geronimo.gshell.remote.client.SpringRshCommand">
+        <constructor-arg ref="terminal" />
+        <constructor-arg ref="cryptoContext" />
+        <constructor-arg ref="transportFactoryLocator" />
+        <constructor-arg>
+            <list>
+                <bean class="org.apache.geronimo.gshell.remote.client.handler.EchoHandler" />
+            </list>
+        </constructor-arg>
     </bean>
 
 </beans>

Modified: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-obr/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-obr/pom.xml?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-obr/pom.xml (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-obr/pom.xml Thu Dec  6 13:23:26 2007
@@ -52,9 +52,8 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.geronimo.gshell</groupId>
-            <artifactId>gshell-command-api</artifactId>
-            <version>${gshell.version}</version>
+            <groupId>org.apache.servicemix.gshell</groupId>
+            <artifactId>org.apache.servicemix.gshell.core</artifactId>
         </dependency>
 
         <dependency>

Modified: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-obr/src/main/java/org/apache/geronimo/gshell/obr/ObrCommandSupport.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-obr/src/main/java/org/apache/geronimo/gshell/obr/ObrCommandSupport.java?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-obr/src/main/java/org/apache/geronimo/gshell/obr/ObrCommandSupport.java (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-obr/src/main/java/org/apache/geronimo/gshell/obr/ObrCommandSupport.java Thu Dec  6 13:23:26 2007
@@ -2,6 +2,7 @@
 
 import java.io.PrintWriter;
 
+import org.apache.geronimo.gshell.support.OsgiCommandSupport;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.Version;

Modified: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/pom.xml?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/pom.xml (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/pom.xml Thu Dec  6 13:23:26 2007
@@ -46,9 +46,8 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.geronimo.gshell</groupId>
-            <artifactId>gshell-command-api</artifactId>
-            <version>${gshell.version}</version>
+            <groupId>org.apache.servicemix.gshell</groupId>
+            <artifactId>org.apache.servicemix.gshell.core</artifactId>
         </dependency>
 
         <dependency>

Modified: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/BundleCommand.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/BundleCommand.java?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/BundleCommand.java (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/BundleCommand.java Thu Dec  6 13:23:26 2007
@@ -17,7 +17,7 @@
 package org.apache.geronimo.gshell.osgi;
 
 import org.apache.geronimo.gshell.clp.Argument;
-import org.apache.geronimo.gshell.osgi.OsgiCommandSupport;
+import org.apache.geronimo.gshell.support.OsgiCommandSupport;
 import org.osgi.framework.Bundle;
 
 /**

Modified: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/BundlesCommand.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/BundlesCommand.java?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/BundlesCommand.java (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/BundlesCommand.java Thu Dec  6 13:23:26 2007
@@ -20,6 +20,7 @@
 import java.util.List;
 
 import org.apache.geronimo.gshell.clp.Argument;
+import org.apache.geronimo.gshell.support.OsgiCommandSupport;
 import org.osgi.framework.Bundle;
 
 /**

Modified: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/Headers.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/Headers.java?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/Headers.java (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/Headers.java Thu Dec  6 13:23:26 2007
@@ -23,6 +23,7 @@
 
 import org.apache.geronimo.gshell.command.annotation.CommandComponent;
 import org.apache.geronimo.gshell.clp.Argument;
+import org.apache.geronimo.gshell.support.OsgiCommandSupport;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 

Modified: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/InstallBundle.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/InstallBundle.java?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/InstallBundle.java (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/InstallBundle.java Thu Dec  6 13:23:26 2007
@@ -21,6 +21,7 @@
 
 import org.apache.geronimo.gshell.clp.Argument;
 import org.apache.geronimo.gshell.command.annotation.CommandComponent;
+import org.apache.geronimo.gshell.support.OsgiCommandSupport;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
 

Modified: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/ListBundles.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/ListBundles.java?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/ListBundles.java (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/ListBundles.java Thu Dec  6 13:23:26 2007
@@ -18,6 +18,7 @@
 
 import org.apache.geronimo.gshell.clp.Option;
 import org.apache.geronimo.gshell.command.annotation.CommandComponent;
+import org.apache.geronimo.gshell.support.OsgiCommandSupport;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;

Modified: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/ListServices.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/ListServices.java?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/ListServices.java (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/ListServices.java Thu Dec  6 13:23:26 2007
@@ -22,6 +22,7 @@
 import org.apache.geronimo.gshell.clp.Option;
 import org.apache.geronimo.gshell.command.Command;
 import org.apache.geronimo.gshell.command.annotation.CommandComponent;
+import org.apache.geronimo.gshell.support.OsgiCommandSupport;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.ServiceReference;
 

Modified: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/RefreshBundle.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/RefreshBundle.java?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/RefreshBundle.java (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/RefreshBundle.java Thu Dec  6 13:23:26 2007
@@ -18,6 +18,7 @@
 
 import org.apache.geronimo.gshell.command.annotation.CommandComponent;
 import org.apache.geronimo.gshell.clp.Argument;
+import org.apache.geronimo.gshell.support.OsgiCommandSupport;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.packageadmin.PackageAdmin;

Modified: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/ResolveBundle.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/ResolveBundle.java?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/ResolveBundle.java (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/ResolveBundle.java Thu Dec  6 13:23:26 2007
@@ -17,6 +17,7 @@
 package org.apache.geronimo.gshell.osgi;
 
 import org.apache.geronimo.gshell.command.annotation.CommandComponent;
+import org.apache.geronimo.gshell.support.OsgiCommandSupport;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.packageadmin.PackageAdmin;

Modified: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/Shutdown.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/Shutdown.java?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/Shutdown.java (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/Shutdown.java Thu Dec  6 13:23:26 2007
@@ -17,6 +17,7 @@
 package org.apache.geronimo.gshell.osgi;
 
 import org.apache.geronimo.gshell.command.annotation.CommandComponent;
+import org.apache.geronimo.gshell.support.OsgiCommandSupport;
 import org.osgi.framework.Bundle;
 
 /**

Modified: servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/StartLevel.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/StartLevel.java?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/StartLevel.java (original)
+++ servicemix/branches/servicemix-4.0/runtime/gshell/gshell-osgi/src/main/java/org/apache/geronimo/gshell/osgi/StartLevel.java Thu Dec  6 13:23:26 2007
@@ -18,6 +18,7 @@
 
 import org.apache.geronimo.gshell.command.annotation.CommandComponent;
 import org.apache.geronimo.gshell.clp.Argument;
+import org.apache.geronimo.gshell.support.OsgiCommandSupport;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.packageadmin.PackageAdmin;

Modified: servicemix/branches/servicemix-4.0/runtime/main/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/main/pom.xml?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/main/pom.xml (original)
+++ servicemix/branches/servicemix-4.0/runtime/main/pom.xml Thu Dec  6 13:23:26 2007
@@ -1,88 +1,87 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <!--
-
-        Licensed to the Apache Software Foundation (ASF) under one or more
-        contributor license agreements.  See the NOTICE file distributed with
-        this work for additional information regarding copyright ownership.
-        The ASF licenses this file to You under the Apache License, Version 2.0
-        (the "License"); you may not use this file except in compliance with
-        the License.  You may obtain a copy of the License at
-
-           http://www.apache.org/licenses/LICENSE-2.0
-
-        Unless required by applicable law or agreed to in writing, software
-        distributed under the License is distributed on an "AS IS" BASIS,
-        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-        See the License for the specific language governing permissions and
-        limitations under the License.
-    -->
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.servicemix</groupId>
-        <artifactId>servicemix</artifactId>
-        <version>4.0-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>org.apache.servicemix.main</artifactId>
-    <packaging>bundle</packaging>
-    <name>ServiceMix Main</name>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.framework</artifactId>
-            <version>${felix.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.apache.felix</groupId>
-                    <artifactId>org.osgi.core</artifactId>
-                </exclusion>
-                <!--exclusion>
-                  For now framework doesn't have this dependency, but it
-                  will once the compendium bundle is released.
-                  <groupId>${pom.groupId}</groupId>
-                  <artifactId>org.osgi.compendium</artifactId>
-                </exclusion-->
-            </exclusions>
-        </dependency>
-        <!--
-        <dependency>
-          <groupId>org.apache.felix</groupId>
-          <artifactId>org.apache.felix.bundlerepository</artifactId>
-          <version>${felix.version}</version>
-          <exclusions>
-            <exclusion>
-              <groupId>org.apache.felix</groupId>
-              <artifactId>org.osgi.core</artifactId>
-            </exclusion>
-            <exclusion>
-              <groupId>net.sf.kxml</groupId>
-              <artifactId>kxml2</artifactId>
-            </exclusion>
-          </exclusions>
-        </dependency>
-        -->
-    </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <version>${felix.version}</version>
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <_donotcopy>(CVS|.svn|config.properties)</_donotcopy>
-                        <Main-Class>org.apache.servicemix.main.Main</Main-Class>
-                        <Bundle-Name>Apache ServiceMix</Bundle-Name>
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <!--
+
+        Licensed to the Apache Software Foundation (ASF) under one or more
+        contributor license agreements.  See the NOTICE file distributed with
+        this work for additional information regarding copyright ownership.
+        The ASF licenses this file to You under the Apache License, Version 2.0
+        (the "License"); you may not use this file except in compliance with
+        the License.  You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+        Unless required by applicable law or agreed to in writing, software
+        distributed under the License is distributed on an "AS IS" BASIS,
+        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+        See the License for the specific language governing permissions and
+        limitations under the License.
+    -->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.servicemix</groupId>
+        <artifactId>servicemix</artifactId>
+        <version>4.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>org.apache.servicemix.main</artifactId>
+    <packaging>bundle</packaging>
+    <name>ServiceMix Main</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.framework</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>org.osgi.core</artifactId>
+                </exclusion>
+                <!--exclusion>
+                  For now framework doesn't have this dependency, but it
+                  will once the compendium bundle is released.
+                  <groupId>${pom.groupId}</groupId>
+                  <artifactId>org.osgi.compendium</artifactId>
+                </exclusion-->
+            </exclusions>
+        </dependency>
+        <!--
+        <dependency>
+          <groupId>org.apache.felix</groupId>
+          <artifactId>org.apache.felix.bundlerepository</artifactId>
+          <version>${felix.version}</version>
+          <exclusions>
+            <exclusion>
+              <groupId>org.apache.felix</groupId>
+              <artifactId>org.osgi.core</artifactId>
+            </exclusion>
+            <exclusion>
+              <groupId>net.sf.kxml</groupId>
+              <artifactId>kxml2</artifactId>
+            </exclusion>
+          </exclusions>
+        </dependency>
+        -->
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>${felix.version}</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <_donotcopy>(CVS|.svn|config.properties)</_donotcopy>
+                        <Main-Class>org.apache.servicemix.main.Main</Main-Class>
+                        <Bundle-Name>Apache ServiceMix</Bundle-Name>
                         <Bundle-Description>OSGi R4 framework.</Bundle-Description>
-                        <Export-Package>org.apache.servicemix.main.spi.*</Export-Package>
-                        <Private-Package>
+                        <Export-Package>org.apache.servicemix.main.spi.*</Export-Package>
+                        <Private-Package>
                             org.apache.servicemix.main,
                             org.apache.felix.moduleloader.*,
                             org.apache.felix.framework.*,
@@ -91,19 +90,19 @@
                             org.osgi.service.startlevel,
                             org.osgi.service.event,
                             org.osgi.service.url,
-                            org.osgi.util.tracker
-                        </Private-Package>
-                        <Import-Package>!*</Import-Package>
-                        <Include-Resource>{src/main/resources/}</Include-Resource>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-        <resources>
-            <resource>
-                <directory>src/main/resources</directory>
-                <filtering>true</filtering>
-            </resource>
-        </resources>
-    </build>
-</project>
+                            org.osgi.util.tracker
+                        </Private-Package>
+                        <Import-Package>!*</Import-Package>
+                        <Include-Resource>{src/main/resources/}</Include-Resource>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+    </build>
+</project>

Modified: servicemix/branches/servicemix-4.0/runtime/main/src/main/java/org/apache/servicemix/main/Main.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/main/src/main/java/org/apache/servicemix/main/Main.java?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/main/src/main/java/org/apache/servicemix/main/Main.java (original)
+++ servicemix/branches/servicemix-4.0/runtime/main/src/main/java/org/apache/servicemix/main/Main.java Thu Dec  6 13:23:26 2007
@@ -302,7 +302,7 @@
                 // directory of the felix.jar directory.
                 confDir = new File(
                     new File(new File(jarLocation).getAbsolutePath()).getParent(),
-                    "conf");
+                    "etc");
             }
             else
             {

Modified: servicemix/branches/servicemix-4.0/runtime/minimum/src/main/release/bin/servicemix.sh
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/minimum/src/main/release/bin/servicemix.sh?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/minimum/src/main/release/bin/servicemix.sh (original)
+++ servicemix/branches/servicemix-4.0/runtime/minimum/src/main/release/bin/servicemix.sh Thu Dec  6 13:23:26 2007
@@ -1,256 +1,256 @@
-#!/bin/sh
-#
-#    Licensed to the Apache Software Foundation (ASF) under one or more
-#    contributor license agreements.  See the NOTICE file distributed with
-#    this work for additional information regarding copyright ownership.
-#    The ASF licenses this file to You under the Apache License, Version 2.0
-#    (the "License"); you may not use this file except in compliance with
-#    the License.  You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-#
-# $Id: servicemix 979 2005-11-30 22:50:55Z bsnyder $
-#
-
-DIRNAME=`dirname $0`
-PROGNAME=`basename $0`
-
-#
-# Check/Set up some easily accessible MIN/MAX params for JVM mem usage
-#
-
-if [ "x$JAVA_MIN_MEM" = "x" ]; then
-    JAVA_MIN_MEM=128M
-    export JAVA_MIN_MEM
-fi
-
-if [ "x$JAVA_MAX_MEM" = "x" ]; then
-    JAVA_MAX_MEM=512M
-    export JAVA_MAX_MEM
-fi
-
-warn() {
-    echo "${PROGNAME}: $*"
-}
-
-die() {
-    warn "$*"
-    exit 1
-}
-
-maybeSource() {
-    file="$1"
-    if [ -f "$file" ] ; then
-        . $file
-    fi
-}
-
-detectOS() {
-    # OS specific support (must be 'true' or 'false').
-    cygwin=false;
-    darwin=false;
-    aix=false;
-    os400=false;
-    case "`uname`" in
-        CYGWIN*)
-            cygwin=true
-            ;;
-        Darwin*)
-            darwin=true
-            ;;
-        AIX*)
-            aix=true
-            ;;
-        OS400*)
-            os400=true
-            ;;
-    esac
-    # For AIX, set an environment variable
-    if $aix; then
-         export LDR_CNTRL=MAXDATA=0xB0000000@DSA
-         export IBM_JAVA_HEAPDUMP_TEXT=true
-         echo $LDR_CNTRL                           
-    fi
-}
-
-unlimitFD() {
-    # Use the maximum available, or set MAX_FD != -1 to use that
-    if [ "x$MAX_FD" = "x" ]; then
-        MAX_FD="maximum"
-    fi
-    
-    # Increase the maximum file descriptors if we can
-    if [ "$os400" = "false" ] && [ "$cygwin" = "false" ]; then
-        MAX_FD_LIMIT=`ulimit -H -n`
-        if [ $? -eq 0 ]; then
-            if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
-                # use the system max
-                MAX_FD="$MAX_FD_LIMIT"
-            fi
-            
-            ulimit -n $MAX_FD
-            # echo "ulimit -n" `ulimit -n`
-            if [ $? -ne 0 ]; then
-                warn "Could not set maximum file descriptor limit: $MAX_FD"
-            fi
-        else
-            warn "Could not query system maximum file descriptor limit: $MAX_FD_LIMIT"
-        fi
-    fi
-}
-
-locateHome() {
-    if [ "x$SERVICEMIX_HOME" != "x" ]; then
-        warn "Ignoring predefined value for SERVICEMIX_HOME"
-    fi
-    
-    SERVICEMIX_HOME=`cd $DIRNAME/..; pwd`
-    if [ ! -d "$SERVICEMIX_HOME" ]; then
-        die "SERVICEMIX_HOME is not valid: $SERVICEMIX_HOME"
-    fi
-}
-
-setupNativePath() {
-    # Support for loading native libraries
-    LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:$SERVICEMIX_HOME/lib"
-    
-    # For Cygwin, set PATH from LD_LIBRARY_PATH
-    if $cygwin; then
-        LD_LIBRARY_PATH=`cygpath --path --windows "$LD_LIBRARY_PATH"`
-        PATH="$PATH;$LD_LIBRARY_PATH"
-        export PATH
-    fi
-    export LD_LIBRARY_PATH
-}
-
-locateJava() {
-    # Setup the Java Virtual Machine
-    if $cygwin ; then
-        [ -n "$JAVA" ] && JAVA=`cygpath --unix "$JAVA"`
-        [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-    fi
-
-    if [ "x$JAVA" = "x" ]; then
-        if [ "x$JAVA_HOME" = "x" ] && [ "$darwin" = "true" ]; then
-            JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
-        fi
-        if [ "x$JAVA_HOME" != "x" ]; then
-            if [ ! -d "$JAVA_HOME" ]; then
-                die "JAVA_HOME is not valid: $JAVA_HOME"
-            fi
-            JAVA="$JAVA_HOME/bin/java"
-        else
-            warn "JAVA_HOME not set; results may vary"
-            JAVA="java"
-        fi
-    fi
-}
-
-detectJVM() {
-   #echo "`$JAVA -version`"
-   # This service should call `java -version`, 
-   # read stdout, and look for hints
-   if $JAVA -version 2>&1 | grep "^IBM" ; then
-       JVM_VENDOR="IBM"
-   # on OS/400, java -version does not contain IBM explicitly
-   elif $os400; then
-       JVM_VENDOR="IBM"
-   else
-       JVM_VENDOR="SUN"
-   fi
-   # echo "JVM vendor is $JVM_VENDOR"
-}
-
-setupDebugOptions() {
-    if [ "x$JAVA_OPTS" = "x" ]; then
-        JAVA_OPTS="$DEFAULT_JAVA_OPTS"
-    fi
-    export JAVA_OPTS
-    
-    # Set Debug options if enabled
-    if [ "x$SERVICEMIX_DEBUG" != "x" ]; then
-        # Use the defaults if JAVA_DEBUG_OPTS was not set
-        if [ "x$JAVA_DEBUG_OPTS" = "x" ]; then
-            JAVA_DEBUG_OPTS="$DEFAULT_JAVA_DEBUG_OPTS"
-        fi
-        
-        JAVA_OPTS="$JAVA_DEBUG_OPTS $JAVA_OPTS"
-        warn "Enabling Java debug options: $JAVA_DEBUG_OPTS"
-    fi
-}
-
-setupDefaults() {
-    DEFAULT_JAVA_OPTS="-Xms$JAVA_MIN_MEM -Xmx$JAVA_MAX_MEM "
-
-    #Set the JVM_VENDOR specific JVM flags
-    if [ "$JVM_VENDOR" = "SUN" ]; then
-        DEFAULT_JAVA_OPTS="-server $DEFAULT_JAVA_OPTS -Dcom.sun.management.jmxremote"
-    elif [ "$JVM_VENDOR" = "IBM" ]; then
-        if $os400; then
-            DEFAULT_JAVA_OPTS="$DEFAULT_JAVA_OPTS"
-        elif $aix; then
-            DEFAULT_JAVA_OPTS="-Xverify:none -Xlp $DEFAULT_JAVA_OPTS"
-        else
-            DEFAULT_JAVA_OPTS="-Xverify:none $DEFAULT_JAVA_OPTS"
-        fi
-    fi
-
-    # Add the conf directory so it picks up the Log4J config
-    CLASSPATH="$CLASSPATH:$SERVICEMIX_HOME/conf"
-    DEFAULT_JAVA_DEBUG_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
-    
-    ##
-    ## TODO: Move to conf/profiler/yourkit.{sh|cmd}
-    ##
-    # Uncomment to enable YourKit profiling
-    #DEFAULT_JAVA_DEBUG_OPTS="-Xrunyjpagent"
-}
-
-init() {
-    # Determine if there is special OS handling we must perform
-    detectOS
-    
-    # Unlimit the number of file descriptors if possible
-    unlimitFD
-    
-    # Locate the ServiceMix home directory
-    locateHome
-    
-    # Setup the native library path
-    setupNativePath
-    
-    # Locate the Java VM to execute
-    locateJava
-    
-    # Determine the JVM vendor
-    detectJVM
-    
-    # Setup default options
-    setupDefaults
-    
-    # Install debug options
-    setupDebugOptions
-    
-}
-
-run() {
-    JAR=$SERVICEMIX_HOME/bin/servicemix.jar
-    if $cygwin; then
-        SERVICEMIX_HOME=`cygpath --path --windows "$SERVICEMIX_HOME"`
-    fi
-    cd "$SERVICEMIX_HOME"
-    exec $JAVA $JAVA_OPTS -Dservicemix.home="$SERVICEMIX_HOME" -Dbundles.configuration.location="$SERVICEMIX_HOME/etc" -jar "$JAR" "$*" 
-}
-
-main() {
-    init
-    run $@
-}
-
-main $@
+#!/bin/sh
+#
+#    Licensed to the Apache Software Foundation (ASF) under one or more
+#    contributor license agreements.  See the NOTICE file distributed with
+#    this work for additional information regarding copyright ownership.
+#    The ASF licenses this file to You under the Apache License, Version 2.0
+#    (the "License"); you may not use this file except in compliance with
+#    the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+# $Id: servicemix 979 2005-11-30 22:50:55Z bsnyder $
+#
+
+DIRNAME=`dirname $0`
+PROGNAME=`basename $0`
+
+#
+# Check/Set up some easily accessible MIN/MAX params for JVM mem usage
+#
+
+if [ "x$JAVA_MIN_MEM" = "x" ]; then
+    JAVA_MIN_MEM=128M
+    export JAVA_MIN_MEM
+fi
+
+if [ "x$JAVA_MAX_MEM" = "x" ]; then
+    JAVA_MAX_MEM=512M
+    export JAVA_MAX_MEM
+fi
+
+warn() {
+    echo "${PROGNAME}: $*"
+}
+
+die() {
+    warn "$*"
+    exit 1
+}
+
+maybeSource() {
+    file="$1"
+    if [ -f "$file" ] ; then
+        . $file
+    fi
+}
+
+detectOS() {
+    # OS specific support (must be 'true' or 'false').
+    cygwin=false;
+    darwin=false;
+    aix=false;
+    os400=false;
+    case "`uname`" in
+        CYGWIN*)
+            cygwin=true
+            ;;
+        Darwin*)
+            darwin=true
+            ;;
+        AIX*)
+            aix=true
+            ;;
+        OS400*)
+            os400=true
+            ;;
+    esac
+    # For AIX, set an environment variable
+    if $aix; then
+         export LDR_CNTRL=MAXDATA=0xB0000000@DSA
+         export IBM_JAVA_HEAPDUMP_TEXT=true
+         echo $LDR_CNTRL                           
+    fi
+}
+
+unlimitFD() {
+    # Use the maximum available, or set MAX_FD != -1 to use that
+    if [ "x$MAX_FD" = "x" ]; then
+        MAX_FD="maximum"
+    fi
+    
+    # Increase the maximum file descriptors if we can
+    if [ "$os400" = "false" ] && [ "$cygwin" = "false" ]; then
+        MAX_FD_LIMIT=`ulimit -H -n`
+        if [ $? -eq 0 ]; then
+            if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
+                # use the system max
+                MAX_FD="$MAX_FD_LIMIT"
+            fi
+            
+            ulimit -n $MAX_FD
+            # echo "ulimit -n" `ulimit -n`
+            if [ $? -ne 0 ]; then
+                warn "Could not set maximum file descriptor limit: $MAX_FD"
+            fi
+        else
+            warn "Could not query system maximum file descriptor limit: $MAX_FD_LIMIT"
+        fi
+    fi
+}
+
+locateHome() {
+    if [ "x$SERVICEMIX_HOME" != "x" ]; then
+        warn "Ignoring predefined value for SERVICEMIX_HOME"
+    fi
+    
+    SERVICEMIX_HOME=`cd $DIRNAME/..; pwd`
+    if [ ! -d "$SERVICEMIX_HOME" ]; then
+        die "SERVICEMIX_HOME is not valid: $SERVICEMIX_HOME"
+    fi
+}
+
+setupNativePath() {
+    # Support for loading native libraries
+    LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:$SERVICEMIX_HOME/lib"
+    
+    # For Cygwin, set PATH from LD_LIBRARY_PATH
+    if $cygwin; then
+        LD_LIBRARY_PATH=`cygpath --path --windows "$LD_LIBRARY_PATH"`
+        PATH="$PATH;$LD_LIBRARY_PATH"
+        export PATH
+    fi
+    export LD_LIBRARY_PATH
+}
+
+locateJava() {
+    # Setup the Java Virtual Machine
+    if $cygwin ; then
+        [ -n "$JAVA" ] && JAVA=`cygpath --unix "$JAVA"`
+        [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+    fi
+
+    if [ "x$JAVA" = "x" ]; then
+        if [ "x$JAVA_HOME" = "x" ] && [ "$darwin" = "true" ]; then
+            JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
+        fi
+        if [ "x$JAVA_HOME" != "x" ]; then
+            if [ ! -d "$JAVA_HOME" ]; then
+                die "JAVA_HOME is not valid: $JAVA_HOME"
+            fi
+            JAVA="$JAVA_HOME/bin/java"
+        else
+            warn "JAVA_HOME not set; results may vary"
+            JAVA="java"
+        fi
+    fi
+}
+
+detectJVM() {
+   #echo "`$JAVA -version`"
+   # This service should call `java -version`, 
+   # read stdout, and look for hints
+   if $JAVA -version 2>&1 | grep "^IBM" ; then
+       JVM_VENDOR="IBM"
+   # on OS/400, java -version does not contain IBM explicitly
+   elif $os400; then
+       JVM_VENDOR="IBM"
+   else
+       JVM_VENDOR="SUN"
+   fi
+   # echo "JVM vendor is $JVM_VENDOR"
+}
+
+setupDebugOptions() {
+    if [ "x$JAVA_OPTS" = "x" ]; then
+        JAVA_OPTS="$DEFAULT_JAVA_OPTS"
+    fi
+    export JAVA_OPTS
+    
+    # Set Debug options if enabled
+    if [ "x$SERVICEMIX_DEBUG" != "x" ]; then
+        # Use the defaults if JAVA_DEBUG_OPTS was not set
+        if [ "x$JAVA_DEBUG_OPTS" = "x" ]; then
+            JAVA_DEBUG_OPTS="$DEFAULT_JAVA_DEBUG_OPTS"
+        fi
+        
+        JAVA_OPTS="$JAVA_DEBUG_OPTS $JAVA_OPTS"
+        warn "Enabling Java debug options: $JAVA_DEBUG_OPTS"
+    fi
+}
+
+setupDefaults() {
+    DEFAULT_JAVA_OPTS="-Xms$JAVA_MIN_MEM -Xmx$JAVA_MAX_MEM "
+
+    #Set the JVM_VENDOR specific JVM flags
+    if [ "$JVM_VENDOR" = "SUN" ]; then
+        DEFAULT_JAVA_OPTS="-server $DEFAULT_JAVA_OPTS -Dcom.sun.management.jmxremote"
+    elif [ "$JVM_VENDOR" = "IBM" ]; then
+        if $os400; then
+            DEFAULT_JAVA_OPTS="$DEFAULT_JAVA_OPTS"
+        elif $aix; then
+            DEFAULT_JAVA_OPTS="-Xverify:none -Xlp $DEFAULT_JAVA_OPTS"
+        else
+            DEFAULT_JAVA_OPTS="-Xverify:none $DEFAULT_JAVA_OPTS"
+        fi
+    fi
+
+    # Add the conf directory so it picks up the Log4J config
+    CLASSPATH="$CLASSPATH:$SERVICEMIX_HOME/conf"
+    DEFAULT_JAVA_DEBUG_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
+    
+    ##
+    ## TODO: Move to conf/profiler/yourkit.{sh|cmd}
+    ##
+    # Uncomment to enable YourKit profiling
+    #DEFAULT_JAVA_DEBUG_OPTS="-Xrunyjpagent"
+}
+
+init() {
+    # Determine if there is special OS handling we must perform
+    detectOS
+    
+    # Unlimit the number of file descriptors if possible
+    unlimitFD
+    
+    # Locate the ServiceMix home directory
+    locateHome
+    
+    # Setup the native library path
+    setupNativePath
+    
+    # Locate the Java VM to execute
+    locateJava
+    
+    # Determine the JVM vendor
+    detectJVM
+    
+    # Setup default options
+    setupDefaults
+    
+    # Install debug options
+    setupDebugOptions
+    
+}
+
+run() {
+    JAR=$SERVICEMIX_HOME/bin/servicemix.jar
+    if $cygwin; then
+        SERVICEMIX_HOME=`cygpath --path --windows "$SERVICEMIX_HOME"`
+    fi
+    cd "$SERVICEMIX_HOME"
+    exec $JAVA $JAVA_OPTS -Dservicemix.home="$SERVICEMIX_HOME" -jar "$JAR" $*
+}
+
+main() {
+    init
+    run $@
+}
+
+main $@

Modified: servicemix/branches/servicemix-4.0/runtime/minimum/src/main/release/etc/layout.xml
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/minimum/src/main/release/etc/layout.xml?rev=601861&r1=601860&r2=601861&view=diff
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/minimum/src/main/release/etc/layout.xml (original)
+++ servicemix/branches/servicemix-4.0/runtime/minimum/src/main/release/etc/layout.xml Thu Dec  6 13:23:26 2007
@@ -80,6 +80,17 @@
             <id>gshell-builtins:unset</id>
         </command>
 
+        <!-- Remote -->
+        <group>
+            <name>remote</name>
+            <nodes>
+                <command>
+                    <name>rsh</name>
+                    <id>gshell-remote:rsh</id>
+                </command>
+            </nodes>
+       </group>
+
         <!-- OSGi -->
         <group>
             <name>osgi</name>

Added: servicemix/branches/servicemix-4.0/runtime/minimum/src/main/release/etc/login.conf
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/minimum/src/main/release/etc/login.conf?rev=601861&view=auto
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/minimum/src/main/release/etc/login.conf (added)
+++ servicemix/branches/servicemix-4.0/runtime/minimum/src/main/release/etc/login.conf Thu Dec  6 13:23:26 2007
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// $Rev: 580717 $ $Date: 2007-09-30 14:47:55 +0200 (Sun, 30 Sep 2007) $
+//
+
+RshClient {
+    org.apache.geronimo.gshell.remote.client.auth.RemoteLoginModule required;
+};
+
+BogusLogin {
+    org.apache.geronimo.gshell.remote.server.auth.BogusLoginModule required;
+};
+

Added: servicemix/branches/servicemix-4.0/runtime/minimum/src/main/release/etc/system.properties
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-4.0/runtime/minimum/src/main/release/etc/system.properties?rev=601861&view=auto
==============================================================================
--- servicemix/branches/servicemix-4.0/runtime/minimum/src/main/release/etc/system.properties (added)
+++ servicemix/branches/servicemix-4.0/runtime/minimum/src/main/release/etc/system.properties Thu Dec  6 13:23:26 2007
@@ -0,0 +1,21 @@
+################################################################################
+#
+#    Licensed to the Apache Software Foundation (ASF) under one or more
+#    contributor license agreements.  See the NOTICE file distributed with
+#    this work for additional information regarding copyright ownership.
+#    The ASF licenses this file to You under the Apache License, Version 2.0
+#    (the "License"); you may not use this file except in compliance with
+#    the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+################################################################################
+
+java.security.auth.login.config=${servicemix.home}/etc/login.conf
+



Mime
View raw message