geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r894321 [2/2] - in /geronimo/server/trunk/framework/modules/geronimo-shell-base: ./ src/main/java/org/apache/geronimo/shell/ src/main/java/org/apache/geronimo/shell/cluster/ src/main/java/org/apache/geronimo/shell/completers/ src/main/java/...
Date Tue, 29 Dec 2009 07:54:01 GMT
Added: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/ProcessLauncher.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/ProcessLauncher.java?rev=894321&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/ProcessLauncher.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/ProcessLauncher.java Tue Dec 29 07:53:50 2009
@@ -0,0 +1,149 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.shell.geronimo;
+
+import java.io.PrintStream;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.apache.commons.lang.time.StopWatch;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+/**
+ * Helper to execute a process and perform some verification logic to determine if the process is up or not.
+ * @version $Rev$ $Date$
+ */
+public class ProcessLauncher {
+    private Logger log = LoggerFactory.getLogger(this.getClass());
+
+    String name;
+
+    protected void process() throws Exception {
+    }
+
+    protected boolean verifier() {
+        return false;
+    };
+
+    int verifyWaitDelay = 1000;
+
+    int timeout = -1;
+
+    boolean background = false;
+
+    Throwable error;
+
+    boolean timedOut = false;
+    
+    PrintStream out;
+
+    public ProcessLauncher(Logger log, String name, boolean background,PrintStream out) {
+        this.background = background;
+        this.log = log;
+        this.name = name;
+        this.out=out;
+    }
+
+    private class Inner extends Thread {
+        Inner() {
+            super();
+        }
+
+        public void run() {
+            try {
+                process();
+            } catch (Exception e) {
+                error = e;
+            }
+        }
+    }
+
+    private class TimingTimerTask extends TimerTask {
+        protected TimingTimerTask() {
+            super();
+        }
+
+        @Override
+        public void run() {
+            timedOut = true;
+        }
+
+    }
+
+    public void launch() throws Exception {
+        assert name != null;
+
+        Runnable runner = new Inner();
+
+        Thread t = new Thread(runner, name + " Runner");
+
+        out.println("Launching " + name + "...");
+        //System.console().flush();
+
+        StopWatch watch = new StopWatch();
+        watch.start();
+
+        t.start();
+
+        if (verifier()) {
+            Timer timer = new Timer(name + " Timer", true);
+
+            TimerTask timeoutTask = new TimingTimerTask();
+            if (timeout > 0) {
+                timer.schedule(timeoutTask, timeout * 1000);
+
+            }
+
+            boolean started = false;
+
+            log.debug("Waiting for "+name+" ...");
+
+            while (!started) {
+                if (timedOut) {
+                    throw new Exception("Unable to verify if "+name+" was started in the given time (" + timeout
+                            + " seconds)");
+                }
+
+                if (error != null) {
+                    throw new Exception("Failed to start: "+name, error);
+                }
+
+                if (verifier()) {
+                    started = true;
+                } else {
+                    Thread.sleep(verifyWaitDelay);
+                }
+            }
+
+            timeoutTask.cancel();
+        }
+
+        out.println(name + " started in " + watch);
+        //System.console().flush();
+
+        if (!background) {
+            log.debug("Waiting for "+name+" to shutdown...");
+
+            t.join();
+
+            log.debug(name + " has shutdown");
+        }
+    }
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/ProcessLauncher.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/ServerProxy.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/ServerProxy.java?rev=894321&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/ServerProxy.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/ServerProxy.java Tue Dec 29 07:53:50 2009
@@ -0,0 +1,295 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.shell.geronimo;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.Iterator;
+import java.io.IOException;
+
+import javax.management.remote.JMXServiceURL;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.rmi.RMIConnectorServer;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.rmi.ssl.SslRMIClientSocketFactory;
+
+//
+// FIXME: It should be possible to query state with-out any Geronimo classes,
+//        just using JMX interfaces.
+//
+
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.PersistentConfigurationList;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Helper to communicate with a remote server via JMX.
+ *
+ * @version $Rev$ $Date$
+ */
+
+public class ServerProxy
+{
+    private static final Logger log = LoggerFactory.getLogger(ServerProxy.class);
+
+    private JMXServiceURL url;
+    
+    private JMXConnector connector;
+
+    private Map environment;
+
+    private MBeanServerConnection mbeanConnection;
+
+    private Throwable lastError;
+
+    public ServerProxy(final JMXServiceURL url, final Map environment) throws Exception {
+        assert url != null;
+        assert environment != null;
+
+        this.url = url;
+        this.environment = environment;
+        
+        log.debug("Initialized with URL: " + url + ", environment: " + environment);
+    }
+
+    public ServerProxy(String hostname, int port, String username, String password) throws Exception {
+        this(hostname, port, username, password, false);
+    }
+    
+    public ServerProxy(String hostname, int port, String username, String password, boolean secure) throws Exception {
+        this(createJMXServiceURL(hostname, port, secure), username, password, secure);
+    }
+
+    public ServerProxy(String url, String username, String password) throws Exception {
+        this(url, username, password, false);
+    }
+    
+    public ServerProxy(String url, String username, String password, boolean secure) throws Exception {
+        assert url != null;
+        assert username != null;
+        assert password != null;
+        
+        this.url = new JMXServiceURL(url);
+        this.environment = new HashMap();
+        this.environment.put(JMXConnector.CREDENTIALS, new String[] {username, password});
+        if (secure) {
+            SslRMIClientSocketFactory csf = new SslRMIClientSocketFactory();
+            this.environment.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, csf);
+        }
+
+        log.debug("Initialized with URL: " + url + ", environment: " + environment);
+    }
+
+    public ServerProxy(JMXConnector connector) throws Exception {
+        this.mbeanConnection = connector.getMBeanServerConnection();
+    }
+    
+    private static String createJMXServiceURL(String hostname, int port, boolean secure) {
+        String connectorName = (secure) ? "/JMXSecureConnector" : "/JMXConnector";
+        return "service:jmx:rmi://" + hostname + "/jndi/rmi://" + hostname + ":" + port + connectorName;
+    }
+    
+    private MBeanServerConnection getConnection() throws IOException {
+        if (this.mbeanConnection == null) {
+            log.debug("Connecting to: " + url);
+            
+            connector = JMXConnectorFactory.connect(url, environment);
+            this.mbeanConnection = connector.getMBeanServerConnection();
+            
+            log.debug("Connected");
+        }
+
+        return mbeanConnection;
+    }
+    
+    public void closeConnection() {
+        if (connector != null) {
+            try {
+                connector.close();
+            } catch (IOException e) {
+                String msg = "Failed to close JMXConnector";
+                if (log.isTraceEnabled()) {
+                    log.trace(msg,e);
+                }
+                if (log.isDebugEnabled()) {
+                    log.debug(msg + ":" + e);
+                }
+            }
+        }
+    }
+    public boolean isFullyStarted() {
+        boolean fullyStarted = true;
+
+        try {
+            AbstractNameQuery query = new AbstractNameQuery(PersistentConfigurationList.class.getName());
+            ClassLoader OldCL = Thread.currentThread().getContextClassLoader();
+            Thread.currentThread().setContextClassLoader(AbstractName.class.getClassLoader());
+            Set result = listGBeans(query);
+            Iterator iter = result.iterator();
+           
+            while (iter.hasNext()) {
+                
+                Object abstractName = iter.next();
+                try {
+                    AbstractName name = (AbstractName) abstractName;
+                    boolean started = getBooleanAttribute(name, "kernelFullyStarted");
+
+                    if (!started) {
+                        fullyStarted = false;
+                        break;
+                    }
+                } finally {
+                    Thread.currentThread().setContextClassLoader(OldCL);
+                }
+            }
+            
+            
+        }
+        catch (IOException e) {
+            String msg = "Connection failure; ignoring";
+            if (log.isTraceEnabled()) {
+                log.trace(msg, e);
+            }
+            else if (log.isDebugEnabled()) {
+                log.debug(msg + ": " + e);
+            }
+            
+            fullyStarted = false;
+            lastError = e;
+        }
+        catch (Exception e) {
+            String msg = "Unable to determine if the server is fully started; ignoring";
+            if (log.isTraceEnabled()) {
+                log.trace(msg, e);
+            }
+            else if (log.isDebugEnabled()) {
+                log.debug(msg + ": " + e);
+            }
+            
+            fullyStarted = false;
+            lastError = e;
+        }
+        
+        return fullyStarted;
+    }
+    public String getGeronimoHome() {
+        String home = null;
+
+        try {
+            ObjectName systemInfoQuery = new ObjectName("*:name=ServerInfo,j2eeType=GBean,*");
+
+            getConnection();
+
+            Set set = mbeanConnection.queryNames(systemInfoQuery, null);
+
+            if (set.size() > 0) {
+                ObjectName found = (ObjectName)set.iterator().next();
+                home = (String)mbeanConnection.getAttribute(found, "currentBaseDirectory");
+            }
+        }
+        catch (IOException e) {
+            String msg = "Connection failure; ignoring";
+            if (log.isTraceEnabled()) {
+                log.trace(msg, e);
+            }
+            else if (log.isDebugEnabled()) {
+                log.debug(msg + ": " + e);
+            }
+            
+            lastError = e;
+        }
+        catch (Exception e) {
+            String msg = "Unable to determine if the server is fully started; ignoring";
+            if (log.isTraceEnabled()) {
+                log.trace(msg, e);
+            }
+            else if (log.isDebugEnabled()) {
+                log.debug(msg + ": " + e);
+            }
+            
+            lastError = e;
+        }
+        
+        return home;
+    }
+
+    public Throwable getLastError() {
+        return lastError;
+    }
+
+    public void shutdown() throws Exception {
+        invoke("shutdown");
+    }
+
+    //
+    // Kernel invocation helpers
+    //
+
+    private Object invoke(final String operation, final Object[] args, final String[] signature) throws Exception {
+        assert operation != null;
+        assert args != null;
+        assert signature != null;
+
+        return getConnection().invoke(Kernel.KERNEL, operation, args, signature);
+    }
+
+    private Object invoke(final String operation, final Object[] args) throws Exception {
+        assert args != null;
+
+        String[] signature = new String[args.length];
+        for (int i=0; i<args.length; i++) {
+            signature[i] = args[i].getClass().getName();
+        }
+
+        return invoke(operation, args, signature);
+    }
+
+    private Object invoke(final String operation) throws Exception {
+        return invoke(operation, new Object[0]);
+    }
+
+    private Set listGBeans(final AbstractNameQuery query) throws Exception {
+        return (Set)invoke("listGBeans", new Object[] { query });
+    }
+
+    private Object getAttribute(final AbstractName name, final String attribute) throws Exception {
+        assert name != null;
+        assert attribute != null;
+
+        return invoke("getAttribute", new Object[] { name, attribute });
+    }
+
+    private boolean getBooleanAttribute(final AbstractName name, final String attribute) throws Exception {
+        Object obj = getAttribute(name, attribute);
+        if (obj instanceof Boolean) {
+            return ((Boolean)obj).booleanValue();
+        }
+        else {
+            throw new RuntimeException("Attribute is not of type Boolean: " + attribute);
+        }
+    }
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/ServerProxy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartClientCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartClientCommand.java?rev=894321&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartClientCommand.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartClientCommand.java Tue Dec 29 07:53:50 2009
@@ -0,0 +1,169 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.shell.geronimo;
+
+import java.io.File;
+import java.util.List;
+
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Option;
+import org.apache.tools.ant.ExitStatusException;
+import org.apache.tools.ant.taskdefs.Java;
+import org.apache.tools.ant.types.Environment.Variable;
+/**
+ * @version $Rev$ $Date$
+ */
+@Command(scope = "geronimo", name = "start-client", description = "Start a Geronimo application client")
+public class StartClientCommand extends BaseJavaCommand {
+
+    @Option(name = "-v", aliases = { "--verbose" }, description = "Enable verbose output; specify multiple times to increase verbosity")
+    boolean verbose = false;
+
+    @Argument(index = 0, required = true, description = "Configuration name of application client")
+    String moduleName;
+
+    @Argument(index = 1, multiValued = true, description = "Application client arguments")
+    List<String> moduleArguments;
+
+    protected Object doExecute() throws Exception {
+        ant = new AntBuilder(log);
+
+        if (geronimoHome == null) {
+            geronimoHome = this.bundleContext.getProperty("org.apache.geronimo.home.dir");
+        }
+
+        log.debug("Geronimo home: " + geronimoHome);
+
+        // Setup the default properties required to boot the server
+        properties.put("org.apache.geronimo.home.dir", geronimoHome);
+        properties.put("java.io.tmpdir", "var/temp");// Use relative path
+        properties.put("java.endorsed.dirs", prefixSystemPath("java.endorsed.dirs", new File(geronimoHome,
+                "lib/endorsed")));
+        properties.put("java.ext.dirs", prefixSystemPath("java.ext.dirs", new File(geronimoHome, "lib/ext")));
+
+        // processScripts();
+        
+          // Setup default java flags
+        if (getJavaAgentJar() != null && getJavaAgentJar().exists()) {
+            javaFlags.add("-javaagent:" + getJavaAgentJar().getCanonicalPath());
+        }
+         
+        
+        // If we are not backgrounding, then add a nice message for the user when ctrl-c gets hit
+        if (!background) {
+            Runtime.getRuntime().addShutdownHook(new Thread(){
+                public void run(){
+                    println("Shutting down Server...");
+                  }
+            });
+        }
+        //init properties
+        if(propertyFrom!=null){
+            for(String nameValue:propertyFrom){
+                addPropertyFrom(nameValue, null);
+            }
+        }
+        if(gPropertyFrom!=null){
+            for(String nameValue:gPropertyFrom){
+                addPropertyFrom(nameValue, "org.apache.geronimo");
+            }
+        }
+
+        ProcessLauncher launcher = new ProcessLauncher(log, "Geronimo Client", background,session.getConsole()) {
+            @Override
+            protected void process() throws Exception {
+                try {
+                    Java javaTask = (Java) ant.createTask("java");
+                    //TODO: build client.jar and put it in the right place
+                    javaTask.setJar(new File(geronimoHome + "/bin/client.jar"));
+                    javaTask.setDir(new File(geronimoHome));
+                    javaTask.setFork(true);
+                    javaTask.setFailonerror(true);
+                    if (timeout > 0) {
+                        log.info("Timeout after: " + timeout + " seconds");
+                        javaTask.setTimeout((long) timeout);
+                    }
+
+                    if (logFile != null) {
+                        log.info("Redirecting output to: " + logFile);
+                        File output = new File(logFile);
+                        output.mkdirs();
+                        javaTask.setOutput(output);
+                    }
+
+                    if (javaVirtualMachine != null) {
+                        if (!(new File(javaVirtualMachine).exists())) {
+                            throw new Exception("Java virtual machine is not valid: " + javaVirtualMachine);
+                        }
+
+                        log.info("Using Java virtual machine: " + javaVirtualMachine);
+                        javaTask.setJvm(javaVirtualMachine);
+                    }
+
+                    if (javaFlags != null) {
+                        String javaFlag = "";
+                        for (String s : javaFlags) {
+                            javaFlag.concat(s);
+                        }
+                        javaTask.setJvmargs(javaFlag);
+                    }
+
+                    if (verbose) {
+                        javaTask.setArgs("--verbose");
+                    }
+                    for (String i : properties.keySet()) {
+                        Variable sysp = new Variable();
+                        sysp.setKey(i);
+                        sysp.setValue(properties.get(i));
+                        javaTask.addSysproperty(sysp);
+                    }
+
+                    javaTask.setArgs(moduleName);
+
+                    if (moduleArguments != null) {
+                        for (String m : moduleArguments) {
+                            javaTask.setArgs(m);
+                        }
+                    }
+                    javaTask.execute();
+
+                }
+
+                catch (ExitStatusException e) {
+                    String tmp = "";
+                    log.info(tmp);
+
+                    if (e.getStatus() != 0) {
+                        log.warn(tmp);
+                    }
+
+                    tmp = "Process exited with status: "+e.getStatus();
+
+                    throw e;
+                }
+            }
+        };
+
+        launcher.launch();
+
+        return null;
+    }
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartClientCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartServerCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartServerCommand.java?rev=894321&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartServerCommand.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartServerCommand.java Tue Dec 29 07:53:50 2009
@@ -0,0 +1,97 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.shell.geronimo;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Option;
+import org.apache.geronimo.cli.CLParserException;
+import org.apache.geronimo.cli.daemon.DaemonCLParser;
+import org.apache.geronimo.main.Bootstrapper;
+/**
+ * @version $Rev$ $Date$
+ */
+@Command(scope = "geronimo", name = "start-server", description = "Start Server")
+public class StartServerCommand extends BaseJavaCommand {
+     @Option(name = "-q", aliases = { "--quiet" }, description = "Suppress informative and warning messages")
+     boolean quiet = false;
+
+     @Option(name = "-v", aliases = { "--verbose" }, description = "Enable verbose output; specify multiple times to increase verbosity")
+     boolean verbose = false;
+
+     @Option(name = "-m", aliases = { "--module" }, description = "Start up a specific module by name")
+     List<String> startModules;
+
+     @Option(name = "-u", aliases = { "--username" }, description = "Username")
+     protected String username = null;
+
+     @Option(name = "-w", aliases = { "--password" }, description = "Password")
+     protected String password = null;
+
+     @Option(name = "-s", aliases = { "--server", "--hostname" }, description = "Hostname, default localhost")
+     protected String hostname = "localhost";
+
+     @Option(name = "-p", aliases = { "--port" }, description = "Port, default 1099")
+     protected int port = 1099;
+
+     @Option(name = "--secure", description = "Use secure channel")
+     protected boolean secure = false;
+
+     @Override
+     protected Object doExecute() throws Exception {
+      // If we are not backgrounding, then add a nice message for the user when ctrl-c gets hit
+         if (!background) {
+             Runtime.getRuntime().addShutdownHook(new Thread(){
+                 public void run(){
+                     println("Shutting down Server...");
+                   }
+             });
+         }
+        
+        DaemonCLParser parser = getCLParser();
+        try {
+            parser.parse(null);
+        } catch (CLParserException e) {
+            System.err.println(e.getMessage());
+            parser.displayHelp();
+        }
+
+        Bootstrapper boot = createBootstrapper();
+        boot.execute(parser);
+        
+        return null;
+
+     }
+
+     protected Bootstrapper createBootstrapper() {
+          Bootstrapper boot = new StartServerstrapper(bundleContext,session.getConsole());
+          boot.setWaitForStop(false);
+          boot.setStartBundles(Arrays.asList("org.apache.geronimo.framework/j2ee-system//car"));
+          boot.setLog4jConfigFile("var/log/server-log4j.properties");
+          return (Bootstrapper) boot;
+     }
+
+     protected DaemonCLParser getCLParser() {
+          return new DaemonCLParser(System.out);
+     }
+
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartServerCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartServerstrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartServerstrapper.java?rev=894321&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartServerstrapper.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartServerstrapper.java Tue Dec 29 07:53:50 2009
@@ -0,0 +1,341 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.shell.geronimo;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.List;
+import java.util.concurrent.Semaphore;
+
+import org.apache.geronimo.main.Bootstrapper;
+import org.apache.geronimo.main.Main;
+import org.apache.geronimo.main.ServerInfo;
+import org.apache.geronimo.main.Utils;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+import org.osgi.util.tracker.ServiceTracker;
+/**
+ * @version $Rev$ $Date$
+ */
+public class StartServerstrapper extends Bootstrapper{
+    
+    private BundleContext bundleContext;
+    //private org.apache.felix.karaf.main.Main karafMain;
+    private boolean waitForStop = true;    
+    private List<String> bundles;
+    private int defaultStartLevel = 100;
+    private boolean uniqueStorage = false;   
+    private ServerInfo serverInfo;
+    private String log4jFile;
+    
+    private Semaphore startSemaphore;
+    private Throwable startException;
+    private PrintStream out;
+
+    public StartServerstrapper(BundleContext bundleContext,PrintStream out) {
+        this.bundleContext=bundleContext;
+        this.out=out;
+    }
+    
+    public void setWaitForStop(boolean waitForStop) {
+        this.waitForStop = waitForStop;
+    }
+    
+    public void setStartBundles(List<String> bundles) {
+        this.bundles = bundles;
+    }
+    
+    public void setUniqueStorage(boolean uniqueStorage) {
+        this.uniqueStorage = uniqueStorage;
+    }
+    
+    public void setLog4jConfigFile(String log4jFile) {
+        this.log4jFile = log4jFile;
+    }
+    
+    public int execute(Object opaque) {
+        int exitCode;
+        
+        exitCode = launch();
+        if (exitCode != 0) {
+            return exitCode;
+        }
+        
+        try {
+            startBundles() ;
+        } catch (BundleException e1) {
+            out.println("Can't Start Bundle by BundleException"+e1.getMessage());
+        } catch (IOException e1) {
+            out.println("Can't Start Bundle by IOException"+e1.getMessage());
+        }
+        
+        
+        bundleContext.registerService(ServerInfo.class.getName(), serverInfo, null);
+        /*
+        if (this.bundles != null) {
+            startSemaphore = new Semaphore(0);
+            try {
+                if (!startSemaphore.tryAcquire(60, TimeUnit.SECONDS)) {
+                    return -1;
+                }
+            } catch (InterruptedException e) {
+                return -1;
+            }
+
+            if (startException != null) {
+                System.err.println("Error starting bundles: " + startException.getMessage());
+                startException.printStackTrace();
+                return -1;
+            }
+        }
+        */
+                
+        Main geronimo_main = getMain();
+        
+        if (geronimo_main == null) {
+            out.println("Main not found");
+            stop(false);
+            return -1;
+        }
+
+        ClassLoader oldTCCL = Thread.currentThread().getContextClassLoader();
+        try {
+            ClassLoader newTCCL = geronimo_main.getClass().getClassLoader();
+            Thread.currentThread().setContextClassLoader(newTCCL);
+            exitCode = geronimo_main.execute(opaque);
+            stop(waitForStop);
+        } catch (Throwable e) {
+            out.println(e.getMessage());
+            stop(false);
+        } finally {
+            Thread.currentThread().setContextClassLoader(oldTCCL);
+        }
+        return exitCode;
+    }
+
+    public Main getMain() {
+        ServiceTracker tracker = new ServiceTracker(bundleContext, Main.class.getName(), null);
+        tracker.open();
+        
+        Main geronimoMain = null;
+        try {
+            geronimoMain = (Main) tracker.waitForService(1000 * 60);
+            tracker.close();
+        } catch (Exception e) {            
+            out.println(e.getMessage());          
+        }
+        return geronimoMain;
+    }
+    
+
+   
+    public void stop(boolean await) {
+        try {
+            //TODO uninstall all the bundles
+        } catch (Exception e) {
+            out.println(e.getMessage());           
+        } finally {
+            if (uniqueStorage) {
+                String dir = System.getProperty(Constants.FRAMEWORK_STORAGE);
+                recursiveDelete(new File(dir));                
+            }
+        }
+    }
+                
+    public void startLevelChanged(int startLevel) {
+        if (startLevel == defaultStartLevel) {
+            try {
+                startBundles();
+                startException = null;
+            } catch (Throwable e) {
+                startException = e;
+            } finally {
+                startSemaphore.release();
+            }
+        }        
+    }
+    protected BundleContext getBundleContext() {
+        return bundleContext;
+    }
+    
+    private String getMvnLocation(String[] parts) {
+        return "mvn:" + parts[0] + "/" + parts[1] + "/" + parts[2] + "/" + parts[3]; 
+    }
+    
+    private File getBundleLocation(String[] parts) {
+        String group = parts[0].replace('.', '/').trim();
+        String artifactId = parts[1].trim();
+        String version = parts[2].trim();
+        String type = parts[3].trim();
+                        
+        String defaultRepo = System.getProperty("karaf.default.repository");
+        
+        File repo = new File(getHome(), defaultRepo);
+        
+        File base = new File(repo, group + "/" + artifactId);
+        if (base.exists()) {
+            File versionFile = findFile(base, version);
+            if (versionFile != null) {
+                String artifactName = "";
+                if (type.length() != 0) {                        
+                    artifactName = artifactId + "-" + versionFile.getName() + "." + type;
+                }
+                return findFile(versionFile, artifactName);               
+            }
+        }
+        return null;
+    }
+    
+    private File findFile(File base, String name) {
+        File[] files = base.listFiles();
+        if (name.length() == 0) {
+            return (files.length > 0) ? files[0] : null;
+        }
+        for (File file : files) {
+            if (name.equals(file.getName())) {
+                return file;
+            }
+        }
+        return null;
+    }
+    
+    private String getStorageDirectory() throws IOException {
+        File storage;
+        if (uniqueStorage) {
+            File var = new File(getServer(), "var");
+            File tmpFile = File.createTempFile("appclient-", "", var);
+            storage = new File(var, tmpFile.getName() + "-cache");
+            tmpFile.delete();
+        } else {
+            storage = new File(getServer(), "var/cache");
+        }
+                
+        storage.mkdirs();
+        return storage.getAbsolutePath();
+    }
+    public void startBundles() throws BundleException, IOException {
+        BundleContext context = getBundleContext();
+        for (String location : this.bundles) {
+            String[] parts = location.split("/");
+            
+            File fileLocation = getBundleLocation(parts);
+            if (location == null) {
+                out.println("Artifact " + location + " not found");
+                continue;
+            }
+            parts[2] = fileLocation.getParentFile().getName();
+            parts[3] = fileLocation.getName().substring(fileLocation.getName().lastIndexOf('.') + 1);
+            
+            String mvnLocation = getMvnLocation(parts);
+            Bundle b = context.installBundle(mvnLocation, fileLocation.toURL().openStream());
+            if (b != null) {
+                b.start(Bundle.START_TRANSIENT);
+            }
+        }
+    }
+    
+    private String getHome() {
+        return this.serverInfo.getBase().getAbsolutePath();
+    }
+    
+    private String getServer() {
+        return this.serverInfo.getBaseServer().getAbsolutePath();
+    }
+    
+    private static boolean recursiveDelete(File root) {
+        if (root == null) {
+            return true;
+        }
+
+        boolean ok = true;
+        
+        if (root.isDirectory()) {
+            File[] files = root.listFiles();
+            if (files != null) {
+                for (int i = 0; i < files.length; i++) {
+                    File file = files[i];
+                    if (file.isDirectory()) {
+                        ok = ok && recursiveDelete(file);
+                    } else {
+                        ok = ok && file.delete();
+                    }
+                }
+            }
+        }
+        
+        ok = ok && root.delete();
+        
+        return ok;
+    }
+    public int launch() {      
+        try {
+            File geronimoHome = Utils.getGeronimoHome();
+            File geronimoBase = Utils.getGeronimoBase(geronimoHome);
+            File temporaryDir = Utils.getTempDirectory(geronimoBase);
+            File log4jConfigFile = Utils.getLog4jConfigurationFile(geronimoBase, log4jFile);
+            
+            System.setProperty(Utils.HOME_DIR_SYS_PROP, 
+                               geronimoHome.getAbsolutePath());
+            
+            System.setProperty(Utils.SERVER_DIR_SYS_PROP,
+                                geronimoBase.getAbsolutePath());
+            
+            System.setProperty("java.io.tmpdir", 
+                               temporaryDir.getAbsolutePath());
+            
+            if (log4jConfigFile != null) {
+                System.setProperty("org.apache.geronimo.log4jservice.configuration",
+                                   log4jConfigFile.getAbsolutePath());
+            }
+            
+            this.serverInfo = new ServerInfo(geronimoHome, geronimoBase);
+                        
+            System.setProperty(Constants.FRAMEWORK_STORAGE, 
+                               getStorageDirectory());
+            
+            System.setProperty(Constants.FRAMEWORK_BEGINNING_STARTLEVEL, 
+                               String.valueOf(defaultStartLevel));       
+                      
+            //System.setProperty(org.apache.felix.karaf.main.Main.PROPERTY_USE_LOCK, 
+            //                   (uniqueStorage) ? "false" : "true");
+           
+            /*
+            karafMain = new org.apache.felix.karaf.main.Main(null);
+            
+            try {           
+                karafMain.launch();
+            } catch (Exception e) {
+                e.printStackTrace();           
+            }
+            
+            return karafMain.getExitCode();*/
+            
+        } catch (IOException e) {
+            out.println(e.getMessage());
+            return -1;
+        }
+        
+        
+        return 0;
+    }
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StartServerstrapper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StopServerCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StopServerCommand.java?rev=894321&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StopServerCommand.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StopServerCommand.java Tue Dec 29 07:53:50 2009
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.shell.geronimo;
+
+
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.geronimo.shell.deploy.ConnectCommand;
+import org.osgi.framework.Bundle;
+/**
+ * @version $Rev$ $Date$
+ */
+@Command(scope = "geronimo", name = "stop-server",  description = "Stop Server")
+public class StopServerCommand extends ConnectCommand {
+
+    @Override
+    protected Object doExecute() throws Exception {
+        //TODO: to stop remote server 
+        println("Stopping Geronimo server...");
+        Bundle[] bundles = bundleContext.getBundles();
+        for(Bundle bundle:bundles){
+            if(bundle.getLocation().equals("mvn:org.apache.geronimo.framework/j2ee-system/3.0-SNAPSHOT/car")){
+                try {
+                    bundle.stop();
+                    println("Shutdown request has been issued");
+                    super.disconnect();
+                }
+                catch (Exception e) {
+                    log.debug("Failed to request shutdown:", e);
+                    println("Unable to shutdown the server: "+e.getMessage());
+                }
+                
+                break;
+            }
+        }
+        
+        
+        return null;
+    }
+
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/StopServerCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/WaitForServerCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/WaitForServerCommand.java?rev=894321&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/WaitForServerCommand.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/WaitForServerCommand.java Tue Dec 29 07:53:50 2009
@@ -0,0 +1,116 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.shell.geronimo;
+
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Option;
+import org.apache.geronimo.deployment.cli.ServerConnection;
+import org.apache.geronimo.deployment.plugin.jmx.RemoteDeploymentManager;
+import org.apache.geronimo.shell.deploy.ConnectCommand;
+/**
+ * @version $Rev$ $Date$
+ */
+@Command(scope = "geronimo", name = "wait-for-server", description = "Wait for a Geronimo server to start")
+public class WaitForServerCommand extends ConnectCommand {
+
+    boolean timedOut = false;
+
+    @Option(name = "-t", aliases = { "--timeout" }, description = "Specify the time in seconds to wait while verifying that the server has started. Default 60 seconds")
+    int timeout = 60;
+
+    private class TimingTimerTask extends TimerTask {
+        protected TimingTimerTask() {
+            super();
+        }
+
+        @Override
+        public void run() {
+            timedOut = true;
+        }
+
+    }
+
+    protected Object doExecute() throws Exception {
+        Timer timer = new Timer(true);
+
+        TimerTask timeoutTask = new TimingTimerTask();
+        if (timeout > 0) {
+            timer.schedule(timeoutTask, timeout * 1000);
+
+        }
+        println("Waiting for Geronimo server: " + hostname + " :" + port);
+        boolean started = false;
+
+        while (!started) {
+            if (timedOut) {
+                throw new Exception("Unable to verify if the server was started in the given time");
+            }
+            ServerConnection connection;
+            ServerProxy server = null;
+            try {
+                connection = connect();
+                server = new ServerProxy(((RemoteDeploymentManager)connection.getDeploymentManager()).getJMXConnector());
+            } catch (Exception error) {
+                log.debug("Server query failed; ignoring", error);
+                try {
+                    Thread.sleep(1000);
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (server != null) {
+                started = server.isFullyStarted();
+            }
+            if (!started) {
+                Throwable error = server.getLastError();
+                if (error != null) {
+                    log.debug("Server query failed; ignoring", error);
+                }
+                Thread.sleep(1000);
+
+            }
+        }
+        if (started) {
+            timeoutTask.cancel();
+            timer.cancel();
+        }
+
+        println("Geronimo server is started");
+        return null;
+    }
+
+    protected ServerConnection connect() {
+        ServerConnection connection = (ServerConnection) session.get(SERVER_CONNECTION);
+
+        if (connection == null) {
+            try {
+                connection = openConnection(true);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+        return connection;
+    }
+
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/geronimo/WaitForServerCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/resources/OSGI-INF/blueprint/shell-deploy.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/resources/OSGI-INF/blueprint/shell-deploy.xml?rev=894321&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/resources/OSGI-INF/blueprint/shell-deploy.xml (added)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/resources/OSGI-INF/blueprint/shell-deploy.xml Tue Dec 29 07:53:50 2009
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           default-activation="lazy">
+
+    <command-bundle xmlns="http://felix.apache.org/karaf/xmlns/shell/v1.0.0">
+        <command name="deploy/assemble-server">
+            <action class="org.apache.geronimo.shell.deploy.AssembleServerCommand">
+            </action>
+        </command>
+        <command name="deploy/connect">
+            <action class="org.apache.geronimo.shell.deploy.ConnectCommand">
+            </action>
+        </command>
+        <command name="deploy/deploy-module">
+            <action class="org.apache.geronimo.shell.deploy.DeployModuleCommand">
+            </action>
+        </command>
+        <command name="deploy/disconnect">
+            <action class="org.apache.geronimo.shell.deploy.DisconnectCommand">
+            </action>
+        </command>
+        <command name="deploy/distribute">
+            <action class="org.apache.geronimo.shell.deploy.DistributeCommand">
+            </action>
+        </command>
+        <command name="deploy/install-library">
+            <action class="org.apache.geronimo.shell.deploy.InstallLibraryCommand">
+            </action>
+        </command>
+        <command name="deploy/install-plugin">
+            <action class="org.apache.geronimo.shell.deploy.InstallPluginCommand">
+            </action>
+        </command>
+        <command name="deploy/list-modules">
+            <action class="org.apache.geronimo.shell.deploy.ListModulesCommand">
+            </action>
+        </command>
+        <command name="deploy/list-plugins">
+            <action class="org.apache.geronimo.shell.deploy.ListPluginsCommand">
+            </action>
+        </command>
+        <command name="deploy/list-targets">
+            <action class="org.apache.geronimo.shell.deploy.ListTargetsCommand">
+            </action>
+        </command>
+        <command name="deploy/login">
+            <action class="org.apache.geronimo.shell.deploy.LoginCommand">
+            </action>
+        </command>
+        <command name="deploy/new-server-instance">
+            <action class="org.apache.geronimo.shell.deploy.NewInstanceCommand">
+            </action>
+        </command>
+        <command name="deploy/redeploy-module">
+            <action class="org.apache.geronimo.shell.deploy.RedeployModuleCommand">
+            </action>
+        </command>
+        <command name="deploy/restart-module">
+            <action class="org.apache.geronimo.shell.deploy.RestartModuleCommand">
+            </action>
+        </command>
+        <command name="deploy/start-module">
+            <action class="org.apache.geronimo.shell.deploy.StartModuleCommand">
+            </action>
+        </command>
+        <command name="deploy/stop-module">
+            <action class="org.apache.geronimo.shell.deploy.StopModuleCommand">
+            </action>
+        </command>
+        <command name="deploy/undeploy-module">
+            <action class="org.apache.geronimo.shell.deploy.UndeployModuleCommand">
+            </action>
+        </command>
+    </command-bundle>
+
+</blueprint>

Propchange: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/resources/OSGI-INF/blueprint/shell-deploy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/resources/OSGI-INF/blueprint/shell-geronimo.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/resources/OSGI-INF/blueprint/shell-geronimo.xml?rev=894321&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/resources/OSGI-INF/blueprint/shell-geronimo.xml (added)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/resources/OSGI-INF/blueprint/shell-geronimo.xml Tue Dec 29 07:53:50 2009
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           default-activation="lazy">
+
+    <command-bundle xmlns="http://felix.apache.org/karaf/xmlns/shell/v1.0.0">
+        <command name="geronimo/stop-server">
+            <action class="org.apache.geronimo.shell.geronimo.StopServerCommand"></action>
+        </command>
+        
+        <command name="geronimo/start-server">
+            <action class="org.apache.geronimo.shell.geronimo.StartServerCommand"></action>
+        </command>
+        
+        <command name="geronimo/start-client">
+            <action class="org.apache.geronimo.shell.geronimo.StartClientCommand"></action>
+        </command>
+        
+        <command name="geronimo/wait-for-server">
+            <action class="org.apache.geronimo.shell.geronimo.WaitForServerCommand"></action>
+        </command>
+    </command-bundle>
+
+</blueprint>

Propchange: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/resources/OSGI-INF/blueprint/shell-geronimo.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message