[jboss-cvs] JBossAS SVN: r70748 - trunk/webservices/src/main/org/jboss/wsf/container/jboss50.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Mar 11 14:07:17 EDT 2008
Author: heiko.braun at jboss.com
Date: 2008-03-11 14:07:17 -0400 (Tue, 11 Mar 2008)
New Revision: 70748
Modified:
trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java
Log:
Fix EJBTHREE-1192: ClassProxyHack breaks all EJB3 Web Service endpoints
Modified: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java 2008-03-11 17:01:59 UTC (rev 70747)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InvocationHandlerEJB3.java 2008-03-11 18:07:17 UTC (rev 70748)
@@ -23,18 +23,13 @@
// $Id: InvocationHandlerEJB3.java 4099 2007-08-02 13:36:49Z thomas.diesler at jboss.com $
-import java.lang.reflect.Method;
-
-import javax.ejb.EJBContext;
-import javax.management.ObjectName;
-import javax.xml.ws.WebServiceException;
-
-import org.jboss.aop.Dispatcher;
+import org.jboss.dependency.spi.ControllerContext;
import org.jboss.ejb3.BeanContext;
import org.jboss.ejb3.BeanContextLifecycleCallback;
import org.jboss.ejb3.stateless.StatelessBeanContext;
import org.jboss.ejb3.stateless.StatelessContainer;
import org.jboss.injection.lang.reflect.BeanProperty;
+import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.wsf.common.ObjectNameFactory;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
@@ -44,7 +39,13 @@
import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.InvocationType;
import org.jboss.wsf.spi.invocation.WebServiceContextFactory;
+import org.jboss.wsf.spi.util.KernelLocator;
+import javax.ejb.EJBContext;
+import javax.management.ObjectName;
+import javax.xml.ws.WebServiceException;
+import java.lang.reflect.Method;
+
/**
* Handles invocations on EJB3 endpoints.
*
@@ -54,9 +55,11 @@
public class InvocationHandlerEJB3 extends AbstractInvocationHandler
{
private ObjectName objectName;
+ private KernelController houston;
InvocationHandlerEJB3()
{
+ houston = KernelLocator.getKernel().getController();
}
public Invocation createInvocation()
@@ -76,27 +79,21 @@
objectName = ObjectNameFactory.create(nameStr.toString());
- Dispatcher dispatcher = Dispatcher.singleton;
- if (dispatcher.getRegistered(objectName.getCanonicalName()) == null)
+ if (houston.getInstalledContext( objectName.getCanonicalName() ) == null)
throw new WebServiceException("Cannot find service endpoint target: " + objectName);
}
public void invoke(Endpoint ep, Invocation wsInv) throws Exception
{
try
- {
- Dispatcher dispatcher = Dispatcher.singleton;
- Object regobj = dispatcher.getRegistered(objectName.getCanonicalName());
-
+ {
+ ControllerContext context = houston.getInstalledContext(objectName.getCanonicalName());
- StatelessContainer container;
+ Object target = context.getTarget();
+ if(! (target instanceof StatelessContainer) )
+ throw new IllegalArgumentException("Unexpected invocation target: " + target);
- // Workaround for [EJBTHREE-1192] ClassProxyHack breaks all EJB3 Web Service endpoints
- if (regobj instanceof StatelessContainer)
- container = (StatelessContainer)regobj;
- else
- throw new IllegalStateException("Unsupported obj instance: " + regobj);
-
+ StatelessContainer container = (StatelessContainer) target;
Class beanClass = container.getBeanClass();
Method method = getImplMethod(beanClass, wsInv.getJavaMethod());
More information about the jboss-cvs-commits
mailing list