From geronimo-cvs-return-802-apmail-incubator-geronimo-cvs-archive=incubator.apache.org@incubator.apache.org Fri Aug 29 19:33:50 2003 Return-Path: Delivered-To: apmail-incubator-geronimo-cvs-archive@www.apache.org Received: (qmail 64493 invoked from network); 29 Aug 2003 19:33:50 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 29 Aug 2003 19:33:50 -0000 Received: (qmail 28517 invoked by uid 500); 29 Aug 2003 19:33:36 -0000 Delivered-To: apmail-incubator-geronimo-cvs-archive@incubator.apache.org Received: (qmail 28484 invoked by uid 500); 29 Aug 2003 19:33:35 -0000 Mailing-List: contact geronimo-cvs-help@incubator.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: geronimo-dev@incubator.apache.org Delivered-To: mailing list geronimo-cvs@incubator.apache.org Received: (qmail 28465 invoked from network); 29 Aug 2003 19:33:35 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 29 Aug 2003 19:33:35 -0000 Received: (qmail 64458 invoked by uid 1724); 29 Aug 2003 19:33:43 -0000 Date: 29 Aug 2003 19:33:43 -0000 Message-ID: <20030829193343.64457.qmail@minotaur.apache.org> From: chirino@apache.org To: incubator-geronimo-cvs@apache.org Subject: cvs commit: incubator-geronimo/modules/core/src/deploy remoting-service.xml X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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="**/*"/> + + + + + @@ -415,5 +423,35 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 Class 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 =================================================================== async://0.0.0.0:3434 geronimo.remoting:router=SubsystemRouter name=Route left.name=Source right.name=Target right.class=org.apache.geronimo.remoting.router.RouterTargetMBean