hammant 02/01/05 07:20:53
Modified: armi test.xml
armi/src/java/org/apache/commons/armi/client
ArmiFactory.java
armi/src/java/org/apache/commons/armi/client/impl
ClientClassArmiFactory.java
ServerClassArmiFactory.java
armi/src/java/org/apache/commons/armi/generator
PrimarySourceGenerator.java
armi/src/java/org/apache/commons/armi/generator/ant
ArmiInterfaceTask.java
armi/src/java/org/apache/commons/armi/server ArmiServer.java
armi/src/java/org/apache/commons/armi/server/impl
AbstractServer.java BCELClassRetriever.java
Added: armi/src/java/org/apache/commons/armi/client/impl
AbstractArmiFactory.java
armi/src/java/org/apache/commons/armi/generator
SourceGenerationException.java
Log:
some renames/abstractions and generation exception
Revision Changes Path
1.5 +2 -2 jakarta-commons-sandbox/armi/test.xml
Index: test.xml
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/armi/test.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- test.xml 4 Jan 2002 21:09:14 -0000 1.4
+++ test.xml 5 Jan 2002 15:20:52 -0000 1.5
@@ -3,7 +3,7 @@
<!--
"Alt (to) RMI" component of the Jakarta Commons Subproject
- $Id: test.xml,v 1.4 2002/01/04 21:09:14 hammant Exp $
+ $Id: test.xml,v 1.5 2002/01/05 15:20:52 hammant Exp $
-->
@@ -92,7 +92,7 @@
<target name="generate" depends="prepare">
<armiinterfaces genname="Hello" gendir="${build.home}/genjava"
- interfaces="org.apache.commons.armi.test.TestInterface" />
+ classesorinterfaces="org.apache.commons.armi.test.TestInterface" />
<javac srcdir="${build.home}/genjava"
destdir="${build.home}/classes2"
1.5 +7 -7
jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/ArmiFactory.java
Index: ArmiFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/ArmiFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ArmiFactory.java 1 Jan 2002 23:12:46 -0000 1.4
+++ ArmiFactory.java 5 Jan 2002 15:20:52 -0000 1.5
@@ -1,8 +1,8 @@
/*
- * $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/ArmiFactory.java,v
1.4 2002/01/01 23:12:46 hammant Exp $
- * $Revision: 1.4 $
- * $Date: 2002/01/01 23:12:46 $
+ * $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/ArmiFactory.java,v
1.5 2002/01/05 15:20:52 hammant Exp $
+ * $Revision: 1.5 $
+ * $Date: 2002/01/05 15:20:52 $
*
* ====================================================================
*
@@ -68,13 +68,13 @@
/**
- * Class ArmiFactory
+ * Interface ArmiFactory
*
*
* @author Paul Hammant <a
href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
-public abstract class ArmiFactory {
+public interface ArmiFactory {
/**
@@ -89,7 +89,7 @@
* @throws ArmiConnectionException
*
*/
- public abstract Object lookup(ArmiHostContext hostContext, String
publishedServiceName)
+ Object lookup(ArmiHostContext hostContext, String publishedServiceName)
throws ArmiConnectionException;
}
1.2 +3 -3
jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/ClientClassArmiFactory.java
Index: ClientClassArmiFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/ClientClassArmiFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ClientClassArmiFactory.java 30 Dec 2001 00:42:10 -0000 1.1
+++ ClientClassArmiFactory.java 5 Jan 2002 15:20:52 -0000 1.2
@@ -1,8 +1,8 @@
/*
- * $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/ClientClassArmiFactory.java,v
1.1 2001/12/30 00:42:10 hammant Exp $
- * $Revision: 1.1 $
- * $Date: 2001/12/30 00:42:10 $
+ * $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/ClientClassArmiFactory.java,v
1.2 2002/01/05 15:20:52 hammant Exp $
+ * $Revision: 1.2 $
+ * $Date: 2002/01/05 15:20:52 $
*
* ====================================================================
*
@@ -70,9 +70,9 @@
*
*
* @author Paul Hammant <a
href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
-public class ClientClassArmiFactory extends ArmiFactory {
+public class ClientClassArmiFactory extends AbstractArmiFactory {
/**
* Method lookup
1.4 +5 -5
jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/ServerClassArmiFactory.java
Index: ServerClassArmiFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/ServerClassArmiFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ServerClassArmiFactory.java 31 Dec 2001 13:48:21 -0000 1.3
+++ ServerClassArmiFactory.java 5 Jan 2002 15:20:52 -0000 1.4
@@ -1,8 +1,8 @@
/*
- * $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/ServerClassArmiFactory.java,v
1.3 2001/12/31 13:48:21 hammant Exp $
- * $Revision: 1.3 $
- * $Date: 2001/12/31 13:48:21 $
+ * $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/ServerClassArmiFactory.java,v
1.4 2002/01/05 15:20:52 hammant Exp $
+ * $Revision: 1.4 $
+ * $Date: 2002/01/05 15:20:52 $
*
* ====================================================================
*
@@ -77,9 +77,9 @@
*
*
* @author Paul Hammant <a
href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
-public class ServerClassArmiFactory extends ArmiFactory {
+public class ServerClassArmiFactory extends AbstractArmiFactory {
private HashMap mPublishedServiceClassLoaders = new HashMap();
1.1
jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/AbstractArmiFactory.java
Index: AbstractArmiFactory.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/client/impl/AbstractArmiFactory.java,v
1.1 2002/01/05 15:20:52 hammant Exp $
* $Revision: 1.1 $
* $Date: 2002/01/05 15:20:52 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.commons.armi.client.impl;
import org.apache.commons.armi.client.ArmiFactory;
/**
* Class AbstractArmiFactory
*
*
* @author Paul Hammant <a
href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
* @version $Revision: 1.1 $
*/
public abstract class AbstractArmiFactory implements ArmiFactory {
}
1.4 +22 -16
jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/generator/PrimarySourceGenerator.java
Index: PrimarySourceGenerator.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/generator/PrimarySourceGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PrimarySourceGenerator.java 4 Jan 2002 13:15:30 -0000 1.3
+++ PrimarySourceGenerator.java 5 Jan 2002 15:20:52 -0000 1.4
@@ -1,8 +1,8 @@
/*
- * $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/generator/PrimarySourceGenerator.java,v
1.3 2002/01/04 13:15:30 hammant Exp $
- * $Revision: 1.3 $
- * $Date: 2002/01/04 13:15:30 $
+ * $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/generator/PrimarySourceGenerator.java,v
1.4 2002/01/05 15:20:52 hammant Exp $
+ * $Revision: 1.4 $
+ * $Date: 2002/01/05 15:20:52 $
*
* ====================================================================
*
@@ -73,6 +73,7 @@
import java.io.PrintWriter;
import java.io.FileOutputStream;
import java.io.FileNotFoundException;
+import java.io.Serializable;
/**
@@ -80,24 +81,24 @@
*
*
* @author Paul Hammant <a
href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class PrimarySourceGenerator extends AbstractMethodHandler {
- private String[] mInterfacesToExpose;
+ private String[] mClassesOrInterfacesToExpose;
private String mGenDir;
private String mGenName;
private PrintWriter mClassSource;
/**
- * Method setInterfacesToExpose
+ * Method setClassOrInterfacesToExpose
*
*
- * @param interfacesToExpose
+ * @param classesOrInterfacesToExpose
*
*/
- public void setInterfacesToExpose(String[] interfacesToExpose) {
- mInterfacesToExpose = interfacesToExpose;
+ public void setClassOrInterfacesToExpose(String[] classesOrInterfacesToExpose) {
+ mClassesOrInterfacesToExpose = classesOrInterfacesToExpose;
}
/**
@@ -129,7 +130,7 @@
* bean should be castable to the prescribed interfaces or not.
*
*/
- public void generate(boolean beanOnly) {
+ public void generate(boolean beanOnly) throws SourceGenerationException {
// methdos could be in more than one interface.
Vector methodsDone = new Vector();
@@ -150,11 +151,11 @@
}
mClassSource.println(" { ");
- for (int x = 0; x < mInterfacesToExpose.length; x++) {
+ for (int x = 0; x < mClassesOrInterfacesToExpose.length; x++) {
Class clazz = null;
try {
- clazz = Class.forName(mInterfacesToExpose[x]);
+ clazz = Class.forName(mClassesOrInterfacesToExpose[x]);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
@@ -169,6 +170,9 @@
methodsDone.add(methodSignature);
String rClass = method.getReturnType().getName();
+ if (!(method.getReturnType() instanceof Serializable)) {
+ throw new SourceGenerationException("Return type " + rClass
+ " must be serializable");
+ }
String mName = method.getName();
mClassSource.print(" public " + rClass + " " + mName + " (");
@@ -177,7 +181,9 @@
for (int i = 0; i < argTypes.length; i++) {
String cn = argTypes[i].getName();
-
+ if (!(argTypes[i] instanceof Serializable)) {
+ throw new SourceGenerationException("Argument type " +
cn + " must be serializable");
+ }
generateParameter(cn, argTypes, i);
}
@@ -267,10 +273,10 @@
private void generateInterfaceList() {
- for (int x = 0; x < mInterfacesToExpose.length; x++) {
- mClassSource.print(mInterfacesToExpose[x]);
+ for (int x = 0; x < mClassesOrInterfacesToExpose.length; x++) {
+ mClassSource.print(mClassesOrInterfacesToExpose[x]);
- if (x + 1 < mInterfacesToExpose.length) {
+ if (x + 1 < mClassesOrInterfacesToExpose.length) {
mClassSource.print(", ");
}
}
1.1
jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/generator/SourceGenerationException.java
Index: SourceGenerationException.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/generator/SourceGenerationException.java,v
1.1 2002/01/05 15:20:52 hammant Exp $
* $Revision: 1.1 $
* $Date: 2002/01/05 15:20:52 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.commons.armi.generator;
public class SourceGenerationException extends Exception {
public SourceGenerationException(String s) {
super(s);
}
}
1.3 +16 -11
jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/generator/ant/ArmiInterfaceTask.java
Index: ArmiInterfaceTask.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/generator/ant/ArmiInterfaceTask.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ArmiInterfaceTask.java 4 Jan 2002 09:35:31 -0000 1.2
+++ ArmiInterfaceTask.java 5 Jan 2002 15:20:52 -0000 1.3
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/generator/ant/ArmiInterfaceTask.java,v
1.2 2002/01/04 09:35:31 hammant Exp $
- * $Revision: 1.2 $
- * $Date: 2002/01/04 09:35:31 $
+ * $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/generator/ant/ArmiInterfaceTask.java,v
1.3 2002/01/05 15:20:52 hammant Exp $
+ * $Revision: 1.3 $
+ * $Date: 2002/01/05 15:20:52 $
*
* ====================================================================
*
@@ -64,13 +64,14 @@
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.util.FileUtils;
import org.apache.commons.armi.generator.PrimarySourceGenerator;
+import org.apache.commons.armi.generator.SourceGenerationException;
import java.util.StringTokenizer;
import java.util.Vector;
public class ArmiInterfaceTask extends Task {
- private String[] mInterfacesToExpose;
+ private String[] mClassOrInterfacesToExpose;
private String mGenDir;
private String mGenName;
private boolean mBeanOnly;
@@ -78,14 +79,14 @@
public ArmiInterfaceTask() {
}
- public void setInterfaces(String interfacesToExpose) {
- StringTokenizer st = new StringTokenizer(interfacesToExpose, ",");
+ public void setClassesorinterfaces(String ClassOrInterfacesToExpose) {
+ StringTokenizer st = new StringTokenizer(ClassOrInterfacesToExpose, ",");
Vector strings = new Vector();
while (st.hasMoreTokens()) {
strings.add(st.nextToken().trim());
}
- mInterfacesToExpose = new String[strings.size()];
- strings.copyInto(mInterfacesToExpose);
+ mClassOrInterfacesToExpose = new String[strings.size()];
+ strings.copyInto(mClassOrInterfacesToExpose);
}
@@ -104,7 +105,7 @@
public void execute() throws BuildException {
- if (mInterfacesToExpose == null) {
+ if (mClassOrInterfacesToExpose == null) {
throw new BuildException("Specify at least one interface to expose");
}
if (mGenDir == null) {
@@ -116,7 +117,11 @@
PrimarySourceGenerator sg = new PrimarySourceGenerator();
sg.setGenDir(mGenDir);
sg.setGenName(mGenName);
- sg.setInterfacesToExpose(mInterfacesToExpose);
- sg.generate(mBeanOnly);
+ sg.setClassOrInterfacesToExpose(mClassOrInterfacesToExpose);
+ try {
+ sg.generate(mBeanOnly);
+ } catch (SourceGenerationException sge) {
+ throw new BuildException(sge.getMessage());
+ }
}
}
1.6 +8 -8
jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/ArmiServer.java
Index: ArmiServer.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/ArmiServer.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ArmiServer.java 4 Jan 2002 09:35:31 -0000 1.5
+++ ArmiServer.java 5 Jan 2002 15:20:53 -0000 1.6
@@ -1,8 +1,8 @@
/*
- * $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/ArmiServer.java,v
1.5 2002/01/04 09:35:31 hammant Exp $
- * $Revision: 1.5 $
- * $Date: 2002/01/04 09:35:31 $
+ * $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/ArmiServer.java,v
1.6 2002/01/05 15:20:53 hammant Exp $
+ * $Revision: 1.6 $
+ * $Date: 2002/01/05 15:20:53 $
*
* ====================================================================
*
@@ -72,7 +72,7 @@
*
*
* @author Paul Hammant <a
href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
- * @version * $Revision: 1.5 $
+ * @version * $Revision: 1.6 $
*/
public interface ArmiServer {
@@ -82,10 +82,10 @@
*
* @param impl
* @param asName
- * @param interfaceToExpose
+ * @param classOrInterfaceToExpose
*
*/
- void publish(Object impl, String asName, Class interfaceToExpose) throws
ArmiPublicationException;
+ void publish(Object impl, String asName, Class classOrInterfaceToExpose) throws
ArmiPublicationException;
/**
* Method publish
@@ -93,10 +93,10 @@
*
* @param impl
* @param asName
- * @param interfacesToExpose
+ * @param classesOrInterfacesToExpose
*
*/
- void publish(Object impl, String asName, Class[] interfacesToExpose) throws
ArmiPublicationException;
+ void publish(Object impl, String asName, Class[] classesOrInterfacesToExpose)
throws ArmiPublicationException;
/**
* Method unPublish
1.9 +14 -14
jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/impl/AbstractServer.java
Index: AbstractServer.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/impl/AbstractServer.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- AbstractServer.java 4 Jan 2002 09:35:31 -0000 1.8
+++ AbstractServer.java 5 Jan 2002 15:20:53 -0000 1.9
@@ -1,8 +1,8 @@
/*
- * $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/impl/AbstractServer.java,v
1.8 2002/01/04 09:35:31 hammant Exp $
- * $Revision: 1.8 $
- * $Date: 2002/01/04 09:35:31 $
+ * $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/impl/AbstractServer.java,v
1.9 2002/01/05 15:20:53 hammant Exp $
+ * $Revision: 1.9 $
+ * $Date: 2002/01/05 15:20:53 $
*
* ====================================================================
*
@@ -94,7 +94,7 @@
*
*
* @author Paul Hammant <a
href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
- * @version $Revision: 1.8 $
+ * @version $Revision: 1.9 $
*/
public abstract class AbstractServer extends AbstractMethodHandler implements
ArmiServer {
@@ -116,11 +116,11 @@
*
* @param impl
* @param asName
- * @param interfaceToExpose
+ * @param classOrInterfaceToExpose
*
*/
- public void publish(Object impl, String asName, Class interfaceToExpose) throws
ArmiPublicationException{
- publish(impl, asName, new Class[]{ interfaceToExpose });
+ public void publish(Object impl, String asName, Class classOrInterfaceToExpose)
throws ArmiPublicationException{
+ publish(impl, asName, new Class[]{ classOrInterfaceToExpose });
}
/**
@@ -129,26 +129,26 @@
*
* @param impl
* @param asName
- * @param interfacesToExpose
+ * @param classesOrInterfacesToExpose
*
*/
- public void publish(Object impl, String asName, Class[] interfacesToExpose)
throws ArmiPublicationException{
+ public void publish(Object impl, String asName, Class[]
classesOrInterfacesToExpose) throws ArmiPublicationException{
if (mPublishedObjects.containsKey(asName)) {
throw new ArmiPublicationException("Service '"+asName+"' already
published");
}
- String[] interfaceNames = new String[interfacesToExpose.length];
+ String[] interfaceNames = new String[classesOrInterfacesToExpose.length];
- for (int i = 0; i < interfacesToExpose.length; i++) {
- interfaceNames[i] = interfacesToExpose[i].getName();
+ for (int i = 0; i < classesOrInterfacesToExpose.length; i++) {
+ interfaceNames[i] = classesOrInterfacesToExpose[i].getName();
}
HashMap methodMap = new HashMap();
DefaultInvocationHandler dih = new DefaultInvocationHandler(impl,
methodMap);
- for (int x = 0; x < interfacesToExpose.length; x++) {
- Method methods[] = interfacesToExpose[x].getMethods();
+ for (int x = 0; x < classesOrInterfacesToExpose.length; x++) {
+ Method methods[] = classesOrInterfacesToExpose[x].getMethods();
for (int y = 0; y < methods.length; y++) {
Method method = methods[y];
1.4 +11 -11
jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/impl/BCELClassRetriever.java
Index: BCELClassRetriever.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/impl/BCELClassRetriever.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- BCELClassRetriever.java 4 Jan 2002 21:09:14 -0000 1.3
+++ BCELClassRetriever.java 5 Jan 2002 15:20:53 -0000 1.4
@@ -1,8 +1,8 @@
/*
- * $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/impl/BCELClassRetriever.java,v
1.3 2002/01/04 21:09:14 hammant Exp $
- * $Revision: 1.3 $
- * $Date: 2002/01/04 21:09:14 $
+ * $Header:
/home/cvs/jakarta-commons-sandbox/armi/src/java/org/apache/commons/armi/server/impl/BCELClassRetriever.java,v
1.4 2002/01/05 15:20:53 hammant Exp $
+ * $Revision: 1.4 $
+ * $Date: 2002/01/05 15:20:53 $
*
* ====================================================================
*
@@ -99,7 +99,7 @@
*
*
* @author Paul Hammant <a
href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class BCELClassRetriever extends AbstractMethodHandler implements
ClassRetriever {
@@ -138,10 +138,10 @@
PrintWriter mClassSource = new PrintWriter(System.out); // TODO delete this
from source when completed
- public void generate(String asName, Class[] interfacesToPublish) {
- String[] interfaces = new String[interfacesToPublish.length];
- for (int i = 0; i < interfacesToPublish.length; i++) {
- interfaces[i] = interfacesToPublish[i].getClass().getName();
+ public void generate(String asName, Class[] classOrInterfacesToPublish) {
+ String[] interfaces = new String[classOrInterfacesToPublish.length];
+ for (int i = 0; i < classOrInterfacesToPublish.length; i++) {
+ interfaces[i] = classOrInterfacesToPublish[i].getClass().getName();
}
ClassGen cg = new ClassGen("ArmiGenerated" + asName,
"org.apache.commons.armi.client.impl.BaseServedObject",
"<generated>", Constants.ACC_PUBLIC |
@@ -154,9 +154,9 @@
Vector methodsDone = new Vector();
- for (int x = 0; x < interfacesToPublish.length; x++) {
+ for (int x = 0; x < classOrInterfacesToPublish.length; x++) {
- Method[] methods = interfacesToPublish[x].getMethods();
+ Method[] methods = classOrInterfacesToPublish[x].getMethods();
for (int i = 0; i < methods.length; i++) {
Method method = methods[i];
String methodSignature = super.getMethodSignature(method);
@@ -196,7 +196,7 @@
System.out.println("pC " + pClasses[i].getName());
pTypes[i] = new ObjectType(pClasses[i].getName());
//Type.getType(pClasses[i].getName());
- pNames[i] = "v" + i;
+ pNames[i] = "v" + i; // <-- HERE is the 'v0' 's' bug
}
InstructionList il = new InstructionList();
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>