You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by am...@apache.org on 2004/11/10 04:40:02 UTC

svn commit: rev 57125 - in geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment: . cli

Author: ammulder
Date: Tue Nov  9 19:40:02 2004
New Revision: 57125

Modified:
   geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Bootstrap.java
   geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
   geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/CommandPackage.java
   geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java
Log:
Restore the old main-GBean and main-method attributes/options for the
  deploy tool.  They're not used in quite the same way, but the net
  effect is the same.  (GERONIMO-465)


Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Bootstrap.java
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Bootstrap.java	(original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Bootstrap.java	Tue Nov  9 19:40:02 2004
@@ -130,8 +130,8 @@
             mainAttributes.putValue(Attributes.Name.MANIFEST_VERSION.toString(), "1.0");
             mainAttributes.putValue(Attributes.Name.MAIN_CLASS.toString(), "org.apache.geronimo.deployment.cli.DeployTool");
             mainAttributes.putValue(Attributes.Name.CLASS_PATH.toString(), deployerClassPath);
-//            mainAttributes.putValue(CommandLineManifest.MAIN_GBEAN.toString(), deployerGBean);
-//            mainAttributes.putValue(CommandLineManifest.MAIN_METHOD.toString(), "deploy");
+            mainAttributes.putValue(CommandLineManifest.MAIN_GBEAN.toString(), deployerGBean);
+            mainAttributes.putValue(CommandLineManifest.MAIN_METHOD.toString(), "deploy");
             mainAttributes.putValue(CommandLineManifest.CONFIGURATIONS.toString(), j2eeDeployerConfig.getConfigId());
 
             // attribute that indicates to a JSR-88 tool that we have a Deployment factory

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java	(original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java	Tue Nov  9 19:40:02 2004
@@ -117,7 +117,7 @@
     }
 
     private void executeOffline(ServerConnection connection, PrintWriter out, File module, File plan) throws DeploymentException {
-        List list = (List)connection.invokeOfflineDeployer("deploy", new Object[]{module, plan},
+        List list = (List)connection.invokeOfflineDeployer(new Object[]{module, plan},
                         new String[]{File.class.getName(), File.class.getName()});
         for(Iterator it = list.iterator(); it.hasNext();) {
             out.println(getAction()+" "+it.next());

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/CommandPackage.java
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/CommandPackage.java	(original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/CommandPackage.java	Tue Nov  9 19:40:02 2004
@@ -117,7 +117,7 @@
         if(plan != null) {
             plan = plan.getAbsoluteFile();
         }
-        List list = (List)connection.invokeOfflineDeployer("deploy", new Object[]{plan, module, packageFile, install ? Boolean.TRUE : Boolean.FALSE, mainClass, classPath},
+        List list = (List)connection.invokeOfflineDeployer(new Object[]{plan, module, packageFile, install ? Boolean.TRUE : Boolean.FALSE, mainClass, classPath},
                         new String[]{File.class.getName(), File.class.getName(), File.class.getName(), boolean.class.getName(), String.class.getName(), String.class.getName()});
         for (int j = 0; j < list.size(); j++) {
             out.println("Packaged configuration "+list.get(j)+" to "+packageFile);

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java	(original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java	Tue Nov  9 19:40:02 2004
@@ -67,7 +67,6 @@
         return OPTION_HELP;
     }
 
-    private final static String DEPLOYER_OBJECT_NAME="geronimo.deployment:role=Deployer,config=org/apache/geronimo/J2EEDeployer";
     private final static String DEFAULT_URI = "deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector";
 
     private DeploymentManager manager;
@@ -208,28 +207,34 @@
         return manager != null;
     }
 
-    public Object invokeOfflineDeployer(String method, Object[] args, String[] argTypes) throws DeploymentException {
+    public Object invokeOfflineDeployer(Object[] args, String[] argTypes) throws DeploymentException {
         if(kernel == null) {
             throw new IllegalStateException("Cannot attempt to package when no local kernel is available");
         }
-        try {
-            return kernel.invoke(new ObjectName(DEPLOYER_OBJECT_NAME), method, args, argTypes);
-        } catch(MalformedObjectNameException e) {
-            throw new DeploymentException("This should never happen", e);
-        }
+        return kernel.invoke(args, argTypes);
     }
 
     private static class KernelWrapper extends CommandLine {
-        public Object invoke(ObjectName target, String method, Object[] args, String[] argTypes) throws DeploymentException {
+        private ObjectName mainGbean;
+        private String mainMethod;
+        private List configurations;
+
+        public KernelWrapper() {
+            CommandLineManifest entries = CommandLineManifest.getManifestEntries();
+            configurations = entries.getConfigurations();
+            mainGbean = entries.getMainGBean();
+            mainMethod = entries.getMainMethod();
+        }
+
+        public Object invoke(Object[] args, String[] argTypes) throws DeploymentException {
             try {
-                return getKernel().invoke(target, method, args, argTypes);
+                return getKernel().invoke(mainGbean, mainMethod, args, argTypes);
             } catch(Exception e) {
                 throw new DeploymentException("Unable to connect to local deployer service", e);
             }
         }
 
         public void start() throws DeploymentException {
-            List configurations = CommandLineManifest.getManifestEntries().getConfigurations();
             try {
                 super.startKernel(configurations);
             } catch(Exception e) {