Author: thomas.diesler(a)jboss.com
Date: 2007-01-23 07:36:16 -0500 (Tue, 23 Jan 2007)
New Revision: 2032
Removed:
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceContextEJB3.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextImpl.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/jbws718/
trunk/jbossws-tests/src/main/resources/jaxrpc/jbws718/
Modified:
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java
trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml
trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
trunk/jbossws-tests/build.xml
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/context/EndpointEJB.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/context/WebServiceContextEJBTestCase.java
trunk/jbossws-tests/src/main/resources/tests-jboss40-excludes.txt
trunk/jbossws-tests/src/main/resources/tests-jboss42-excludes.txt
trunk/jbossws-tests/src/main/resources/tests-jboss42-noejb3-excludes.txt
trunk/jbossws-tests/src/main/resources/tests-jboss50-excludes.txt
trunk/jbossws-tests/src/main/resources/tests-tomcat-excludes.txt
Log:
Provide workaround for: [JBWS-1468] - @Resource WebServiceContext for jbossas-4.x
Modified:
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java
===================================================================
---
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java 2007-01-23
12:28:31 UTC (rev 2031)
+++
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java 2007-01-23
12:36:16 UTC (rev 2032)
@@ -42,6 +42,7 @@
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.jaxws.WebServiceContextEJB;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
import org.jboss.ws.core.server.AbstractServiceEndpointInvoker;
import org.jboss.ws.core.server.ServiceEndpointInfo;
@@ -170,7 +171,7 @@
if (beanProp != null)
{
EJBContext ejbCtx = beanCtx.getEJBContext();
- beanProp.set(beanCtx.getInstance(), new
WebServiceContextEJB3(jaxwsMessageContext, ejbCtx));
+ beanProp.set(beanCtx.getInstance(), new
WebServiceContextEJB(jaxwsMessageContext, ejbCtx));
}
}
Deleted:
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceContextEJB3.java
===================================================================
---
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceContextEJB3.java 2007-01-23
12:28:31 UTC (rev 2031)
+++
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceContextEJB3.java 2007-01-23
12:36:16 UTC (rev 2032)
@@ -1,62 +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.ws.integration.jboss50;
-
-// $Id$
-
-import java.security.Principal;
-
-import javax.ejb.EJBContext;
-import javax.xml.ws.handler.MessageContext;
-
-import org.jboss.ws.core.jaxws.AbstractWebServiceContext;
-
-/**
- * A WebServiceContext implementation that delegates to the EJBContext.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jan-2007
- */
-public class WebServiceContextEJB3 extends AbstractWebServiceContext
-{
- private EJBContext ejbContext;
-
- public WebServiceContextEJB3(MessageContext messageContext, EJBContext ejbContext)
- {
- super(messageContext);
- this.ejbContext = ejbContext;
- }
-
- @Override
- public Principal getUserPrincipal()
- {
- Principal principal = ejbContext.getCallerPrincipal();
- return principal;
- }
-
- @Override
- public boolean isUserInRole(String role)
- {
- boolean isUserInRole = ejbContext.isCallerInRole(role);
- return isUserInRole;
- }
-}
Deleted:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextImpl.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextImpl.java 2007-01-23
12:28:31 UTC (rev 2031)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextImpl.java 2007-01-23
12:36:16 UTC (rev 2032)
@@ -1,98 +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.ws.core.jaxws;
-
-// $Id$
-
-import java.io.Serializable;
-import java.security.Principal;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.xml.ws.handler.MessageContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.security.RealmMapping;
-import org.jboss.security.SecurityAssociation;
-import org.jboss.security.SimplePrincipal;
-
-/**
- * A WebServiceContext implementation that delegates to the EJBContext if available.
- * Otherwise it uses jbosssx.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jan-2007
- */
-public class WebServiceContextImpl extends AbstractWebServiceContext implements
Serializable
-{
- // provide logging
- private Logger log = Logger.getLogger(WebServiceContextImpl.class);
-
- private transient RealmMapping realmMapping;
-
- public WebServiceContextImpl(MessageContext messageContext)
- {
- super(messageContext);
- }
-
- @Override
- public Principal getUserPrincipal()
- {
- Principal principal = SecurityAssociation.getCallerPrincipal();
- return principal;
- }
-
- @Override
- public boolean isUserInRole(String role)
- {
- boolean isUserInRole = false;
- Principal principal = SecurityAssociation.getCallerPrincipal();
- RealmMapping realmMapping = getRealmMapping();
- if (realmMapping != null && principal != null)
- {
- Set<Principal> roles = new HashSet<Principal>();
- roles.add(new SimplePrincipal(role));
- isUserInRole = realmMapping.doesUserHaveRole(principal, roles);
- }
- return isUserInRole;
- }
-
- private RealmMapping getRealmMapping()
- {
- if (realmMapping == null)
- {
- String lookupName = "java:comp/env/security/realmMapping";
- try
- {
- InitialContext iniCtx = new InitialContext();
- realmMapping = (RealmMapping)iniCtx.lookup(lookupName);
- }
- catch (NamingException e)
- {
- log.debug("Cannot obtain realm mapping from: " + lookupName);
- }
- }
- return realmMapping;
- }
-}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java 2007-01-23
12:28:31 UTC (rev 2031)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java 2007-01-23
12:36:16 UTC (rev 2032)
@@ -36,8 +36,8 @@
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.jaxrpc.ServletEndpointContextImpl;
-import org.jboss.ws.core.jaxws.WebServiceContextImpl;
import org.jboss.ws.core.jaxws.WebServiceContextInjector;
+import org.jboss.ws.core.jaxws.WebServiceContextJSE;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
@@ -92,7 +92,7 @@
CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
if (msgContext instanceof SOAPMessageContextJAXWS)
{
- WebServiceContext wsContext = new
WebServiceContextImpl((SOAPMessageContextJAXWS)msgContext);
+ WebServiceContext wsContext = new
WebServiceContextJSE((SOAPMessageContextJAXWS)msgContext);
new WebServiceContextInjector().injectContext(seiImpl, wsContext);
}
Modified: trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml
===================================================================
--- trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2007-01-23 12:28:31 UTC (rev
2031)
+++ trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2007-01-23 12:36:16 UTC (rev
2032)
@@ -304,33 +304,6 @@
</metainf>
</jar>
- <!-- jaxrpc-jbws718 -->
- <war warfile="${tests.output.dir}/libs/jaxrpc-jbws718.war"
webxml="${tests.output.dir}/resources/jaxrpc/jbws718/WEB-INF/web.xml">
- <classes dir="${tests.output.dir}/classes">
- <include name="org/jboss/test/ws/jaxrpc/jbws718/*.class"/>
- <exclude
name="org/jboss/test/ws/jaxrpc/jbws718/*TestCase.class"/>
- </classes>
- <webinf
dir="${tests.output.dir}/resources/jaxrpc/jbws718/WEB-INF">
- <include name="webservices.xml"/>
- <include name="jaxrpc-mapping.xml"/>
- <include name="wsdl/**"/>
- </webinf>
- </war>
- <jar destfile="${tests.output.dir}/libs/jaxrpc-jbws718-client.jar">
- <fileset dir="${tests.output.dir}/classes">
- <include name="org/jboss/test/ws/jaxrpc/jbws718/*.class"/>
- <exclude
name="org/jboss/test/ws/jaxrpc/jbws718/*TestCase.class"/>
- </fileset>
- <metainf
dir="${tests.output.dir}/resources/jaxrpc/jbws718/META-INF">
- <include name="application-client.xml"/>
- <include name="jboss-client.xml"/>
- </metainf>
- <metainf
dir="${tests.output.dir}/resources/jaxrpc/jbws718/WEB-INF">
- <include name="wsdl/**"/>
- <include name="jaxrpc-mapping.xml"/>
- </metainf>
- </jar>
-
<!-- jaxrpc-jbws720 -->
<war warfile="${tests.output.dir}/libs/jaxrpc-jbws720.war"
webxml="${tests.output.dir}/resources/jaxrpc/jbws720/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
Modified: trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
===================================================================
--- trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-01-23 12:28:31 UTC (rev
2031)
+++ trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-01-23 12:36:16 UTC (rev
2032)
@@ -60,6 +60,11 @@
<include
name="org/jboss/test/ws/jaxws/context/EndpointEJB.class"/>
</fileset>
</jar>
+ <jar jarfile="${tests.output.dir}/libs/jaxws-context-jboss4x.jar">
+ <fileset dir="${tests.output.dir}/classes">
+ <include
name="org/jboss/test/ws/jaxws/context/EndpointNoInjectEJB.class"/>
+ </fileset>
+ </jar>
<!-- jaxws-eardeployment -->
<war warfile="${tests.output.dir}/libs/jaxws-eardeployment.war"
webxml="${tests.output.dir}/resources/jaxws/eardeployment/WEB-INF/web.xml">
Modified: trunk/jbossws-tests/build.xml
===================================================================
--- trunk/jbossws-tests/build.xml 2007-01-23 12:28:31 UTC (rev 2031)
+++ trunk/jbossws-tests/build.xml 2007-01-23 12:36:16 UTC (rev 2032)
@@ -273,7 +273,6 @@
<classpath location="${tests.output.dir}"/>
</taskdef>
<mkdir dir="${tests.output.dir}/wstools/java"/>
- <wstools
dest="${tests.output.dir}/wstools/resources/jaxrpc/jbws718/WEB-INF"
config="${tests.resources.dir}/jaxrpc/jbws718/wstools-config.xml"/>
<wstools
dest="${tests.output.dir}/wstools/resources/jaxrpc/samples/docstyle/wrapped/WEB-INF"
config="${tests.resources.dir}/jaxrpc/samples/docstyle/wrapped/wstools-config.xml"/>
<wstools
dest="${tests.output.dir}/wstools/resources/jaxrpc/samples/docstyle/bare/WEB-INF"
config="${tests.resources.dir}/jaxrpc/samples/docstyle/bare/wstools-config.xml"/>
<wstools
dest="${tests.output.dir}/wstools/resources/jaxrpc/samples/dynamichandler/WEB-INF"
config="${tests.resources.dir}/jaxrpc/samples/dynamichandler/wstools-config.xml"/>
@@ -295,7 +294,6 @@
<wstools
dest="${tests.output.dir}/wstools/resources/jaxws/samples/jsr181pojo/docwrapped/META-INF"
config="${tests.resources.dir}/jaxws/samples/jsr181pojo/docwrapped/wstools-config.xml"/>
<wstools
dest="${tests.output.dir}/wstools/resources/jaxws/samples/wsaddressing/META-INF"
config="${tests.resources.dir}/jaxws/samples/wsaddressing/wstools-config.xml"/>
<move todir="${tests.output.dir}/wstools/java">
- <fileset
dir="${tests.output.dir}/wstools/resources/jaxrpc/jbws718/WEB-INF"
includes="org/**"/>
<fileset
dir="${tests.output.dir}/wstools/resources/jaxrpc/samples/docstyle/wrapped/WEB-INF"
includes="org/**"/>
</move>
</target>
Modified:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/context/EndpointEJB.java
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/context/EndpointEJB.java 2007-01-23
12:28:31 UTC (rev 2031)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/context/EndpointEJB.java 2007-01-23
12:36:16 UTC (rev 2032)
@@ -47,8 +47,7 @@
@RolesAllowed("friend")
public class EndpointEJB
{
- // mappedName needed for jboss40
- @Resource(mappedName = "wsCtx")
+ @Resource
WebServiceContext wsCtx;
@WebMethod
Modified:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/context/WebServiceContextEJBTestCase.java
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/context/WebServiceContextEJBTestCase.java 2007-01-23
12:28:31 UTC (rev 2031)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/context/WebServiceContextEJBTestCase.java 2007-01-23
12:36:16 UTC (rev 2032)
@@ -33,6 +33,7 @@
import junit.framework.Test;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestHelper;
import org.jboss.test.ws.JBossWSTestSetup;
/**
@@ -47,7 +48,8 @@
public static Test suite()
{
- return JBossWSTestSetup.newTestSetup(WebServiceContextEJBTestCase.class,
"jaxws-context.jar");
+ String endpointJar = (JBossWSTestHelper.isTargetJBoss50() ?
"jaxws-context.jar" : "jaxws-context-jboss4x.jar");
+ return JBossWSTestSetup.newTestSetup(WebServiceContextEJBTestCase.class,
endpointJar);
}
public void setUp() throws Exception
Modified: trunk/jbossws-tests/src/main/resources/tests-jboss40-excludes.txt
===================================================================
--- trunk/jbossws-tests/src/main/resources/tests-jboss40-excludes.txt 2007-01-23 12:28:31
UTC (rev 2031)
+++ trunk/jbossws-tests/src/main/resources/tests-jboss40-excludes.txt 2007-01-23 12:36:16
UTC (rev 2032)
@@ -1,10 +1,6 @@
org/jboss/test/ws/interop/**
org/jboss/test/ws/jaxrpc/benchmark/**
-org/jboss/test/ws/jaxrpc/jbws718/**
-org/jboss/test/ws/jaxrpc/samples/wseventing/**
-org/jboss/test/ws/jaxrpc/wseventing/**
org/jboss/test/ws/jaxws/benchmark/**
-org/jboss/test/ws/jaxws/context/WebServiceContextEJBTestCase*
org/jboss/test/ws/jaxws/endpoint/**
org/jboss/test/ws/jaxws/jsr181/handlerchain/HandlerChainClientTestCase*
org/jboss/test/ws/jaxws/webserviceref/**
Modified: trunk/jbossws-tests/src/main/resources/tests-jboss42-excludes.txt
===================================================================
--- trunk/jbossws-tests/src/main/resources/tests-jboss42-excludes.txt 2007-01-23 12:28:31
UTC (rev 2031)
+++ trunk/jbossws-tests/src/main/resources/tests-jboss42-excludes.txt 2007-01-23 12:36:16
UTC (rev 2032)
@@ -1,10 +1,6 @@
org/jboss/test/ws/interop/**
org/jboss/test/ws/jaxrpc/benchmark/**
-org/jboss/test/ws/jaxrpc/jbws718/**
-org/jboss/test/ws/jaxrpc/samples/wseventing/**
-org/jboss/test/ws/jaxrpc/wseventing/**
org/jboss/test/ws/jaxws/benchmark/**
-org/jboss/test/ws/jaxws/context/WebServiceContextEJBTestCase*
org/jboss/test/ws/jaxws/endpoint/**
org/jboss/test/ws/jaxws/jsr181/handlerchain/HandlerChainClientTestCase*
org/jboss/test/ws/jaxws/webserviceref/**
Modified: trunk/jbossws-tests/src/main/resources/tests-jboss42-noejb3-excludes.txt
===================================================================
--- trunk/jbossws-tests/src/main/resources/tests-jboss42-noejb3-excludes.txt 2007-01-23
12:28:31 UTC (rev 2031)
+++ trunk/jbossws-tests/src/main/resources/tests-jboss42-noejb3-excludes.txt 2007-01-23
12:36:16 UTC (rev 2032)
@@ -1,15 +1,12 @@
org/jboss/test/ws/interop/**
org/jboss/test/ws/jaxrpc/benchmark/**
-org/jboss/test/ws/jaxrpc/jbws718/**
-org/jboss/test/ws/jaxrpc/samples/wseventing/**
-org/jboss/test/ws/jaxrpc/wseventing/**
org/jboss/test/ws/jaxws/benchmark/**
-org/jboss/test/ws/jaxws/context/WebServiceContextEJBTestCase*
org/jboss/test/ws/jaxws/endpoint/**
org/jboss/test/ws/jaxws/jsr181/handlerchain/HandlerChainClientTestCase.*
org/jboss/test/ws/jaxws/webserviceref/**
# EJB3 excludes
+org/jboss/test/ws/jaxws/context/WebServiceContextEJBTestCase*
org/jboss/test/ws/jaxws/eardeployment/**
org/jboss/test/ws/jaxws/jbws944/**
org/jboss/test/ws/jaxws/jbws981/**
Modified: trunk/jbossws-tests/src/main/resources/tests-jboss50-excludes.txt
===================================================================
--- trunk/jbossws-tests/src/main/resources/tests-jboss50-excludes.txt 2007-01-23 12:28:31
UTC (rev 2031)
+++ trunk/jbossws-tests/src/main/resources/tests-jboss50-excludes.txt 2007-01-23 12:36:16
UTC (rev 2032)
@@ -1,5 +1,3 @@
org/jboss/test/ws/interop/**
org/jboss/test/ws/jaxrpc/benchmark/**
-org/jboss/test/ws/jaxrpc/jbws718/**
-org/jboss/test/ws/jaxrpc/samples/wseventing/**
-org/jboss/test/ws/jaxrpc/wseventing/**
+org/jboss/test/ws/jaxws/benchmark/**
Modified: trunk/jbossws-tests/src/main/resources/tests-tomcat-excludes.txt
===================================================================
--- trunk/jbossws-tests/src/main/resources/tests-tomcat-excludes.txt 2007-01-23 12:28:31
UTC (rev 2031)
+++ trunk/jbossws-tests/src/main/resources/tests-tomcat-excludes.txt 2007-01-23 12:36:16
UTC (rev 2032)
@@ -1,15 +1,11 @@
-org/jboss/test/ws/interop/**
org/jboss/test/ws/jaxrpc/benchmark/**
-org/jboss/test/ws/jaxrpc/jbws718/**
org/jboss/test/ws/jaxrpc/jbws1011/**
-org/jboss/test/ws/jaxrpc/samples/wseventing/**
org/jboss/test/ws/jaxrpc/samples/dynamichandler/**
org/jboss/test/ws/jaxrpc/samples/jmstransport/**
org/jboss/test/ws/jaxrpc/samples/jsr109ejb/**
org/jboss/test/ws/jaxrpc/samples/secureejb/**
org/jboss/test/ws/jaxrpc/samples/wsbpel/**
org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.*
-org/jboss/test/ws/jaxrpc/wseventing/**
org/jboss/test/ws/jaxws/context/WebServiceContextEJBTestCase*
org/jboss/test/ws/jaxws/jsr181/handlerchain/HandlerChainClientTestCase.*
org/jboss/test/ws/jaxws/samples/jsr181ejb/**