JBossWS SVN: r10512 - framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2009-08-10 10:23:29 -0400 (Mon, 10 Aug 2009)
New Revision: 10512
Added:
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithList.java
Modified:
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java
Log:
[JBPAPP-2341] - XmlAttachmentRef annotation on List<DataHandler> is not identified as an Attachment part - Testcase
Added: framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithList.java
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithList.java (rev 0)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithList.java 2009-08-10 14:23:29 UTC (rev 10512)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.test.ws.jaxws.samples.swaref;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlAttachmentRef;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class DocumentPayloadWithList
+{
+ @XmlElement
+ @XmlAttachmentRef
+ private List<DataHandler> data;
+
+ public DocumentPayloadWithList()
+ {
+ }
+
+ public List<DataHandler> getData()
+ {
+ if (data == null)
+ {
+ data = new ArrayList<DataHandler>();
+ }
+ return data;
+ }
+}
Modified: framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java 2009-08-10 13:46:55 UTC (rev 10511)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java 2009-08-10 14:23:29 UTC (rev 10512)
@@ -91,4 +91,17 @@
assertTrue(response.getData().getContent().equals("Server data"));
}
+
+ public void testListAnnotationWithWrapped() throws Exception
+ {
+ //[JBWS-2708]
+ Service service = Service.create(new URL(wrappedEndpointURL+"?wsdl"), wrappedServiceQName);
+ WrappedEndpoint port = service.getPort(WrappedEndpoint.class);
+ DocumentPayloadWithList payload = new DocumentPayloadWithList();
+ payload.getData().add(data);
+
+ DocumentPayloadWithList response = port.listAnnotation(payload, "Wrapped test");
+ assertTrue(response.getData().get(0).getContent().equals("Server data"));
+
+ }
}
Modified: framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java 2009-08-10 13:46:55 UTC (rev 10511)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java 2009-08-10 14:23:29 UTC (rev 10512)
@@ -36,6 +36,9 @@
DocumentPayload beanAnnotation(DocumentPayload dhw, String test) throws RemoteException;
@WebMethod
+ DocumentPayloadWithList listAnnotation(DocumentPayloadWithList dhw, String test) throws RemoteException;
+
+ @WebMethod
@XmlAttachmentRef
DataHandler parameterAnnotation(DocumentPayload payload, String test, @XmlAttachmentRef DataHandler data) throws RemoteException;
Modified: framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java 2009-08-10 13:46:55 UTC (rev 10511)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java 2009-08-10 14:23:29 UTC (rev 10512)
@@ -76,7 +76,44 @@
return new DocumentPayload(dh);
}
+ @WebMethod
+ public DocumentPayloadWithList listAnnotation(DocumentPayloadWithList dhw, String test) throws RemoteException
+ {
+ DataHandler dh;
+
+ try {
+ System.out.println("[TestServiceImpl] ---> Dans le service");
+ if (dhw != null && dhw.getData() != null && dhw.getData().get(0) != null) {
+ dh=dhw.getData().get(0);
+ dumpDH(dh);
+ }
+ else
+ {
+ System.out.println("[TestServiceImpl] ---> Le DataHandler est NULL.");
+ }
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ dh = new DataHandler("Server data", "text/plain") ;
+
+ try{
+ System.out.println("[TestServiceImpl] ---> Le DataHandler returned.");
+ dumpDH(dh);
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ DocumentPayloadWithList payload = new DocumentPayloadWithList();
+ payload.getData().add(dh);
+
+ return payload;
+ }
+
+
@WebMethod
@XmlAttachmentRef
public DataHandler parameterAnnotation(DocumentPayload payload, String test, @XmlAttachmentRef DataHandler data) throws RemoteException
15 years, 1 month
JBossWS SVN: r10511 - container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-08-10 09:46:55 -0400 (Mon, 10 Aug 2009)
New Revision: 10511
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java
Log:
[JBWS-2332] refactoring + javadoc
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java 2009-08-10 10:40:17 UTC (rev 10510)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java 2009-08-10 13:46:55 UTC (rev 10511)
@@ -23,7 +23,6 @@
import java.lang.reflect.Method;
-import org.jboss.wsf.common.JavaUtils;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.InvocationHandler;
@@ -36,30 +35,39 @@
*/
abstract class AbstractInvocationHandler extends InvocationHandler
{
-
+
+ /**
+ * Creates invocation.
+ *
+ * @return invocation instance
+ */
public final Invocation createInvocation()
{
return new Invocation();
}
- public void init(Endpoint ep)
+ /**
+ * Initialization method.
+ *
+ * @param endpoint endpoint
+ */
+ public void init(final Endpoint endpoint)
{
+ // does nothing
}
- protected Method getImplMethod(Class<?> implClass, Method seiMethod) throws ClassNotFoundException, NoSuchMethodException
+ /**
+ * Returns implementation method that will be used for invocation.
+ *
+ * @param implClass implementation endpoint class
+ * @param seiMethod SEI interface method used for method finding algorithm
+ * @return implementation method
+ * @throws NoSuchMethodException if implementation method wasn't found
+ */
+ protected final Method getImplMethod(final Class<?> implClass, final Method seiMethod) throws NoSuchMethodException
{
- String methodName = seiMethod.getName();
- Class<?>[] paramTypes = seiMethod.getParameterTypes();
- for (int i = 0; i < paramTypes.length; i++)
- {
- Class<?> paramType = paramTypes[i];
- if (JavaUtils.isPrimitive(paramType) == false)
- {
- String paramTypeName = paramType.getName();
- paramType = JavaUtils.loadJavaType(paramTypeName);
- paramTypes[i] = paramType;
- }
- }
+ final String methodName = seiMethod.getName();
+ final Class<?>[] paramTypes = seiMethod.getParameterTypes();
return implClass.getMethod(methodName, paramTypes);
}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java 2009-08-10 10:40:17 UTC (rev 10510)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java 2009-08-10 13:46:55 UTC (rev 10511)
@@ -36,71 +36,142 @@
abstract class AbstractInvocationHandlerJSE extends AbstractInvocationHandler
{
+ /**
+ * Constructor.
+ */
AbstractInvocationHandlerJSE()
{
super();
}
- protected Object getTargetBean(Endpoint ep, Invocation epInv) throws Exception
+ /**
+ * Retrieves endpoint implementation bean that will be used in invocation process.
+ *
+ * This method does the following steps:
+ *
+ * <ul>
+ * <li>tries to retrieve endpoint instance from invocation context,</li>
+ * <li>if endpoint instance is not found it's created and instantiated (lazy initialization)</li>
+ * <li>
+ * if endpoint instance was created all subclasses will be notified about this event
+ * (using {@link #onEndpointInstantiated(Endpoint, Invocation)} template method).
+ * </li>
+ * </ul>
+ *
+ * @param endpoint to lookup implementation instance for
+ * @param invocation current invocation
+ * @return endpoint implementation
+ * @throws Exception if any error occurs
+ */
+ protected Object getTargetBean(final Endpoint endpoint, final Invocation invocation) throws Exception
{
- InvocationContext invCtx = epInv.getInvocationContext();
- Object targetBean = invCtx.getTargetBean();
+ final InvocationContext invocationContext = invocation.getInvocationContext();
+ Object targetBean = invocationContext.getTargetBean();
+
if (targetBean == null)
{
try
{
- Class<?> epImpl = ep.getTargetBeanClass();
- targetBean = epImpl.newInstance();
- invCtx.setTargetBean(targetBean);
- this.onEndpointInstantiated(ep, epInv);
+ // create endpoint instance
+ final Class<?> endpointImplClass = endpoint.getTargetBeanClass();
+ targetBean = endpointImplClass.newInstance();
+ invocationContext.setTargetBean(targetBean);
+
+ // notify subclasses
+ this.onEndpointInstantiated(endpoint, invocation);
}
catch (Exception ex)
{
- throw new IllegalStateException("Cannot get target bean instance", ex);
+ throw new IllegalStateException("Cannot create endpoint instance: ", ex);
}
}
return targetBean;
}
- public void invoke(Endpoint ep, Invocation epInv) throws Exception
+ /**
+ * Invokes method on endpoint implementation.
+ *
+ * This method does the following steps:
+ *
+ * <ul>
+ * <li>lookups endpoint implementation method to be invoked,</li>
+ * <li>
+ * notifies all subclasses about endpoint method is going to be invoked<br/>
+ * (using {@link #onBeforeInvocation(Invocation)} template method),
+ * </li>
+ * <li>endpoint implementation method is invoked,</li>
+ * <li>
+ * notifies all subclasses about endpoint method invocation was completed<br/>
+ * (using {@link #onAfterInvocation(Invocation)} template method).
+ * </li>
+ * </ul>
+ *
+ * @param endpoint which method is going to be invoked
+ * @param invocation current invocation
+ * @throws Exception if any error occurs
+ */
+ public void invoke(final Endpoint endpoint, final Invocation invocation) throws Exception
{
- Object targetBean = null;
try
{
- targetBean = this.getTargetBean(ep, epInv);
+ // prepare for invocation
+ final Object targetBean = this.getTargetBean(endpoint, invocation);
+ final Class<?> implClass = targetBean.getClass();
+ final Method seiMethod = invocation.getJavaMethod();
+ final Method implMethod = this.getImplMethod(implClass, seiMethod);
+ final Object[] args = invocation.getArgs();
- Class<?> implClass = targetBean.getClass();
- Method seiMethod = epInv.getJavaMethod();
- Method implMethod = getImplMethod(implClass, seiMethod);
+ // notify subclasses
+ this.onBeforeInvocation(invocation);
- Object[] args = epInv.getArgs();
- this.onBeforeInvocation(epInv);
- Object retObj = implMethod.invoke(targetBean, args);
- epInv.setReturnValue(retObj);
+ // invoke implementation method
+ final Object retObj = implMethod.invoke(targetBean, args);
+
+ // set invocation result
+ invocation.setReturnValue(retObj);
}
catch (Exception e)
{
- handleInvocationException(e);
+ // propagate exception
+ this.handleInvocationException(e);
}
finally
{
- this.onAfterInvocation(epInv);
+ // notify subclasses
+ this.onAfterInvocation(invocation);
}
}
-
- // TODO: document these template methods
- protected void onEndpointInstantiated(Endpoint endpoint, final Invocation invocation) throws Exception
+ /**
+ * Template method for notifying subclasses that endpoint instance have been instantiated.
+ *
+ * @param endpoint instantiated endpoint
+ * @param invocation current invocation
+ * @throws Exception subclasses have to throw exception on any failure
+ */
+ protected void onEndpointInstantiated(final Endpoint endpoint, final Invocation invocation) throws Exception
{
// does nothing
}
-
+
+ /**
+ * Template method for notifying subclasses that endpoint method is going to be invoked.
+ *
+ * @param invocation current invocation
+ * @throws Exception subclasses have to throw exception on any failure
+ */
protected void onBeforeInvocation(final Invocation invocation) throws Exception
{
// does nothing
}
-
+
+ /**
+ * Template method for notifying subclasses that endpoint method invocation was completed.
+ *
+ * @param invocation current invocation
+ * @throws Exception subclasses have to throw exception on any failure
+ */
protected void onAfterInvocation(final Invocation invocation) throws Exception
{
// does nothing
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java 2009-08-10 10:40:17 UTC (rev 10510)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java 2009-08-10 13:46:55 UTC (rev 10511)
@@ -37,21 +37,33 @@
*/
final class InvocationHandlerJAXRPC extends AbstractInvocationHandlerJSE
{
-
+
+ /**
+ * Constructor.
+ */
InvocationHandlerJAXRPC()
{
super();
}
-
+
+ /**
+ * Calls {@link javax.xml.rpc.server.ServiceLifecycle#init(Object)}
+ * method on target bean and registers it for predestroy phase if
+ * target bean implements {@link javax.xml.rpc.server.ServiceLifecycle} interface.
+ *
+ * @param endpoint used for predestroy phase registration process
+ * @param invocation current invocation
+ * @throws Exception if any error occurs
+ */
protected void onEndpointInstantiated(final Endpoint endpoint, final Invocation invocation) throws Exception
{
final InvocationContext invocationContext = invocation.getInvocationContext();
final Object targetBean = invocationContext.getTargetBean();
final boolean isJaxrpcLifecycleBean = targetBean instanceof ServiceLifecycle;
-
+
if (isJaxrpcLifecycleBean)
{
- ServletEndpointContext sepContext = invocationContext.getAttachment(ServletEndpointContext.class);
+ final ServletEndpointContext sepContext = invocationContext.getAttachment(ServletEndpointContext.class);
((ServiceLifecycle)targetBean).init(sepContext);
endpoint.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));
}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java 2009-08-10 10:40:17 UTC (rev 10510)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java 2009-08-10 13:46:55 UTC (rev 10511)
@@ -42,51 +42,98 @@
*/
final class InvocationHandlerJAXWS extends AbstractInvocationHandlerJSE
{
-
+
+ /** WebServiceContext injector. */
private final ResourceInjector wsContextInjector;
+ /**
+ * Constructor.
+ */
InvocationHandlerJAXWS()
{
super();
final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
final ResourceInjectorFactory resourceInjectorFactory = spiProvider.getSPI(ResourceInjectorFactory.class);
- wsContextInjector = resourceInjectorFactory.newResourceInjector();
+ this.wsContextInjector = resourceInjectorFactory.newResourceInjector();
}
+ /**
+ * Injects resources on target bean and calls post construct method.
+ * Finally it registers target bean for predestroy phase.
+ *
+ * @param endpoint used for predestroy phase registration process
+ * @param invocation current invocation
+ */
protected void onEndpointInstantiated(final Endpoint endpoint, final Invocation invocation)
{
- final InvocationContext invocationContext = invocation.getInvocationContext();
- final Object targetBean = invocationContext.getTargetBean();
final InjectionsMetaData injectionsMD = endpoint.getAttachment(InjectionsMetaData.class);
-
+ final Object targetBean = this.getTargetBean(invocation);
+
InjectionHelper.injectResources(targetBean, injectionsMD);
InjectionHelper.callPostConstructMethod(targetBean);
+
endpoint.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));
}
+ /**
+ * Injects webservice context on target bean.
+ *
+ * @param invocation current invocation
+ */
protected void onBeforeInvocation(final Invocation invocation)
{
- final InvocationContext invocationContext = invocation.getInvocationContext();
- final WebServiceContext wsContext = invocationContext.getAttachment(WebServiceContext.class);
- final Object targetBean = invocationContext.getTargetBean();
+ final WebServiceContext wsContext = this.getWebServiceContext(invocation);
if (wsContext != null)
{
+ final Object targetBean = this.getTargetBean(invocation);
+
this.wsContextInjector.inject(targetBean, wsContext);
}
}
+ /**
+ * Cleanups injected webservice context on target bean.
+ *
+ * @param invocation current invocation
+ */
protected void onAfterInvocation(final Invocation invocation)
{
- final InvocationContext invocationContext = invocation.getInvocationContext();
- final WebServiceContext wsContext = invocationContext.getAttachment(WebServiceContext.class);
- final Object targetBean = invocationContext.getTargetBean();
+ final WebServiceContext wsContext = this.getWebServiceContext(invocation);
if (wsContext != null)
{
+ final Object targetBean = this.getTargetBean(invocation);
+
this.wsContextInjector.inject(targetBean, null);
}
}
-
+
+ /**
+ * Returns WebServiceContext associated with this invocation.
+ *
+ * @param invocation current invocation
+ * @return web service context or null if not available
+ */
+ private WebServiceContext getWebServiceContext(final Invocation invocation)
+ {
+ final InvocationContext invocationContext = invocation.getInvocationContext();
+
+ return invocationContext.getAttachment(WebServiceContext.class);
+ }
+
+ /**
+ * Returns endpoint instance associated with current invocation.
+ *
+ * @param invocation current invocation
+ * @return target bean in invocation
+ */
+ private Object getTargetBean(final Invocation invocation)
+ {
+ final InvocationContext invocationContext = invocation.getInvocationContext();
+
+ return invocationContext.getTargetBean();
+ }
+
}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java 2009-08-10 10:40:17 UTC (rev 10510)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java 2009-08-10 13:46:55 UTC (rev 10511)
@@ -29,7 +29,7 @@
*/
final class InvocationHandlerMDB21 extends AbstractInvocationHandlerJSE
{
-
+
/**
* Constructor.
*/
15 years, 1 month
JBossWS SVN: r10510 - container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-08-10 06:40:17 -0400 (Mon, 10 Aug 2009)
New Revision: 10510
Added:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java
Removed:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJSE.java
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java
Log:
[JBWS-2720] fixing issue + other refactoring
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java 2009-08-10 08:48:08 UTC (rev 10509)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java 2009-08-10 10:40:17 UTC (rev 10510)
@@ -26,17 +26,18 @@
import org.jboss.wsf.common.JavaUtils;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationContext;
import org.jboss.wsf.spi.invocation.InvocationHandler;
/**
+ * Base class for all Web Service invocation handlers inside AS.
+ *
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
*/
-public abstract class AbstractInvocationHandler extends InvocationHandler
+abstract class AbstractInvocationHandler extends InvocationHandler
{
- public Invocation createInvocation()
+ public final Invocation createInvocation()
{
return new Invocation();
}
@@ -45,13 +46,13 @@
{
}
- protected Method getImplMethod(Class implClass, Method seiMethod) throws ClassNotFoundException, NoSuchMethodException
+ protected Method getImplMethod(Class<?> implClass, Method seiMethod) throws ClassNotFoundException, NoSuchMethodException
{
String methodName = seiMethod.getName();
- Class[] paramTypes = seiMethod.getParameterTypes();
+ Class<?>[] paramTypes = seiMethod.getParameterTypes();
for (int i = 0; i < paramTypes.length; i++)
{
- Class paramType = paramTypes[i];
+ Class<?> paramType = paramTypes[i];
if (JavaUtils.isPrimitive(paramType) == false)
{
String paramTypeName = paramType.getName();
@@ -60,29 +61,7 @@
}
}
- Method implMethod = implClass.getMethod(methodName, paramTypes);
- return implMethod;
+ return implClass.getMethod(methodName, paramTypes);
}
- protected Object getTargetBean(Endpoint ep, Invocation epInv) throws Exception
- {
- InvocationContext invCtx = epInv.getInvocationContext();
- Object targetBean = invCtx.getTargetBean();
- if (targetBean == null)
- {
- try
- {
- Class<?> epImpl = ep.getTargetBeanClass();
- targetBean = epImpl.newInstance();
- invCtx.setTargetBean(targetBean);
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot get target bean instance", ex);
- }
- }
-
- return targetBean;
- }
-
}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java 2009-08-10 10:40:17 UTC (rev 10510)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.invocation;
+
+import java.lang.reflect.Method;
+
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.Invocation;
+import org.jboss.wsf.spi.invocation.InvocationContext;
+
+/**
+ * Handles invocations on JSE endpoints.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
+ */
+abstract class AbstractInvocationHandlerJSE extends AbstractInvocationHandler
+{
+
+ AbstractInvocationHandlerJSE()
+ {
+ super();
+ }
+
+ protected Object getTargetBean(Endpoint ep, Invocation epInv) throws Exception
+ {
+ InvocationContext invCtx = epInv.getInvocationContext();
+ Object targetBean = invCtx.getTargetBean();
+ if (targetBean == null)
+ {
+ try
+ {
+ Class<?> epImpl = ep.getTargetBeanClass();
+ targetBean = epImpl.newInstance();
+ invCtx.setTargetBean(targetBean);
+ this.onEndpointInstantiated(ep, epInv);
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot get target bean instance", ex);
+ }
+ }
+
+ return targetBean;
+ }
+
+ public void invoke(Endpoint ep, Invocation epInv) throws Exception
+ {
+ Object targetBean = null;
+ try
+ {
+ targetBean = this.getTargetBean(ep, epInv);
+
+ Class<?> implClass = targetBean.getClass();
+ Method seiMethod = epInv.getJavaMethod();
+ Method implMethod = getImplMethod(implClass, seiMethod);
+
+ Object[] args = epInv.getArgs();
+ this.onBeforeInvocation(epInv);
+ Object retObj = implMethod.invoke(targetBean, args);
+ epInv.setReturnValue(retObj);
+ }
+ catch (Exception e)
+ {
+ handleInvocationException(e);
+ }
+ finally
+ {
+ this.onAfterInvocation(epInv);
+ }
+ }
+
+ // TODO: document these template methods
+
+ protected void onEndpointInstantiated(Endpoint endpoint, final Invocation invocation) throws Exception
+ {
+ // does nothing
+ }
+
+ protected void onBeforeInvocation(final Invocation invocation) throws Exception
+ {
+ // does nothing
+ }
+
+ protected void onAfterInvocation(final Invocation invocation) throws Exception
+ {
+ // does nothing
+ }
+
+}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java 2009-08-10 08:48:08 UTC (rev 10509)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java 2009-08-10 10:40:17 UTC (rev 10510)
@@ -24,51 +24,37 @@
import javax.xml.rpc.server.ServiceLifecycle;
import javax.xml.rpc.server.ServletEndpointContext;
+import org.jboss.wsf.common.injection.PreDestroyHolder;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.InvocationContext;
/**
- * Handles invocations on JSE endpoints.
+ * Handles invocations on JAXRPC endpoints.
*
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
*/
-public class InvocationHandlerJAXRPC extends InvocationHandlerJSE
+final class InvocationHandlerJAXRPC extends AbstractInvocationHandlerJSE
{
- public void invoke(Endpoint ep, Invocation epInv) throws Exception
+
+ InvocationHandlerJAXRPC()
{
- try
+ super();
+ }
+
+ protected void onEndpointInstantiated(final Endpoint endpoint, final Invocation invocation) throws Exception
+ {
+ final InvocationContext invocationContext = invocation.getInvocationContext();
+ final Object targetBean = invocationContext.getTargetBean();
+ final boolean isJaxrpcLifecycleBean = targetBean instanceof ServiceLifecycle;
+
+ if (isJaxrpcLifecycleBean)
{
- // TODO: is it bug or feature? We're doing resource injection on JAXRPC endpoints.
- Object targetBean = getTargetBean(ep, epInv);
-
- InvocationContext invContext = epInv.getInvocationContext();
- if (targetBean instanceof ServiceLifecycle)
- {
- ServletEndpointContext sepContext = invContext.getAttachment(ServletEndpointContext.class);
- if (sepContext != null)
- ((ServiceLifecycle)targetBean).init(sepContext);
- // TODO: shouldn't we call init method also in case ServletEndpointContext
- // TODO: isn't available to ensure lifecycle method calls?
- }
-
- try
- {
- super.invoke(ep, epInv);
- }
- finally
- {
- if (targetBean instanceof ServiceLifecycle)
- {
- // TODO: This is bug! we're calling endpoint destroy method after each JAXRPC endpoint invocation.
- ((ServiceLifecycle)targetBean).destroy();
- }
- }
+ ServletEndpointContext sepContext = invocationContext.getAttachment(ServletEndpointContext.class);
+ ((ServiceLifecycle)targetBean).init(sepContext);
+ endpoint.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));
}
- catch (Exception e)
- {
- handleInvocationException(e);
- }
}
+
}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java 2009-08-10 08:48:08 UTC (rev 10509)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java 2009-08-10 10:40:17 UTC (rev 10510)
@@ -21,12 +21,72 @@
*/
package org.jboss.webservices.integration.invocation;
+import javax.xml.ws.WebServiceContext;
+
+import org.jboss.wsf.common.injection.InjectionHelper;
+import org.jboss.wsf.common.injection.PreDestroyHolder;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.Invocation;
+import org.jboss.wsf.spi.invocation.InvocationContext;
+import org.jboss.wsf.spi.invocation.ResourceInjector;
+import org.jboss.wsf.spi.invocation.ResourceInjectorFactory;
+import org.jboss.wsf.spi.metadata.injection.InjectionsMetaData;
+
/**
- * Handles invocations on JSE endpoints.
+ * Handles invocations on JAXWS endpoints.
*
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
*/
-public class InvocationHandlerJAXWS extends InvocationHandlerJSE
+final class InvocationHandlerJAXWS extends AbstractInvocationHandlerJSE
{
+
+ private final ResourceInjector wsContextInjector;
+
+ InvocationHandlerJAXWS()
+ {
+ super();
+
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final ResourceInjectorFactory resourceInjectorFactory = spiProvider.getSPI(ResourceInjectorFactory.class);
+ wsContextInjector = resourceInjectorFactory.newResourceInjector();
+ }
+
+ protected void onEndpointInstantiated(final Endpoint endpoint, final Invocation invocation)
+ {
+ final InvocationContext invocationContext = invocation.getInvocationContext();
+ final Object targetBean = invocationContext.getTargetBean();
+ final InjectionsMetaData injectionsMD = endpoint.getAttachment(InjectionsMetaData.class);
+
+ InjectionHelper.injectResources(targetBean, injectionsMD);
+ InjectionHelper.callPostConstructMethod(targetBean);
+ endpoint.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));
+ }
+
+ protected void onBeforeInvocation(final Invocation invocation)
+ {
+ final InvocationContext invocationContext = invocation.getInvocationContext();
+ final WebServiceContext wsContext = invocationContext.getAttachment(WebServiceContext.class);
+ final Object targetBean = invocationContext.getTargetBean();
+
+ if (wsContext != null)
+ {
+ this.wsContextInjector.inject(targetBean, wsContext);
+ }
+ }
+
+ protected void onAfterInvocation(final Invocation invocation)
+ {
+ final InvocationContext invocationContext = invocation.getInvocationContext();
+ final WebServiceContext wsContext = invocationContext.getAttachment(WebServiceContext.class);
+ final Object targetBean = invocationContext.getTargetBean();
+
+ if (wsContext != null)
+ {
+ this.wsContextInjector.inject(targetBean, null);
+ }
+ }
+
}
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJSE.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJSE.java 2009-08-10 08:48:08 UTC (rev 10509)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJSE.java 2009-08-10 10:40:17 UTC (rev 10510)
@@ -1,100 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.invocation;
-
-import java.lang.reflect.Method;
-
-import javax.xml.ws.WebServiceContext;
-
-import org.jboss.wsf.common.injection.InjectionHelper;
-import org.jboss.wsf.common.injection.PreDestroyHolder;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-import org.jboss.wsf.spi.invocation.ResourceInjector;
-import org.jboss.wsf.spi.invocation.ResourceInjectorFactory;
-import org.jboss.wsf.spi.metadata.injection.InjectionsMetaData;
-
-/**
- * Handles invocations on JSE endpoints.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
- */
-public class InvocationHandlerJSE extends AbstractInvocationHandler
-{
-
- private ResourceInjectorFactory resourceInjectorFactory;
-
- public InvocationHandlerJSE()
- {
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- resourceInjectorFactory = spiProvider.getSPI(ResourceInjectorFactory.class);
- }
-
- protected Object getTargetBean(Endpoint ep, Invocation epInv) throws Exception
- {
- Object targetBean = super.getTargetBean(ep, epInv);
-
- if (ep.getAttachment(PreDestroyHolder.class) == null)
- {
- InjectionHelper.injectResources(targetBean, ep.getAttachment(InjectionsMetaData.class));
- InjectionHelper.callPostConstructMethod(targetBean);
- ep.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));
- }
-
- return targetBean;
- }
-
- public void invoke(Endpoint ep, Invocation epInv) throws Exception
- {
- try
- {
- Object targetBean = this.getTargetBean(ep, epInv);
-
- InvocationContext invContext = epInv.getInvocationContext();
- WebServiceContext wsContext = invContext.getAttachment(WebServiceContext.class);
- ResourceInjector injector = null;
- if (wsContext != null)
- {
- // TODO: is it bug or feature? We're doing WebServiceContext injection on JAXRPC endpoints too?
- injector = resourceInjectorFactory.newResourceInjector();
- injector.inject(targetBean, wsContext);
- }
-
- Method method = getImplMethod(targetBean.getClass(), epInv.getJavaMethod());
- Object retObj = method.invoke(targetBean, epInv.getArgs());
- epInv.setReturnValue(retObj);
- if (wsContext != null) //JBWS-2662
- {
- injector.inject(targetBean, null);
- }
- }
- catch (Exception e)
- {
- handleInvocationException(e);
- }
- }
-
-}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java 2009-08-10 08:48:08 UTC (rev 10509)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java 2009-08-10 10:40:17 UTC (rev 10510)
@@ -21,38 +21,21 @@
*/
package org.jboss.webservices.integration.invocation;
-import java.lang.reflect.Method;
-
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.Invocation;
-
/**
* Handles invocations on MDB EJB21 endpoints.
*
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
*/
-public class InvocationHandlerMDB21 extends AbstractInvocationHandler
+final class InvocationHandlerMDB21 extends AbstractInvocationHandlerJSE
{
-
- public void invoke(Endpoint ep, Invocation epInv) throws Exception
+
+ /**
+ * Constructor.
+ */
+ InvocationHandlerMDB21()
{
- try
- {
- Object targetBean = super.getTargetBean(ep, epInv);
-
- Class<?> implClass = targetBean.getClass();
- Method seiMethod = epInv.getJavaMethod();
- Method implMethod = getImplMethod(implClass, seiMethod);
-
- Object[] args = epInv.getArgs();
- Object retObj = implMethod.invoke(targetBean, args);
- epInv.setReturnValue(retObj);
- }
- catch (Exception e)
- {
- handleInvocationException(e);
- }
+ super();
}
}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java 2009-08-10 08:48:08 UTC (rev 10509)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java 2009-08-10 10:40:17 UTC (rev 10510)
@@ -21,38 +21,21 @@
*/
package org.jboss.webservices.integration.invocation;
-import java.lang.reflect.Method;
-
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.Invocation;
-
/**
* Handles invocations on MDB EJB3 endpoints.
*
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
*/
-public class InvocationHandlerMDB3 extends AbstractInvocationHandler
+final class InvocationHandlerMDB3 extends AbstractInvocationHandlerJSE
{
- public void invoke(Endpoint ep, Invocation epInv) throws Exception
+ /**
+ * Constructor.
+ */
+ InvocationHandlerMDB3()
{
- try
- {
- Object targetBean = super.getTargetBean(ep, epInv);
-
- Class<?> implClass = targetBean.getClass();
- Method seiMethod = epInv.getJavaMethod();
- Method implMethod = getImplMethod(implClass, seiMethod);
-
- Object[] args = epInv.getArgs();
- Object retObj = implMethod.invoke(targetBean, args);
- epInv.setReturnValue(retObj);
- }
- catch (Exception e)
- {
- handleInvocationException(e);
- }
+ super();
}
-
+
}
15 years, 1 month
JBossWS SVN: r10509 - stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-08-10 04:48:08 -0400 (Mon, 10 Aug 2009)
New Revision: 10509
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EndpointServlet.java
Log:
[JBWS-2720] fixing issue
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EndpointServlet.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EndpointServlet.java 2009-08-10 08:38:28 UTC (rev 10508)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EndpointServlet.java 2009-08-10 08:48:08 UTC (rev 10509)
@@ -32,6 +32,7 @@
import org.jboss.wsf.common.servlet.AbstractEndpointServlet;
import javax.servlet.ServletConfig;
+import javax.xml.rpc.server.ServiceLifecycle;
/**
* A Native endpoint servlet that is installed for every web service endpoint
@@ -80,11 +81,19 @@
{
synchronized(this.preDestroyRegistry)
{
- for (PreDestroyHolder holder : this.preDestroyRegistry)
+ for (final PreDestroyHolder holder : this.preDestroyRegistry)
{
try
{
- InjectionHelper.callPreDestroyMethod(holder.getObject());
+ final Object targetBean = holder.getObject();
+ final boolean isJaxrpcLifecycleBean = targetBean instanceof ServiceLifecycle;
+
+ InjectionHelper.callPreDestroyMethod(targetBean);
+ if (isJaxrpcLifecycleBean)
+ {
+ ((ServiceLifecycle)targetBean).destroy();
+ }
+
}
catch (Exception exception)
{
15 years, 1 month
JBossWS SVN: r10508 - spi/branches/ropalka/src/main/java/org/jboss/wsf/spi/invocation.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-08-10 04:38:28 -0400 (Mon, 10 Aug 2009)
New Revision: 10508
Modified:
spi/branches/ropalka/src/main/java/org/jboss/wsf/spi/invocation/InvocationType.java
Log:
[JBWS-2332] removing obsolete invocation type
Modified: spi/branches/ropalka/src/main/java/org/jboss/wsf/spi/invocation/InvocationType.java
===================================================================
--- spi/branches/ropalka/src/main/java/org/jboss/wsf/spi/invocation/InvocationType.java 2009-08-07 16:44:29 UTC (rev 10507)
+++ spi/branches/ropalka/src/main/java/org/jboss/wsf/spi/invocation/InvocationType.java 2009-08-10 08:38:28 UTC (rev 10508)
@@ -25,10 +25,8 @@
* Known invocation types.
*
* @author Heiko.Braun(a)jboss.com
- * Created: Jul 19, 2007
*/
public enum InvocationType
{
- JAXRPC_JSE, JAXRPC_EJB21, JAXRPC_MDB21, JAXWS_JSE, JAXWS_EJB3, JAXWS_MDB3,
- @Deprecated JAXWS_EJB21;
+ JAXRPC_JSE, JAXRPC_EJB21, JAXRPC_MDB21, JAXWS_JSE, JAXWS_EJB3, JAXWS_MDB3
}
15 years, 1 month
JBossWS SVN: r10507 - in stack/native/trunk: modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666 and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-08-07 12:44:29 -0400 (Fri, 07 Aug 2009)
New Revision: 10507
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java
stack/native/trunk/pom.xml
Log:
[JBWS-2713] Update to the latest jboss-logging-log4j lib
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java 2009-08-07 15:06:36 UTC (rev 10506)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java 2009-08-07 16:44:29 UTC (rev 10507)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -33,7 +33,7 @@
import org.jboss.wsf.common.IOUtils;
/**
- * [JBWS-1666] Simplify jbosws jar dependencies
+ * [JBWS-1666] Simplify JBossWS jar dependencies
*
* http://jira.jboss.org/jira/browse/JBWS-1666
*
@@ -74,6 +74,7 @@
cp.append(PS + jbc + FS + "jbossws-native-client.jar");
cp.append(PS + jbc + FS + "jboss-common-core.jar");
cp.append(PS + jbc + FS + "jboss-logging-spi.jar");
+ cp.append(PS + jbc + FS + "jboss-logging-log4j.jar");
cp.append(PS + jbc + FS + "jcl-over-slf4j.jar");
cp.append(PS + jbc + FS + "slf4j-api.jar");
cp.append(PS + jbc + FS + "slf4j-jboss-logging.jar");
Modified: stack/native/trunk/pom.xml
===================================================================
--- stack/native/trunk/pom.xml 2009-08-07 15:06:36 UTC (rev 10506)
+++ stack/native/trunk/pom.xml 2009-08-07 16:44:29 UTC (rev 10507)
@@ -67,7 +67,7 @@
<jaxb.impl.version>2.1.9</jaxb.impl.version>
<jboss.common.version>1.2.1.GA</jboss.common.version>
<jboss.jaxbintros.version>1.0.0.GA</jboss.jaxbintros.version>
- <jboss.logging.version>2.0.5.GA</jboss.logging.version>
+ <jboss.logging.version>2.2.0.CR1</jboss.logging.version>
<jboss.jaxr.version>2.0.0</jboss.jaxr.version>
<apache.scout.version>1.1</apache.scout.version>
<juddi.version>0.9RC4</juddi.version>
15 years, 1 month
JBossWS SVN: r10506 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-08-07 11:06:36 -0400 (Fri, 07 Aug 2009)
New Revision: 10506
Modified:
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-2719] Adding profile for remote management
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2009-08-07 14:36:12 UTC (rev 10505)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2009-08-07 15:06:36 UTC (rev 10506)
@@ -19,6 +19,7 @@
<surefire.security.args>-Djava.security.manager -Djava.security.policy=src/test/etc/tst.policy</surefire.security.args>
<surefire.memory.args>-Xmx512m -XX:MaxPermSize=256m</surefire.memory.args>
<surefire.jdwp.args>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005</surefire.jdwp.args>
+ <surefire.management.args>-Dcom.sun.management.jmxremote</surefire.management.args>
<test.archive.directory>${project.build.directory}/test-libs</test.archive.directory>
<test.classes.directory>${project.build.directory}/test-classes</test.classes.directory>
<test.resources.directory>${project.build.directory}/test-resources</test.resources.directory>
@@ -267,6 +268,33 @@
</profile>
<!--
+ Name: management
+ Descr: Enable remote jmx management (useful to attach JConsole, for instance)
+ -->
+ <profile>
+ <id>management</id>
+ <activation>
+ <property>
+ <name>management</name>
+ </property>
+ </activation>
+ <properties>
+ <surefire.jvm.management.args>${surefire.management.args}</surefire.jvm.management.args>
+ </properties>
+ </profile>
+ <profile>
+ <id>no-management</id>
+ <activation>
+ <property>
+ <name>!management</name>
+ </property>
+ </activation>
+ <properties>
+ <surefire.jvm.management.args> </surefire.jvm.management.args>
+ </properties>
+ </profile>
+
+ <!--
Name: hudson
Descr: Ignore test failures on hudson
-->
@@ -328,7 +356,7 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <argLine>${surefire.jvm.args} -Djava.endorsed.dirs=${jboss500.home}/lib/endorsed</argLine>
+ <argLine>${surefire.jvm.args} ${surefire.jvm.management.args} -Djava.endorsed.dirs=${jboss500.home}/lib/endorsed</argLine>
<!-- TODO: replace with maven dependencies -->
<additionalClasspathElements>
<additionalClasspathElement>${jboss.home}/client/jbossall-client.jar</additionalClasspathElement>
@@ -389,7 +417,7 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <argLine>${surefire.jvm.args} -Djava.endorsed.dirs=${jboss501.home}/lib/endorsed</argLine>
+ <argLine>${surefire.jvm.args} ${surefire.jvm.management.args} -Djava.endorsed.dirs=${jboss501.home}/lib/endorsed</argLine>
<!-- TODO: replace with maven dependencies -->
<additionalClasspathElements>
<additionalClasspathElement>${jboss.home}/client/jbossall-client.jar</additionalClasspathElement>
@@ -438,7 +466,7 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <argLine>${surefire.jvm.args} -Djava.endorsed.dirs=${jboss510.home}/lib/endorsed</argLine>
+ <argLine>${surefire.jvm.args} ${surefire.jvm.management.args} -Djava.endorsed.dirs=${jboss510.home}/lib/endorsed</argLine>
</configuration>
</plugin>
</plugins>
@@ -493,7 +521,7 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <argLine>${surefire.jvm.args} -Djava.endorsed.dirs=${jboss520.home}/lib/endorsed</argLine>
+ <argLine>${surefire.jvm.args} ${surefire.jvm.management.args} -Djava.endorsed.dirs=${jboss520.home}/lib/endorsed</argLine>
</configuration>
</plugin>
</plugins>
@@ -548,7 +576,7 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <argLine>${surefire.jvm.args} -Djava.endorsed.dirs=${jboss600.home}/lib/endorsed</argLine>
+ <argLine>${surefire.jvm.args} ${surefire.jvm.management.args} -Djava.endorsed.dirs=${jboss600.home}/lib/endorsed</argLine>
</configuration>
</plugin>
</plugins>
15 years, 1 month
JBossWS SVN: r10505 - stack/metro/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-08-07 10:36:12 -0400 (Fri, 07 Aug 2009)
New Revision: 10505
Modified:
stack/metro/trunk/modules/testsuite/pom.xml
Log:
[JBWS-2719] Adding profile for remote management
Modified: stack/metro/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/metro/trunk/modules/testsuite/pom.xml 2009-08-07 14:21:17 UTC (rev 10504)
+++ stack/metro/trunk/modules/testsuite/pom.xml 2009-08-07 14:36:12 UTC (rev 10505)
@@ -19,6 +19,7 @@
<surefire.security.args>-Djava.security.manager -Djava.security.policy=src/test/etc/tst.policy</surefire.security.args>
<surefire.jdwp.args>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005</surefire.jdwp.args>
<surefire.gc.args>-Xmx512m -XX:MaxPermSize=256m</surefire.gc.args>
+ <surefire.management.args>-Dcom.sun.management.jmxremote</surefire.management.args>
<test.archive.directory>${project.build.directory}/test-libs</test.archive.directory>
<test.classes.directory>${project.build.directory}/test-classes</test.classes.directory>
<test.resources.directory>${project.build.directory}/test-resources</test.resources.directory>
@@ -277,6 +278,33 @@
</properties>
</profile>
+ <!--
+ Name: management
+ Descr: Enable remote jmx management (useful to attach JConsole, for instance)
+ -->
+ <profile>
+ <id>management</id>
+ <activation>
+ <property>
+ <name>management</name>
+ </property>
+ </activation>
+ <properties>
+ <surefire.jvm.management.args>${surefire.management.args}</surefire.jvm.management.args>
+ </properties>
+ </profile>
+ <profile>
+ <id>no-management</id>
+ <activation>
+ <property>
+ <name>!management</name>
+ </property>
+ </activation>
+ <properties>
+ <surefire.jvm.management.args> </surefire.jvm.management.args>
+ </properties>
+ </profile>
+
<!--
Name: hudson
Descr: Ignore test failures on hudson
@@ -344,7 +372,7 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <argLine>${surefire.jvm.args} -Djava.endorsed.dirs=${jboss500.home}/lib/endorsed</argLine>
+ <argLine>${surefire.jvm.args} ${surefire.jvm.management.args} -Djava.endorsed.dirs=${jboss500.home}/lib/endorsed</argLine>
<!-- TODO: replace with maven dependencies -->
<additionalClasspathElements>
<additionalClasspathElement>${jboss.home}/client/jbossall-client.jar</additionalClasspathElement>
@@ -410,7 +438,7 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <argLine>${surefire.jvm.args} -Djava.endorsed.dirs=${jboss501.home}/lib/endorsed</argLine>
+ <argLine>${surefire.jvm.args} ${surefire.jvm.management.args} -Djava.endorsed.dirs=${jboss501.home}/lib/endorsed</argLine>
<!-- TODO: replace with maven dependencies -->
<additionalClasspathElements>
<additionalClasspathElement>${jboss.home}/client/jbossall-client.jar</additionalClasspathElement>
@@ -475,7 +503,7 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <argLine>${surefire.jvm.args} -Djava.endorsed.dirs=${jboss510.home}/lib/endorsed</argLine>
+ <argLine>${surefire.jvm.args} ${surefire.jvm.management.args} -Djava.endorsed.dirs=${jboss510.home}/lib/endorsed</argLine>
<!-- TODO: replace with maven dependencies -->
<additionalClasspathElements>
<additionalClasspathElement>${jboss.home}/client/jbossall-client.jar</additionalClasspathElement>
@@ -556,7 +584,7 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <argLine>${surefire.jvm.args} -Djava.endorsed.dirs=${jboss520.home}/lib/endorsed</argLine>
+ <argLine>${surefire.jvm.args} ${surefire.jvm.management.args} -Djava.endorsed.dirs=${jboss520.home}/lib/endorsed</argLine>
<!-- TODO: replace with maven dependencies -->
<additionalClasspathElements>
<additionalClasspathElement>${jboss.home}/client/jbossall-client.jar</additionalClasspathElement>
@@ -637,7 +665,7 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <argLine>${surefire.jvm.args} -Djava.endorsed.dirs=${jboss600.home}/lib/endorsed</argLine>
+ <argLine>${surefire.jvm.args} ${surefire.jvm.management.args} -Djava.endorsed.dirs=${jboss600.home}/lib/endorsed</argLine>
<!-- TODO: replace with maven dependencies -->
<additionalClasspathElements>
<additionalClasspathElement>${jboss.home}/client/jbossall-client.jar</additionalClasspathElement>
15 years, 1 month