[jbossws-commits] JBossWS SVN: r3524 - branches/jbossws-2.0/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Sat Jun 9 13:28:37 EDT 2007


Author: thomas.diesler at jboss.com
Date: 2007-06-09 13:28:37 -0400 (Sat, 09 Jun 2007)
New Revision: 3524

Modified:
   branches/jbossws-2.0/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java
Log:
Fix EJB21 endpoint handler callback

Modified: branches/jbossws-2.0/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java
===================================================================
--- branches/jbossws-2.0/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java	2007-06-09 17:23:17 UTC (rev 3523)
+++ branches/jbossws-2.0/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java	2007-06-09 17:28:37 UTC (rev 3524)
@@ -123,33 +123,12 @@
    {
       log.debug("Invoke: " + inv.getJavaMethod().getName());
 
-      SecurityAdaptor securityAdaptor = SecurityAdaptorFactory.getSecurityAdaptor();
-      Principal principal = securityAdaptor.getPrincipal();
-      Object credential = securityAdaptor.getCredential();
-
       // invoke on the container
       try
       {
          // setup the invocation
-         Method method = inv.getJavaMethod();
-         Object[] args = inv.getArgs();
-         org.jboss.invocation.Invocation jbInv = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential);
+         org.jboss.invocation.Invocation jbInv = getMBeanInvocation(inv);
 
-         // EJB2.1 endpoints will only get an JAXRPC context 
-         MessageContext msgContext = inv.getInvocationContext().getAttachment(MessageContext.class);
-         if (msgContext == null)
-            throw new IllegalStateException("Cannot obtain MessageContext");
-
-         HandlerCallback callback = inv.getInvocationContext().getAttachment(HandlerCallback.class);
-         if (callback == null)
-            throw new IllegalStateException("Cannot obtain HandlerCallback");
-
-         jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext);
-         jbInv.setValue(InvocationKey.SOAP_MESSAGE, ((SOAPMessageContext)msgContext).getMessage());
-         jbInv.setType(InvocationType.SERVICE_ENDPOINT);
-         jbInv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT);
-         jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT);
-
          String[] sig = { org.jboss.invocation.Invocation.class.getName() };
          Object retObj = server.invoke(objectName, "invoke", new Object[] { jbInv }, sig);
          inv.setReturnValue(retObj);
@@ -159,4 +138,32 @@
          handleInvocationException(e);
       }
    }
+
+   private org.jboss.invocation.Invocation getMBeanInvocation(Invocation inv)
+   {
+      // EJB2.1 endpoints will only get an JAXRPC context 
+      MessageContext msgContext = inv.getInvocationContext().getAttachment(MessageContext.class);
+      if (msgContext == null)
+         throw new IllegalStateException("Cannot obtain MessageContext");
+
+      SecurityAdaptor securityAdaptor = SecurityAdaptorFactory.getSecurityAdaptor();
+      Principal principal = securityAdaptor.getPrincipal();
+      Object credential = securityAdaptor.getCredential();
+
+      Method method = inv.getJavaMethod();
+      Object[] args = inv.getArgs();
+      org.jboss.invocation.Invocation jbInv = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential);
+
+      HandlerCallback callback = inv.getInvocationContext().getAttachment(HandlerCallback.class);
+      if (callback == null)
+         throw new IllegalStateException("Cannot obtain HandlerCallback");
+
+      jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext);
+      jbInv.setValue(InvocationKey.SOAP_MESSAGE, ((SOAPMessageContext)msgContext).getMessage());
+      jbInv.setType(InvocationType.SERVICE_ENDPOINT);
+      jbInv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT);
+      jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT);
+
+      return jbInv;
+   }
 }




More information about the jbossws-commits mailing list