You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2005/07/12 23:44:57 UTC
svn commit: r216023 - in /incubator/beehive/sandbox/ekoneil/wsm: drt/
src/core/org/apache/beehive/wsm/databinding/xmlbeans/
src/core/org/apache/beehive/wsm/model/jsr181/
src/core/org/apache/beehive/wsm/model/wsdl/
src/core/org/apache/beehive/wsm/proces...
Author: ekoneil
Date: Tue Jul 12 14:44:56 2005
New Revision: 216023
URL: http://svn.apache.org/viewcvs?rev=216023&view=rev
Log:
Various cleanup of traces, DRT webapp build, etc...
BB: self
DRT: WSM pass
Modified:
incubator/beehive/sandbox/ekoneil/wsm/drt/build.xml
incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/databinding/xmlbeans/XmlBeanTypeLookup.java
incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181ObjectModelStore.java
incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/wsdl/XmlBeanWSDLProcessor.java
incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/processor2/generator/AxisGenerator.java
incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/processor2/model/factory/impl/MirrorFactoryImpl.java
incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/wsdl/Model2AJava.java
Modified: incubator/beehive/sandbox/ekoneil/wsm/drt/build.xml
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/drt/build.xml?rev=216023&r1=216022&r2=216023&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/drt/build.xml (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/drt/build.xml Tue Jul 12 14:44:56 2005
@@ -111,7 +111,19 @@
<target name="build.webapp">
<deploy-wsm webappDir="${webapp.dir}"/>
- <build-webapp webappDir="${webapp.dir}"/>
+
+ <fileset id="webapp.lib.jars" dir="${webapp.dir}/WEB-INF/lib">
+ <include name="*.jar"/>
+ </fileset>
+
+ <path id="webapp.classpath">
+ <fileset refid="webapp.lib.jars"/>
+ </path>
+
+ <build-webservices srcDir="${webapp.dir}/WEB-INF/src"
+ destDir="${webapp.dir}/WEB-INF/classes"
+ tempDir="${webapp.dir}/WEB-INF/.tmpbean-src"
+ classpathRef="webapp.classpath"/>
</target>
<target name="clean.webapp">
Modified: incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/databinding/xmlbeans/XmlBeanTypeLookup.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/databinding/xmlbeans/XmlBeanTypeLookup.java?rev=216023&r1=216022&r2=216023&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/databinding/xmlbeans/XmlBeanTypeLookup.java (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/databinding/xmlbeans/XmlBeanTypeLookup.java Tue Jul 12 14:44:56 2005
@@ -120,7 +120,6 @@
*/
for(Method meth : declared) {
Class returnType = meth.getReturnType();
- //System.out.println(returnType.getName());
if(!returnType.equals(Void.TYPE)) {
/*
* NOTE jcolwell@bea.com 2004-Nov-12 --
Modified: incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181ObjectModelStore.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181ObjectModelStore.java?rev=216023&r1=216022&r2=216023&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181ObjectModelStore.java (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181ObjectModelStore.java Tue Jul 12 14:44:56 2005
@@ -44,16 +44,6 @@
private Jsr181ObjectModelStore() {}
/**
- * Encapsulates the encoding of the pathname for object models.
- *
- * @param className
- * @return File
- */
- private static File getLocation(String className) {
- return new File(className + EXTENSION);
- }
-
- /**
* @param clazz
* @throws IOException
* @throws ClassNotFoundException
@@ -115,24 +105,16 @@
OutputStream os = null;
ObjectOutputStream oos = null;
- try {
- if(null == objectModel)
- throw new ObjectModelStoreException("Can not persist empty object model");
+ if(null == objectModel)
+ throw new ObjectModelStoreException("Can not persist empty object model");
- try {
- os = env.getFiler().createBinaryFile(Filer.Location.CLASS_TREE, "", getLocation(objectModel.getClassName()));
- oos = new ObjectOutputStream(os);
- oos.writeObject(objectModel);
-/*
- File f = new File(Filer.Location.CLASS_TREE + File.separator + "" + FILE_NAME_LOCATOR);
- if(!f.exists())
- env.getFiler().createBinaryFile(Filer.Location.CLASS_TREE, "", new File(FILE_NAME_LOCATOR));
-*/
- }
- catch(IOException e) {
- throw new ObjectModelStoreException("Exception occurred writing WSM object model. Cause: " +
- e.getMessage(), e);
- }
+ try {
+ os = env.getFiler().createBinaryFile(Filer.Location.CLASS_TREE, "", getLocation(objectModel.getClassName()));
+ oos = new ObjectOutputStream(os);
+ oos.writeObject(objectModel);
+ }
+ catch(IOException e) {
+ throw new ObjectModelStoreException("Exception occurred writing WSM object model. Cause: " + e.getMessage(), e);
}
finally {
if(null != oos) {
@@ -204,5 +186,15 @@
}
}
return fqClassName;
+ }
+
+ /**
+ * Encapsulates the encoding of the pathname for object models.
+ *
+ * @param className
+ * @return File
+ */
+ private static File getLocation(String className) {
+ return new File(className + EXTENSION);
}
}
Modified: incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/wsdl/XmlBeanWSDLProcessor.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/wsdl/XmlBeanWSDLProcessor.java?rev=216023&r1=216022&r2=216023&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/wsdl/XmlBeanWSDLProcessor.java (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/wsdl/XmlBeanWSDLProcessor.java Tue Jul 12 14:44:56 2005
@@ -120,10 +120,6 @@
types = defs.getTypesArray(0);
}
- System.out.println("operation names:");
- for(TOperation foo : operations)
- System.out.println("name: " + foo.getName() + " output type: " + foo.getOutput());
-
for(TOperation op : operations) {
processTOperation(op, wsm, methodMap, messageMap, types);
}
@@ -144,9 +140,6 @@
String opName = op.getName();
TParam outputParam = op.getOutput();
- System.out.println("opName:" + opName);
- System.out.println("outputParam: " + outputParam);
-
Map<String, BeehiveWsParameterMetadata> outParamMap = null;
BeehiveWsParameterMetadata[] paraMeta = new BeehiveWsParameterMetadata[0]; // defualt value
@@ -158,11 +151,6 @@
String returnType;
QName returnXMLType;
- System.out.println("params: " + paraMeta);
- System.out.println("params.length: " + paraMeta.length);
- for(BeehiveWsParameterMetadata foo : paraMeta)
- System.out.println("foo: " + foo);
-
if(paraMeta == null) {
// Should not happen, may be need to send runtime exception, or
// define a new type of exception!
@@ -186,8 +174,6 @@
}
}
- System.out.println("== returnType: " + returnType);
-
BeehiveWsMethodMetadata wmm = new DefaultMethodMetadataImpl();
wmm.setJavaMethodName(opName);
wmm.setReturnType(returnType);
@@ -268,15 +254,6 @@
}
}
- /*
- * Collection<BeehiveWsParameterMetadata> params = wmm.getParams();
- * System.out.println("adding method " + wmm.getWmOperationName() + "
- * returning " + wmm.getJavaReturnType() + " with the following " +
- * params.size() + " parameters");
- *
- * for (Jsr181ParameterMetadata wpm : params) {
- * System.out.println(wpm.getWpName() + ':' + wpm.getJavaType()); }
- */
wsm.addMethod(wmm);
}
@@ -377,7 +354,6 @@
// doc / lit / bare
if (els != null && els.length == 1) {
BeehiveWsParameterMetadata pm = elementToParamMetaData(s.getTargetNamespace(), els[0]);
- System.out.println("param type: " + pm.getJavaType());
if (HackUtils.isArray(pm.getJavaType())) {
pm.setWpName(e.getName());
paramList.add(pm);
@@ -429,15 +405,10 @@
QName type = messagePart.getType();
wpm.setXmlType(type);
wpm.setJavaType(findClassForQname(type));
- /*
- * System.out.println(wpm.getWpName() + " of type " +
- * wpm.getJavaType());
- */
paramList.add(wpm);
}
}
- System.out.println("size: " + paramList.size());
return paramList.toArray(new BeehiveWsParameterMetadata[paramList.size()]);
}
Modified: incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/processor2/generator/AxisGenerator.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/processor2/generator/AxisGenerator.java?rev=216023&r1=216022&r2=216023&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/processor2/generator/AxisGenerator.java (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/processor2/generator/AxisGenerator.java Tue Jul 12 14:44:56 2005
@@ -54,16 +54,7 @@
to generate the model */
TypeDeclaration foo = serviceEndpointDecl != null ? serviceEndpointDecl : typeDecl;
- System.out.println("========== create .ser file for web service implementation type '" + typeDecl.getSimpleName() + "'");
BeehiveWsTypeMetadata wsImplMetadata = factory.create(typeDecl, serviceEndpointDecl);
Jsr181ObjectModelStore.store(env, wsImplMetadata);
-
-/*
- if(serviceEndpointDecl != null) {
- System.out.println("========== create .ser file for web service '" + serviceEndpointDecl.getSimpleName() + "'");
- BeehiveWsTypeMetadata wsIfaceMetadata = factory.create(serviceEndpointDecl, null);
- Jsr181ObjectModelStore.store(env, wsIfaceMetadata);
- }
-*/
}
}
Modified: incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/processor2/model/factory/impl/MirrorFactoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/processor2/model/factory/impl/MirrorFactoryImpl.java?rev=216023&r1=216022&r2=216023&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/processor2/model/factory/impl/MirrorFactoryImpl.java (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/processor2/model/factory/impl/MirrorFactoryImpl.java Tue Jul 12 14:44:56 2005
@@ -209,8 +209,6 @@
wsMethod.addParam(wsParam);
}
- System.out.println("wsMethod.getJavaReturnType: " + wsMethod.getJavaReturnType());
- System.out.println("wsMethod.getJavaReturnTypeFullName: " + wsMethod.getJavaReturnTypeFullName());
wsMetadata.addMethod(wsMethod);
}
Modified: incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/wsdl/Model2AJava.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/wsdl/Model2AJava.java?rev=216023&r1=216022&r2=216023&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/wsdl/Model2AJava.java (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/wsdl/Model2AJava.java Tue Jul 12 14:44:56 2005
@@ -35,10 +35,12 @@
* This class performs model to annotated Java code generation. The model processed
* here is an instance of {@link BeehiveWsTypeMetadata}.
*/
-public class Model2AJava {
- static VelocityEngine ve = null;
- static Template template = null;
- static boolean initialized = false;
+public final class Model2AJava {
+
+ /* todo: should these be cached in the type? */
+ private static VelocityEngine ve = null;
+ private static Template template = null;
+ private static boolean initialized = false;
/**
* @throws Exception
@@ -46,14 +48,12 @@
* @throws ParseErrorException
* @throws MethodInvocationException
*/
- static private void init()
- throws Exception, ResourceNotFoundException,
- ParseErrorException, MethodInvocationException {
+ private static void init()
+ throws Exception, ResourceNotFoundException, ParseErrorException, MethodInvocationException {
Properties p = new Properties();
p.setProperty(VelocityEngine.RESOURCE_LOADER, "class");
- p.setProperty("class." + VelocityEngine.RESOURCE_LOADER + ".class",
- ClasspathResourceLoader.class.getName());
+ p.setProperty("class." + VelocityEngine.RESOURCE_LOADER + ".class", ClasspathResourceLoader.class.getName());
ve = new VelocityEngine();
ve.init(p);
String templateFileName = "org/apache/beehive/wsm/wsdl/wsdl2ajava.vm";
@@ -62,28 +62,19 @@
template = ve.getTemplate(templateFileName);
}
catch(ResourceNotFoundException e) {
- // couldn't find the template
- System.out.println("Failed to find the tempate file: "
- + templateFileName + " in classpath: "
- + System.getProperty("java.class.path"));
- e.printStackTrace();
+ System.err.println("Failed to find the tempate file: " + templateFileName + " in classpath: " + System.getProperty("java.class.path"));
throw e;
}
catch(ParseErrorException e) {
- // syntax error : problem parsing the template
- e.printStackTrace();
throw e;
}
catch(MethodInvocationException e) {
- // something invoked in the template
- // threw an exception
- e.printStackTrace();
throw e;
}
catch(Exception e) {
- e.printStackTrace();
throw e;
}
+
initialized = true;
}
@@ -91,8 +82,12 @@
throws Exception {
String className = om.getWsName();
- // TODO: Does it make sense to use the target nameservice as package name? For now just use a "web" pacakge.
+
+ /* todo: need to pick a better default package name than 'web' -- should this be derived from
+ the targetNamespace by default? Should the caller be able to provide one?
+ */
String packageName = "web";
+
// doesn't do any thing right now, useful if the target package name had dots
String packageDirName = packageName.replaceAll("\\.", "/");
@@ -102,9 +97,16 @@
File srcFile = new File(baseSrcDir, className + ".java");
srcFile.createNewFile();
- Writer w = new FileWriter(srcFile, false);
- generateAnnotatedJavaFromOM(om, w);
- w.close();
+
+ Writer writer = null;
+ try {
+ writer = new FileWriter(srcFile, false);
+ generateAnnotatedJavaFromOM(om, writer);
+ }
+ finally {
+ if(writer != null)
+ writer.close();
+ }
}
/**
@@ -116,7 +118,7 @@
* @throws Exception
* @throws IOException
*/
- static public void generateAnnotatedJavaFromOM(BeehiveWsTypeMetadata om, Writer w)
+ public static void generateAnnotatedJavaFromOM(BeehiveWsTypeMetadata om, Writer w)
throws ResourceNotFoundException, ParseErrorException,
MethodInvocationException, Exception, IOException {
if(!initialized)