[jboss-cvs] JBossAS SVN: r67989 - branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Dec 6 06:53:33 EST 2007


Author: thomas.diesler at jboss.com
Date: 2007-12-06 06:53:33 -0500 (Thu, 06 Dec 2007)
New Revision: 67989

Added:
   branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/InvocationHandlerJAXRPC.java
   branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/InvocationHandlerJAXWS.java
   branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/InvocationHandlerJSE.java
Removed:
   branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/DefaultInvocationHandler.java
   branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/DefaultInvocationHandlerJAXRPC.java
   branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/DefaultInvocationHandlerJAXWS.java
Modified:
   branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/InvocationHandlerFactoryImpl.java
Log:
Rename InvocationHandlerJSE

Deleted: branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/DefaultInvocationHandler.java
===================================================================
--- branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/DefaultInvocationHandler.java	2007-12-06 11:44:01 UTC (rev 67988)
+++ branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/DefaultInvocationHandler.java	2007-12-06 11:53:33 UTC (rev 67989)
@@ -1,129 +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.container.jboss42;
-
-// $Id: DefaultInvocationHandlerJAXWS.java 4023 2007-07-28 07:14:06Z thomas.diesler at jboss.com $
-
-import java.lang.reflect.Method;
-
-import javax.xml.ws.WebServiceContext;
-
-import org.jboss.wsf.common.JavaUtils;
-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.InvocationHandler;
-import org.jboss.wsf.spi.invocation.ResourceInjector;
-import org.jboss.wsf.spi.invocation.ResourceInjectorFactory;
-
-/**
- * Handles invocations on JSE endpoints.
- *
- * @author Thomas.Diesler at jboss.org
- * @since 25-Apr-2007
- */
-public class DefaultInvocationHandler extends InvocationHandler
-{
-   private SPIProvider spiProvider;
-   private ResourceInjectorFactory resourceInjectorFactory;
-
-   public DefaultInvocationHandler()
-   {
-      spiProvider = SPIProviderResolver.getInstance().getProvider();
-      resourceInjectorFactory = spiProvider.getSPI(ResourceInjectorFactory.class);
-   }
-
-   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)
-         {
-
-            ResourceInjector injector = resourceInjectorFactory.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);
-      }
-   }
-
-   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;
-   }
-}

Deleted: branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/DefaultInvocationHandlerJAXRPC.java
===================================================================
--- branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/DefaultInvocationHandlerJAXRPC.java	2007-12-06 11:44:01 UTC (rev 67988)
+++ branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/DefaultInvocationHandlerJAXRPC.java	2007-12-06 11:53:33 UTC (rev 67989)
@@ -1,72 +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.container.jboss42;
-
-// $Id: DefaultInvocationHandlerJAXRPC.java 3959 2007-07-20 14:44:19Z heiko.braun at jboss.com $
-
-import javax.xml.rpc.server.ServiceLifecycle;
-import javax.xml.rpc.server.ServletEndpointContext;
-
-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 Thomas.Diesler at jboss.org
- * @since 25-Apr-2007
- */
-public class DefaultInvocationHandlerJAXRPC extends DefaultInvocationHandler
-{
-   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: branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/DefaultInvocationHandlerJAXWS.java
===================================================================
--- branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/DefaultInvocationHandlerJAXWS.java	2007-12-06 11:44:01 UTC (rev 67988)
+++ branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/DefaultInvocationHandlerJAXWS.java	2007-12-06 11:53:33 UTC (rev 67989)
@@ -1,34 +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.container.jboss42;
-
-// $Id: DefaultInvocationHandlerJAXWS.java 4023 2007-07-28 07:14:06Z thomas.diesler at jboss.com $
-
-/**
- * Handles invocations on JSE endpoints.
- *
- * @author Thomas.Diesler at jboss.org
- * @since 25-Apr-2007
- */
-public class DefaultInvocationHandlerJAXWS extends DefaultInvocationHandler
-{
-}

Modified: branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/InvocationHandlerFactoryImpl.java
===================================================================
--- branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/InvocationHandlerFactoryImpl.java	2007-12-06 11:44:01 UTC (rev 67988)
+++ branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/InvocationHandlerFactoryImpl.java	2007-12-06 11:53:33 UTC (rev 67989)
@@ -36,7 +36,7 @@
       switch(type)
       {
          case JAXRPC_JSE:
-            handler = new DefaultInvocationHandlerJAXRPC();
+            handler = new InvocationHandlerJAXRPC();
             break;
          case JAXRPC_EJB21:
             handler = new InvocationHandlerEJB21();
@@ -45,7 +45,7 @@
             handler = new InvocationHandlerMDB21();
             break;
          case JAXWS_JSE:
-            handler = new DefaultInvocationHandlerJAXWS();
+            handler = new InvocationHandlerJAXWS();
             break;
          case JAXWS_EJB21:
             handler = new InvocationHandlerEJB21();

Copied: branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/InvocationHandlerJAXRPC.java (from rev 67988, branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/DefaultInvocationHandlerJAXRPC.java)
===================================================================
--- branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/InvocationHandlerJAXRPC.java	                        (rev 0)
+++ branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/InvocationHandlerJAXRPC.java	2007-12-06 11:53:33 UTC (rev 67989)
@@ -0,0 +1,72 @@
+/*
+ * 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.container.jboss42;
+
+// $Id: DefaultInvocationHandlerJAXRPC.java 3959 2007-07-20 14:44:19Z heiko.braun at jboss.com $
+
+import javax.xml.rpc.server.ServiceLifecycle;
+import javax.xml.rpc.server.ServletEndpointContext;
+
+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 Thomas.Diesler at jboss.org
+ * @since 25-Apr-2007
+ */
+public class InvocationHandlerJAXRPC extends InvocationHandlerJSE
+{
+   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);
+      }
+   }
+}

