You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ch...@apache.org on 2003/08/29 21:33:43 UTC

cvs commit: incubator-geronimo/modules/core/src/deploy remoting-service.xml

chirino     2003/08/29 12:33:43

  Modified:    .        maven.xml
               modules/common/src/java/org/apache/geronimo/common
                        Classes.java
               modules/common/src/test/org/apache/geronimo/common
                        ClassesTest.java
  Added:       modules/core/src/deploy remoting-service.xml
  Log:
  update the main maven.xml so that and module/*/src/deploy folders get aggregated to the server /deploy folder.
  Added a remoting-service.xml which deploys the remoting service in the geronimo server.
  
  Revision  Changes    Path
  1.30      +40 -2     incubator-geronimo/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/maven.xml,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- maven.xml	29 Aug 2003 12:37:35 -0000	1.29
  +++ maven.xml	29 Aug 2003 19:33:43 -0000	1.30
  @@ -161,6 +161,13 @@
           target="${aggregate.dir}/etc"
           include="**/*"/>
       </define:tag>
  +
  +    <define:tag name="deploy">
  +      <aggregate:copy
  +        source="${module.root}/src/deploy"
  +        target="${aggregate.dir}/deploy"
  +        include="**/*"/>
  +    </define:tag>
       
       <define:tag name="libraries">
         <aggregate:copy
  @@ -172,6 +179,7 @@
       <define:tag name="default">
         <aggregate:scripts/>
         <aggregate:config/>
  +      <aggregate:deploy/>
         <aggregate:libraries/>
       </define:tag>
       
  @@ -415,5 +423,35 @@
         </java>
       </j:jelly>
     </goal>
  - 
  +
  +  <goal name="debug:main">
  +    <j:set var="run.dir" value="${basedir}/target/${release.id}"/>
  +    <j:jelly xmlns="jelly:ant">
  +
  +        <java classname="org.apache.geronimo.Main" 
  +            fork="true"
  +            maxmemory="128m"
  +            failonerror="true"
  +            dir="${run.dir}">
  +
  +        <classpath>
  +          <pathelement path="${run.dir}/etc"/>
  +          <fileset dir="${run.dir}/lib">
  +            <include name="*.jar"/>
  +            <exclude name="xerces-2.4.0.jar"/>
  +          </fileset>              
  +        </classpath>
  +
  +        <jvmarg value="-Xdebug"/>
  +        <jvmarg value="-Xnoagent"/>
  +        <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/>
  +
  +        <sysproperty key="program.name" value="maven:debug"/>
  +        <sysproperty key="geronimo.home" value="file:${run.dir}/"/>
  +        <sysproperty key="java.compiler" value="NONE"/>
  +
  +      </java>
  +    </j:jelly>
  +  </goal>
  +
   </project>
  
  
  
  1.2       +40 -6     incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/Classes.java
  
  Index: Classes.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/Classes.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Classes.java	28 Aug 2003 09:08:03 -0000	1.1
  +++ Classes.java	29 Aug 2003 19:33:43 -0000	1.2
  @@ -56,14 +56,11 @@
   
   package org.apache.geronimo.common;
   
  +import java.lang.reflect.Array;
   import java.lang.reflect.Method;
   import java.lang.reflect.Modifier;
  -import java.lang.reflect.Array;
  -
  -import java.util.Map;
   import java.util.HashMap;
  -
  -import java.io.IOException;
  +import java.util.Map;
   
   /**
    * A collection of <code>Class</code> utilities.
  @@ -251,6 +248,23 @@
           VM_PRIMITIVES.put("Z", boolean.class);
           VM_PRIMITIVES.put("V", void.class);
       }
  +
  +    /** VM primitive type primitive type ->  name  */
  +    private static final HashMap VM_PRIMITIVES_REVERSE = new HashMap();
  +    
  +    /** Setup the vm primitives reverse map. */
  +    static
  +    {
  +        VM_PRIMITIVES_REVERSE.put(byte.class, "B");
  +        VM_PRIMITIVES_REVERSE.put(char.class, "C");
  +        VM_PRIMITIVES_REVERSE.put(double.class, "D");
  +        VM_PRIMITIVES_REVERSE.put(float.class,"F");
  +        VM_PRIMITIVES_REVERSE.put(int.class, "I");
  +        VM_PRIMITIVES_REVERSE.put(long.class, "J");
  +        VM_PRIMITIVES_REVERSE.put(short.class,"S");
  +        VM_PRIMITIVES_REVERSE.put(boolean.class, "Z");
  +        VM_PRIMITIVES_REVERSE.put(void.class, "V");
  +    }
       
       /**
        * Get the primitive type for the given VM primitive name.
  @@ -435,4 +449,24 @@
           // Else we can not load (give up)
           throw new ClassNotFoundException(className);
       }
  +    
  +    /**
  +     */
  +    public static String getClassName(Class clazz) {
  +        StringBuffer rc = new StringBuffer();
  +        while (clazz.isArray()) {
  +            rc.append('[');
  +            clazz = clazz.getComponentType();
  +        }
  +        if (!clazz.isPrimitive()) {
  +            rc.append('L');
  +            rc.append(clazz.getName());
  +            rc.append(';');
  +        } else {
  +            rc.append(VM_PRIMITIVES_REVERSE.get(clazz));
  +        }
  +        return rc.toString();
  +    }
  +
   }
  +   
  
  
  
  1.2       +39 -1     incubator-geronimo/modules/common/src/test/org/apache/geronimo/common/ClassesTest.java
  
  Index: ClassesTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/common/src/test/org/apache/geronimo/common/ClassesTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ClassesTest.java	28 Aug 2003 09:08:03 -0000	1.1
  +++ ClassesTest.java	29 Aug 2003 19:33:43 -0000	1.2
  @@ -126,4 +126,42 @@
           Class type = loadClass(className);
           assertEquals(byte[].class, type);
       }
  +
  +    public void testgetClassName() throws ClassNotFoundException {
  +        Class t;
  +        Class y;
  +        String x;
  +
  +        t= String.class;
  +        x = Classes.getClassName(t);
  +        y = loadClass(x);
  +        assertEquals(t,y);
  +        
  +        t= int.class;
  +        x = Classes.getClassName(t);
  +        y = loadClass(x);
  +        assertEquals(t,y);
  +
  +        t= String[].class;
  +        x = Classes.getClassName(t);
  +        y = loadClass(x);
  +        assertEquals(t,y);
  +
  +        t= int[].class;
  +        x = Classes.getClassName(t);
  +        y = loadClass(x);
  +        assertEquals(t,y);
  +
  +        t= String[][].class;
  +        x = Classes.getClassName(t);
  +        y = loadClass(x);
  +        assertEquals(t,y);
  +
  +        t= int[][].class;
  +        x = Classes.getClassName(t);
  +        y = loadClass(x);
  +        assertEquals(t,y);
  +
  +    }
  +    
   }
  
  
  
  1.1                  incubator-geronimo/modules/core/src/deploy/remoting-service.xml
  
  Index: remoting-service.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <components>
  
      <!-- ============================================================ -->
      <!-- Starts the remoting async://0.0.0.0:3434 transport           -->
      <!-- ============================================================ -->
      <mbean code="org.apache.geronimo.remoting.transport.TransportLoader"
              name="geronimo.remoting:transport=async">
          <attribute name="BindURI">async://0.0.0.0:3434</attribute>
          <attribute name="RouterTarget">geronimo.remoting:router=SubsystemRouter</attribute>
          <depends name="geronimo.remoting:router=SubsystemRouter"/>
      </mbean>
  
      <!-- ============================================================ -->
      <!-- Sets up the SubSystem router.                                -->
      <!-- ============================================================ -->
      <mbean code="org.apache.geronimo.remoting.router.SubsystemRouter" 
              name="geronimo.remoting:router=SubsystemRouter">
      </mbean>
  
      <mbean code="org.apache.geronimo.jmx.Relationship" 
             name="geronimo.remoting:role=Relationship,name=Route">
          <constructor>
              <arg type="java.lang.String">
                  name=Route
                  left.name=Source
                  right.name=Target
                  right.class=org.apache.geronimo.remoting.router.RouterTargetMBean
              </arg>
          </constructor>
      </mbean>
  
      <!-- ============================================================ -->
      <!-- Sets up the JMX Router.                                      -->
      <!--  This router Uses ObjectNames to route invocations.          -->
      <!-- Sample URI to Target:                                        -->
      <!--   async://localhost:3434/JMX#geronimo.test:service=Test      -->
      <!-- ============================================================ -->
      <mbean code="org.apache.geronimo.remoting.router.JMXRouter" 
              name="geronimo.remoting:router=JMXRouter">
          <depends name="geronimo.remoting:role=Relationship,name=Route"/>
          <relationship type="Route" name="/JMX" role="Target" 
                  target="geronimo.remoting:router=SubsystemRouter" targetRole="Source"/>
      </mbean>    
  
      <!-- ============================================================ -->
      <!-- Sets up the InterceptorRegistry Router.                      -->
      <!--  This router uses dynamic oids (generated by the             -->
      <!--  InterceptorRegistry) to route invocations.                  -->
      <!-- Sample URI to Target:                                        -->
      <!--   async://localhost:3434/Remoting#121                        -->
      <!-- ============================================================ -->
      <mbean code="org.apache.geronimo.remoting.router.InterceptorRegistryRouter" 
              name="geronimo.remoting:router=InterceptorRegistryRouter">
          <depends name="geronimo.remoting:role=Relationship,name=Route"/>
          <relationship type="Route" name="/Remoting" role="Target" 
                  target="geronimo.remoting:router=SubsystemRouter" targetRole="Source"/>
      </mbean>    
  
      <!-- ============================================================ -->
      <!-- Expose the MBeanServer via remoting URI                      -->
      <!--   async://localhost:3434/JMX#geronimo.jmx:target=MBeanServerStub -->
      <!-- ============================================================ -->
      <mbean code="org.apache.geronimo.jmx.MBeanServerStub" 
              name="geronimo.remoting:target=MBeanServerStub">
      </mbean>    
  
  
  </components>