geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject cvs commit: incubator-geronimo/modules/explorer/src/java/org/apache/geronimo/explorer ExplorerMain.java
Date Tue, 11 Nov 2003 21:55:16 GMT
chirino     2003/11/11 13:55:16

  Modified:    modules/explorer project.xml
               modules/explorer/src/java/org/apache/geronimo/explorer
                        ExplorerMain.java
  Log:
  - Wired in geronimo remoting to provide the remote MBeanServer reference that the explorer
needs.
  
  Revision  Changes    Path
  1.2       +31 -2     incubator-geronimo/modules/explorer/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/explorer/project.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- project.xml	29 Oct 2003 09:01:53 -0000	1.1
  +++ project.xml	11 Nov 2003 21:55:16 -0000	1.2
  @@ -38,7 +38,17 @@
           <runtime>true</runtime>
         </properties>
       </dependency>
  -    
  +
  +    <dependency>
  +      <groupId>geronimo</groupId>
  +      <artifactId>geronimo-core</artifactId>
  +      <version>DEV</version>
  +      <properties>
  +        <module>true</module>
  +        <runtime>true</runtime>
  +      </properties>
  +    </dependency>
  +
       <!-- Thirdparty Dependencies -->
       
       <dependency>
  @@ -78,6 +88,25 @@
         <version>1.3.4</version>
         <url>http://asm.objectweb.org/</url>
       </dependency>
  +
  +    <!-- Runtime dependencies due to remoting -->
  +    <dependency>
  +       <id>commons-lang</id>
  +       <version>SNAPSHOT</version>
  +       <url>http://jakarta.apache.org/commons/lang</url>
  +       <properties>
  +         <runtime>false</runtime>
  +       </properties>
  +    </dependency>
  +
  +    <dependency>
  +       <id>concurrent</id>
  +       <version>1.3.2</version>
  +       <properties>
  +          <runtime>true</runtime>
  +       </properties>
  +    </dependency>    
  +    
   
     </dependencies>
     
  
  
  
  1.2       +15 -12    incubator-geronimo/modules/explorer/src/java/org/apache/geronimo/explorer/ExplorerMain.java
  
  Index: ExplorerMain.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/explorer/src/java/org/apache/geronimo/explorer/ExplorerMain.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ExplorerMain.java	29 Oct 2003 09:01:53 -0000	1.1
  +++ ExplorerMain.java	11 Nov 2003 21:55:16 -0000	1.2
  @@ -58,14 +58,11 @@
   
   import groovy.lang.GroovyObject;
   
  -import javax.management.InstanceAlreadyExistsException;
  -import javax.management.MBeanRegistrationException;
  +import java.net.URISyntaxException;
  +
   import javax.management.MBeanServer;
  -import javax.management.MBeanServerFactory;
  -import javax.management.MalformedObjectNameException;
  -import javax.management.NotCompliantMBeanException;
  -import javax.management.ObjectName;
   
  +import org.apache.geronimo.remoting.jmx.RemoteMBeanServerFactory;
   import org.codehaus.groovy.runtime.InvokerHelper;
   
   /**
  @@ -76,9 +73,14 @@
    */
   public class ExplorerMain {
       public static void main(String[] args) {
  +        
  +        String host="localhost";
  +        if( args.length > 0 )
  +            host = args[0];
  +        
           try {
               GroovyObject explorer = (GroovyObject) ExplorerMain.class.getClassLoader().loadClass("org.apache.geronimo.explorer.Explorer").newInstance();
  -            InvokerHelper.setProperty(explorer, "treeModel", getMBeanTreeModel());
  +            InvokerHelper.setProperty(explorer, "treeModel", getMBeanTreeModel(host));
               explorer.invokeMethod("run", null);
           }
           catch (Exception e) {
  @@ -87,12 +89,13 @@
           }
       }
   
  -    public static MBeanTreeModel getMBeanTreeModel()
  +    public static MBeanTreeModel getMBeanTreeModel(String host)
           throws Exception {
  -        return new MBeanTreeModel(getMBeanServer());
  +        return new MBeanTreeModel(getMBeanServer(host));
       }
       
  -    public static MBeanServer getMBeanServer() {
  -        return MBeanServerFactory.createMBeanServer();
  +    public static MBeanServer getMBeanServer(String host) throws URISyntaxException {
  +        return RemoteMBeanServerFactory.create(host);
  +        //return MBeanServerFactory.createMBeanServer();
       }
   }
  
  
  

Mime
View raw message