[jboss-svn-commits] JBL Code SVN: r34751 - labs/jbossesb/branches/JBESB_4_9_CP/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 03:11:06 EDT 2010
Author: mageshbk at jboss.com
Date: 2010-08-17 03:11:05 -0400 (Tue, 17 Aug 2010)
New Revision: 34751
Removed:
labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayWebService.java
labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseWebService.java
Modified:
labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java
Log:
[JBESB-3415] Removed OneWayWebService and RequestResponseWebService
Modified: labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java 2010-08-17 05:47:09 UTC (rev 34750)
+++ labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java 2010-08-17 07:11:05 UTC (rev 34751)
@@ -31,13 +31,19 @@
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 {
@@ -48,6 +54,12 @@
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)
@@ -57,19 +69,27 @@
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 = pool.get(OneWayWebService.class.getName()) ;
+ seiClass.setSuperclass(oneWaySuperClass) ;
}
else
{
- seiClass = pool.get(RequestResponseWebService.class.getName()) ;
+ seiClass.setSuperclass(requestResponseSuperClass) ;
}
- 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(
@@ -127,13 +147,8 @@
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() + "\");" ;
Deleted: labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayWebService.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayWebService.java 2010-08-17 05:47:09 UTC (rev 34750)
+++ labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayWebService.java 2010-08-17 07:11:05 UTC (rev 34751)
@@ -1,47 +0,0 @@
-/*
-* 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);
- }
-}
Deleted: labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseWebService.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseWebService.java 2010-08-17 05:47:09 UTC (rev 34750)
+++ labs/jbossesb/branches/JBESB_4_9_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseWebService.java 2010-08-17 07:11:05 UTC (rev 34751)
@@ -1,47 +0,0 @@
-/*
-* 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