Copied: branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/InvocationHandlerJAXWS.java (from rev 67988, branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/DefaultInvocationHandlerJAXWS.java)
===================================================================
--- branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/InvocationHandlerJAXWS.java	                        (rev 0)
+++ branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/InvocationHandlerJAXWS.java	2007-12-06 11:53:33 UTC (rev 67989)
@@ -0,0 +1,34 @@
+/*
+ * 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.container.jboss42;
+
+// $Id: DefaultInvocationHandlerJAXWS.java 4023 2007-07-28 07:14:06Z thomas.diesler at jboss.com $
+
+/**
+ * Handles invocations on JSE endpoints.
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 25-Apr-2007
+ */
+public class InvocationHandlerJAXWS extends InvocationHandlerJSE
+{
+}

Copied: branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/InvocationHandlerJSE.java (from rev 67988, branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/DefaultInvocationHandler.java)
===================================================================
--- branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/InvocationHandlerJSE.java	                        (rev 0)
+++ branches/Branch_4_2/webservices/src/main/org/jboss/wsf/container/jboss42/InvocationHandlerJSE.java	2007-12-06 11:53:33 UTC (rev 67989)
@@ -0,0 +1,129 @@
+/*
+ * 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.container.jboss42;
+
+// $Id: DefaultInvocationHandlerJAXWS.java 4023 2007-07-28 07:14:06Z thomas.diesler at jboss.com $
+
+import java.lang.reflect.Method;
+
+import javax.xml.ws.WebServiceContext;
+
+import org.jboss.wsf.common.JavaUtils;
+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.InvocationHandler;
+import org.jboss.wsf.spi.invocation.ResourceInjector;
+import org.jboss.wsf.spi.invocation.ResourceInjectorFactory;
+
+/**
+ * Handles invocations on JSE endpoints.
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 25-Apr-2007
+ */
+public class InvocationHandlerJSE extends InvocationHandler
+{
+   private SPIProvider spiProvider;
+   private ResourceInjectorFactory resourceInjectorFactory;
+
+   public InvocationHandlerJSE()
+   {
+      spiProvider = SPIProviderResolver.getInstance().getProvider();
+      resourceInjectorFactory = spiProvider.getSPI(ResourceInjectorFactory.class);
+   }
+
+   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)
+         {
+
+            ResourceInjector injector = resourceInjectorFactory.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);
+      }
+   }
+
+   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;
+   }
+}




More information about the jboss-cvs-commits mailing list