[jbossws-commits] JBossWS SVN: r14590 - container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Mon Jun 20 12:25:38 EDT 2011


Author: richard.opalka at jboss.com
Date: 2011-06-20 12:25:38 -0400 (Mon, 20 Jun 2011)
New Revision: 14590

Modified:
   container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
Log:
[JBWS-3318] WebServiceContext is invocation type agnostic since now

Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java	2011-06-20 15:10:51 UTC (rev 14589)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java	2011-06-20 16:25:38 UTC (rev 14590)
@@ -22,17 +22,13 @@
 package org.jboss.webservices.integration.invocation;
 
 import java.lang.reflect.Method;
-import java.security.Principal;
 
 import javax.naming.Context;
 import javax.naming.NamingException;
-import javax.xml.ws.EndpointReference;
 import javax.xml.ws.WebServiceContext;
 import javax.xml.ws.WebServiceException;
-import javax.xml.ws.handler.MessageContext;
 
 import org.jboss.ejb3.EJBContainer;
-import org.jboss.ejb3.context.CurrentEJBContext;
 import org.jboss.webservices.integration.util.ASHelper;
 import org.jboss.ws.common.injection.ThreadLocalAwareWebServiceContext;
 import org.jboss.ws.common.invocation.AbstractInvocationHandler;
@@ -45,7 +41,6 @@
 import org.jboss.wsf.spi.invocation.integration.ServiceEndpointContainer;
 import org.jboss.wsf.spi.ioc.IoCContainerProxy;
 import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
-import org.w3c.dom.Element;
 
 /**
  * Handles invocations on EJB3 endpoints.
@@ -187,44 +182,9 @@
    {
       final InvocationContext invocationContext = invocation.getInvocationContext();
 
-      return new WebServiceContextAdapter(invocationContext.getAttachment(WebServiceContext.class));
+      return invocationContext.getAttachment(WebServiceContext.class);
    }
 
-   private static final class WebServiceContextAdapter implements WebServiceContext
-   {
-      private final WebServiceContext delegate;
-
-      private WebServiceContextAdapter(final WebServiceContext delegate)
-      {
-         this.delegate = delegate;
-      }
-
-      public MessageContext getMessageContext()
-      {
-         return this.delegate.getMessageContext();
-      }
-
-      public Principal getUserPrincipal()
-      {
-         return CurrentEJBContext.get().getCallerPrincipal();
-      }
-
-      public boolean isUserInRole(final String role)
-      {
-         return CurrentEJBContext.get().isCallerInRole(role);
-      }
-
-      public EndpointReference getEndpointReference(final Element... referenceParameters)
-      {
-         return delegate.getEndpointReference(referenceParameters);
-      }
-
-      public <T extends EndpointReference> T getEndpointReference(final Class<T> clazz, final Element... referenceParameters)
-      {
-         return delegate.getEndpointReference(clazz, referenceParameters);
-      }
-   }
-
    /**
     * EJB3 invocation callback allowing EJB 3 beans to access Web Service invocation properties.
     */



More information about the jbossws-commits mailing list