Author: thomas.diesler(a)jboss.com
Date: 2007-08-02 06:09:53 -0400 (Thu, 02 Aug 2007)
New Revision: 4086
Removed:
spi/trunk/src/main/java/org/jboss/wsf/common/
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXRPC.java
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXWS.java
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandler.java
spi/trunk/src/main/java/org/jboss/wsf/spi/tools/cmd/WSProvide.java
Log:
Remove unwanted classes
Deleted:
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXRPC.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXRPC.java 2007-08-02
10:07:39 UTC (rev 4085)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXRPC.java 2007-08-02
10:09:53 UTC (rev 4086)
@@ -1,71 +0,0 @@
-/*
- * 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.wsf.spi.invocation;
-
-// $Id$
-
-import org.jboss.wsf.spi.deployment.Endpoint;
-
-import javax.xml.rpc.server.ServiceLifecycle;
-import javax.xml.rpc.server.ServletEndpointContext;
-
-/**
- * Handles invocations on JSE endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
- */
-public class DefaultInvocationHandlerJAXRPC extends DefaultInvocationHandlerJAXWS
-{
- @Override
- public void invoke(Endpoint ep, Invocation epInv) throws Exception
- {
- try
- {
- 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);
- }
-
- try
- {
- super.invoke(ep, epInv);
- }
- finally
- {
- if (targetBean instanceof ServiceLifecycle)
- {
- ((ServiceLifecycle)targetBean).destroy();
- }
- }
- }
- catch (Exception e)
- {
- handleInvocationException(e);
- }
- }
-}
Deleted:
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXWS.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXWS.java 2007-08-02
10:07:39 UTC (rev 4085)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXWS.java 2007-08-02
10:09:53 UTC (rev 4086)
@@ -1,96 +0,0 @@
-/*
- * 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.wsf.spi.invocation;
-
-// $Id$
-
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-
-import javax.xml.ws.WebServiceContext;
-import java.lang.reflect.Method;
-
-/**
- * Handles invocations on JSE endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
- */
-public class DefaultInvocationHandlerJAXWS extends InvocationHandler
-{
- public Invocation createInvocation()
- {
- return new Invocation();
- }
-
- public void init(Endpoint ep)
- {
-
- }
-
- protected Object getTargetBean(Endpoint ep, Invocation epInv)
- {
- 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("Canot get target bean instance",
ex);
- }
- }
- return targetBean;
- }
-
- public void invoke(Endpoint ep, Invocation epInv) throws Exception
- {
- try
- {
- Object targetBean = getTargetBean(ep, epInv);
-
- InvocationContext invContext = epInv.getInvocationContext();
- WebServiceContext wsContext =
invContext.getAttachment(WebServiceContext.class);
- if (wsContext != null)
- {
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- ResourceInjectorFactory factory =
spiProvider.getSPI(ResourceInjectorFactory.class);
- ResourceInjector injector = factory.newResourceInjector();
- injector.inject(targetBean, wsContext);
- }
-
- Method method = getImplMethod(targetBean.getClass(), epInv.getJavaMethod());
- Object retObj = method.invoke(targetBean, epInv.getArgs());
- epInv.setReturnValue(retObj);
- }
- catch (Exception e)
- {
- handleInvocationException(e);
- }
- }
-}
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandler.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandler.java 2007-08-02
10:07:39 UTC (rev 4085)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandler.java 2007-08-02
10:09:53 UTC (rev 4086)
@@ -21,14 +21,13 @@
*/
package org.jboss.wsf.spi.invocation;
-import org.jboss.wsf.common.JavaUtils;
-import org.jboss.wsf.spi.deployment.Endpoint;
-
-import javax.management.MBeanException;
import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.lang.reflect.UndeclaredThrowableException;
+import javax.management.MBeanException;
+
+import org.jboss.wsf.spi.deployment.Endpoint;
+
/**
* Handles invocations on endpoints.
*
@@ -38,7 +37,6 @@
*/
public abstract class InvocationHandler
{
-
/** Create a container specific invocation **/
public abstract Invocation createInvocation();
@@ -48,25 +46,6 @@
/** Initilize the invocation handler **/
public abstract void init(Endpoint ep);
- protected Method getImplMethod(Class implClass, Method seiMethod) throws
ClassNotFoundException, 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;
- }
- }
-
- Method implMethod = implClass.getMethod(methodName, paramTypes);
- return implMethod;
- }
-
protected void handleInvocationException(Throwable th) throws Exception
{
if (th instanceof MBeanException)
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/tools/cmd/WSProvide.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/tools/cmd/WSProvide.java 2007-08-02 10:07:39
UTC (rev 4085)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/tools/cmd/WSProvide.java 2007-08-02 10:09:53
UTC (rev 4086)
@@ -23,8 +23,6 @@
import gnu.getopt.Getopt;
import gnu.getopt.LongOpt;
-import org.jboss.wsf.spi.tools.WSContractProvider;
-import org.jboss.wsf.common.JavaUtils;
import java.io.File;
import java.io.PrintStream;
@@ -34,6 +32,8 @@
import java.util.ArrayList;
import java.util.List;
+import org.jboss.wsf.spi.tools.WSContractProvider;
+
/**
* WSProvideTask is a cmd line tool that generates portable JAX-WS artifacts
* for a service endpoint implementation.
@@ -157,8 +157,12 @@
private int generate(String endpoint)
{
- if (!JavaUtils.isLoaded(endpoint, loader))
+ try
{
+ loader.loadClass(endpoint);
+ }
+ catch (ClassNotFoundException e)
+ {
System.err.println("Error: Could not load class [" + endpoint +
"]. Did you specify a valid --classpath?");
return 1;
}