[jboss-svn-commits] JBL Code SVN: r34750 - labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Aug 17 01:47:09 EDT 2010


Author: mageshbk at jboss.com
Date: 2010-08-17 01:47:09 -0400 (Tue, 17 Aug 2010)
New Revision: 34750

Added:
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayWebService.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseWebService.java
Modified:
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java
Log:
[JBESB-3415] Checked change for 4.9 CP1 into trunk by accident, rolling back.

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java	2010-08-17 05:37:56 UTC (rev 34749)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java	2010-08-17 05:47:09 UTC (rev 34750)
@@ -31,19 +31,13 @@
 import javassist.NotFoundException;
 import javassist.bytecode.AnnotationsAttribute;
 import javassist.bytecode.ConstPool;
-import javassist.bytecode.SignatureAttribute;
 import javassist.bytecode.annotation.Annotation;
 import javassist.bytecode.annotation.BooleanMemberValue;
 import javassist.bytecode.annotation.EnumMemberValue;
 import javassist.bytecode.annotation.StringMemberValue;
 
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.Provider;
-
 public class JAXWSProviderClassGenerator {
 	private final ClassPool pool ;
-	private final CtClass oneWaySuperClass ;
-	private final CtClass requestResponseSuperClass ;
 	
 	public JAXWSProviderClassGenerator()
 			throws WebServicePublishException {
@@ -54,12 +48,6 @@
 			pool.appendClassPath(new LoaderClassPath(tccl)) ;
 		}
 		pool.appendClassPath(new LoaderClassPath(JAXWSProviderClassGenerator.class.getClassLoader())) ;
-		try {
-			oneWaySuperClass = pool.get(OneWayBaseWebService.class.getName());
-			requestResponseSuperClass = pool.get(RequestResponseBaseWebService.class.getName()) ;
-		} catch (final NotFoundException nfe) {
-			throw new WebServicePublishException("Failed to obtain superclasses", nfe) ;
-		}
 	}
 	
 	public byte[] generate(final String deployment, final String category, final String service, final ESBServiceEndpointInfo epInfo, final boolean includeHandlers)
@@ -69,27 +57,19 @@
 			throw new WebServicePublishException("Duplicate class within context: " + epInfo.getClassName()) ;
 		} catch (final NotFoundException nfe) {} // ignore
 		
-		final CtClass seiClass = pool.makeClass(epInfo.getClassName());
-
 		try {
+			CtClass seiClass;
 			if (epInfo.isOneWay())
 			{
-				seiClass.setSuperclass(oneWaySuperClass) ;
+				seiClass = pool.get(OneWayWebService.class.getName()) ;
 			}
 			else
 			{
-				seiClass.setSuperclass(requestResponseSuperClass) ;
+				seiClass = pool.get(RequestResponseWebService.class.getName()) ;
 			}
+			seiClass.setName(epInfo.getClassName()) ;
 
 			ConstPool constantPool = seiClass.getClassFile().getConstPool();
-
-			final String superClassName = seiClass.getSuperclass().getName().replace('.', '/') ;
-			final String interfaceName = Provider.class.getName().replace('.', '/') ;
-			final String typeName = SOAPMessage.class.getName().replace('.', '/') ;
-			final String signature = 'L' + superClassName + ';' + 'L' + interfaceName + "<L" + typeName + ";>;" ;
-			final SignatureAttribute signatureAttribute = new SignatureAttribute(constantPool, signature) ;
-			seiClass.getClassFile().addAttribute(signatureAttribute) ;
-
 			AnnotationsAttribute attribute = new AnnotationsAttribute(
 					constantPool, AnnotationsAttribute.visibleTag);
 			Annotation annotation = new Annotation(
@@ -147,8 +127,13 @@
 			final CtField field = new CtField(siClass, siFieldName, seiClass) ;
 			field.setModifiers(Modifier.PRIVATE | Modifier.STATIC | Modifier.FINAL) ;
 			seiClass.addField(field, "new " + siClassName + "(\"" + category + "\", \"" + service + "\")") ;
-			
 
+			CtConstructor[] constructors = seiClass.getConstructors() ;
+			for(int i= 0; i < constructors.length; i++)
+			{
+				seiClass.removeConstructor(constructors[i]) ;
+			}
+
 			final String constructorStr = "super(" + getParamValue(deployment) + "," + siFieldName + "," +
 				getParamValue(epInfo.getRequestLocation()) + "," + getParamValue(epInfo.getResponseLocation()) + ", \"" + 
 				epInfo.getResponseAction() + "\");" ;

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayWebService.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayWebService.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayWebService.java	2010-08-17 05:47:09 UTC (rev 34750)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.internal.soa.esb.webservice;
+
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Provider;
+
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+
+/**
+ * This is the template class for One-Way WS Endpoint.
+ *
+ * CXF requires the JAX-WS implementation class to directly implement the
+ * Provider<SOAPMessage>, rather than be derived from a superclass that
+ * implements it.
+ *
+ * @author  Heiko.Braun <heiko.braun at jboss.com> in RIFTSAW-123
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class OneWayWebService extends OneWayBaseWebService implements Provider<SOAPMessage>
+{
+    protected OneWayWebService(final String deployment, final ServiceInvoker serviceInvoker, final String requestLocation, final String responseLocation, final String action)
+        throws MessageDeliverException
+    {
+        super(deployment, serviceInvoker, requestLocation, responseLocation, action);
+    }
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseWebService.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseWebService.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseWebService.java	2010-08-17 05:47:09 UTC (rev 34750)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.internal.soa.esb.webservice;
+
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Provider;
+
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+
+/**
+ * This is the template class for Request-Response WS Endpoint.
+ *
+ * CXF requires the JAX-WS implementation class to directly implement the
+ * Provider<SOAPMessage>, rather than be derived from a superclass that
+ * implements it.
+ *
+ * @author  Heiko.Braun <heiko.braun at jboss.com> in RIFTSAW-123
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class RequestResponseWebService extends RequestResponseBaseWebService implements Provider<SOAPMessage>
+{
+    protected RequestResponseWebService(final String deployment, final ServiceInvoker serviceInvoker, final String requestLocation, final String responseLocation, final String action)
+        throws MessageDeliverException
+    {
+        super(deployment, serviceInvoker, requestLocation, responseLocation, action);
+    }
+}



More information about the jboss-svn-commits mailing list