Author: thomas.diesler(a)jboss.com
Date: 2007-05-22 15:32:06 -0400 (Tue, 22 May 2007)
New Revision: 3195
Added:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/SecurityAdaptorImpl.java
trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.wsf.spi.invocation.SecurityAdaptor
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/SecurityAdaptorImpl.java
trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.wsf.spi.invocation.SecurityAdaptor
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptor.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptorFactory.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/utils/FactoryLoader.java
Removed:
trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.ws.extensions.security.SecurityAssociationAdaptorFactory
trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.ws.integration.invocation.SecurityAssociationAdaptor
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAssociationAdaptor.java
trunk/jbossws-core/src/main/java/javax/xml/soap/FactoryLoader.java
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB21.java
trunk/integration/jbws/ant-import/build-deploy.xml
trunk/integration/jbws/build.xml
trunk/jbossws-core/ant-import-tests/build-testsuite.xml
trunk/jbossws-core/src/main/java/javax/xml/soap/MessageFactory.java
trunk/jbossws-core/src/main/java/javax/xml/soap/SAAJMetaFactory.java
trunk/jbossws-core/src/main/java/javax/xml/soap/SOAPFactory.java
trunk/jbossws-core/src/main/java/javax/xml/ws/spi/Provider.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/HttpServer.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java
Log:
Fix jaxrpc wsse regression
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java 2007-05-22
19:17:16 UTC (rev 3194)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/InvocationHandlerEJB21.java 2007-05-22
19:32:06 UTC (rev 3195)
@@ -40,12 +40,13 @@
import org.jboss.invocation.PayloadKey;
import org.jboss.logging.Logger;
import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.security.SecurityAssociation;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
import org.jboss.wsf.spi.invocation.AbstractInvocationHandler;
import org.jboss.wsf.spi.invocation.HandlerCallback;
import org.jboss.wsf.spi.invocation.Invocation;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.wsf.spi.utils.ObjectNameFactory;
@@ -126,9 +127,9 @@
{
log.debug("Invoke: " + inv.getJavaMethod().getName());
- // these are provided by the ServerLoginHandler
- Principal principal = SecurityAssociation.getPrincipal();
- Object credential = SecurityAssociation.getCredential();
+ SecurityAdaptor securityAdaptor = SecurityAdaptorFactory.getSecurityAdaptor();
+ Principal principal = securityAdaptor.getPrincipal();
+ Object credential = securityAdaptor.getCredential();
// invoke on the container
try
Added:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/SecurityAdaptorImpl.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/SecurityAdaptorImpl.java
(rev 0)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/SecurityAdaptorImpl.java 2007-05-22
19:32:06 UTC (rev 3195)
@@ -0,0 +1,58 @@
+/*
+ * 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$
+
+import java.security.Principal;
+
+import org.jboss.security.SecurityAssociation;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+
+/**
+ * A JBoss specific SecurityAssociationAdaptor
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class SecurityAdaptorImpl implements SecurityAdaptor
+{
+ public Principal getPrincipal()
+ {
+ return SecurityAssociation.getPrincipal();
+ }
+
+ public void setPrincipal(Principal pricipal)
+ {
+ SecurityAssociation.setPrincipal(pricipal);
+ }
+
+ public Object getCredential()
+ {
+ return SecurityAssociation.getCredential();
+ }
+
+ public void setCredential(Object credential)
+ {
+ SecurityAssociation.setCredential(credential);
+ }
+}
Property changes on:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/SecurityAdaptorImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.ws.extensions.security.SecurityAssociationAdaptorFactory
===================================================================
---
trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.ws.extensions.security.SecurityAssociationAdaptorFactory 2007-05-22
19:17:16 UTC (rev 3194)
+++
trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.ws.extensions.security.SecurityAssociationAdaptorFactory 2007-05-22
19:32:06 UTC (rev 3195)
@@ -1 +0,0 @@
-org.jboss.ws.integration.jboss42.jbossws.SecurityAssociationAdaptorFactoryImpl
\ No newline at end of file
Added:
trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.wsf.spi.invocation.SecurityAdaptor
===================================================================
---
trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.wsf.spi.invocation.SecurityAdaptor
(rev 0)
+++
trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.wsf.spi.invocation.SecurityAdaptor 2007-05-22
19:32:06 UTC (rev 3195)
@@ -0,0 +1 @@
+org.jboss.wsf.container.jboss42.SecurityAdaptorImpl
\ No newline at end of file
Modified:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB21.java
===================================================================
---
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB21.java 2007-05-22
19:17:16 UTC (rev 3194)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/InvocationHandlerEJB21.java 2007-05-22
19:32:06 UTC (rev 3195)
@@ -41,13 +41,14 @@
import org.jboss.logging.Logger;
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.security.SecurityContext;
-import org.jboss.security.SecurityContextUtil;
import org.jboss.security.plugins.SecurityContextAssociation;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedDeploymentInfo;
import org.jboss.wsf.spi.invocation.AbstractInvocationHandler;
import org.jboss.wsf.spi.invocation.HandlerCallback;
import org.jboss.wsf.spi.invocation.Invocation;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.wsf.spi.utils.ObjectNameFactory;
@@ -128,17 +129,17 @@
{
log.debug("Invoke: " + inv.getJavaMethod().getName());
- Principal principal = null;
- Object credential = null;
+ SecurityAdaptor securityAdaptor = SecurityAdaptorFactory.getSecurityAdaptor();
+ SecurityContext sc = SecurityContextAssociation.getSecurityContext();
+ Principal principal = securityAdaptor.getPrincipal();
+ Object credential = securityAdaptor.getCredential();
- SecurityContext securityContext = SecurityContextAssociation.getSecurityContext();
- if (securityContext != null)
- {
- SecurityContextUtil util = securityContext.getUtil();
- principal = util.getUserPrincipal();
- credential = util.getCredential();
- }
+ if (principal == null && sc != null)
+ principal = sc.getUtil().getUserPrincipal();
+ if (credential == null && sc != null)
+ credential = sc.getUtil().getCredential();
+
// invoke on the container
try
{
Added:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/SecurityAdaptorImpl.java
===================================================================
---
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/SecurityAdaptorImpl.java
(rev 0)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/SecurityAdaptorImpl.java 2007-05-22
19:32:06 UTC (rev 3195)
@@ -0,0 +1,58 @@
+/*
+ * 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.jboss50;
+
+// $Id$
+
+import java.security.Principal;
+
+import org.jboss.security.SecurityAssociation;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+
+/**
+ * A JBoss specific SecurityAssociationAdaptor
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class SecurityAdaptorImpl implements SecurityAdaptor
+{
+ public Principal getPrincipal()
+ {
+ return SecurityAssociation.getPrincipal();
+ }
+
+ public void setPrincipal(Principal pricipal)
+ {
+ SecurityAssociation.setPrincipal(pricipal);
+ }
+
+ public Object getCredential()
+ {
+ return SecurityAssociation.getCredential();
+ }
+
+ public void setCredential(Object credential)
+ {
+ SecurityAssociation.setCredential(credential);
+ }
+}
Property changes on:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/SecurityAdaptorImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.ws.integration.invocation.SecurityAssociationAdaptor
===================================================================
---
trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.ws.integration.invocation.SecurityAssociationAdaptor 2007-05-22
19:17:16 UTC (rev 3194)
+++
trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.ws.integration.invocation.SecurityAssociationAdaptor 2007-05-22
19:32:06 UTC (rev 3195)
@@ -1 +0,0 @@
-org.jboss.ws.integration.jboss50.SecurityAssociationAdaptorFactoryImpl
\ No newline at end of file
Added:
trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.wsf.spi.invocation.SecurityAdaptor
===================================================================
---
trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.wsf.spi.invocation.SecurityAdaptor
(rev 0)
+++
trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.wsf.spi.invocation.SecurityAdaptor 2007-05-22
19:32:06 UTC (rev 3195)
@@ -0,0 +1 @@
+org.jboss.wsf.container.jboss50.SecurityAdaptorImpl
\ No newline at end of file
Modified: trunk/integration/jbws/ant-import/build-deploy.xml
===================================================================
--- trunk/integration/jbws/ant-import/build-deploy.xml 2007-05-22 19:17:16 UTC (rev 3194)
+++ trunk/integration/jbws/ant-import/build-deploy.xml 2007-05-22 19:32:06 UTC (rev 3195)
@@ -45,6 +45,9 @@
<fileset dir="${spi.dir}/output/lib">
<include name="jbossws-spi.jar"/>
</fileset>
+ <fileset dir="${int.jboss50.dir}/output/lib">
+ <include name="jbossws-jboss50.jar"/>
+ </fileset>
<fileset dir="${core.dir}/output/lib">
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
@@ -79,6 +82,7 @@
<include name="jbossws-wsconsume-impl.jar"/>
</fileset>
<fileset
dir="${jboss50.home}/server/${jboss.server.instance}/lib">
+ <include name="jbossws-jboss50.jar"/>
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
@@ -117,6 +121,9 @@
</fileset>
</copy>
<copy todir="${jboss42.home}/server/${jboss.server.instance}/lib"
overwrite="true">
+ <fileset dir="${int.jboss42.dir}/output/lib">
+ <include name="jbossws-jboss42.jar"/>
+ </fileset>
<fileset dir="${core.dir}/output/lib">
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
@@ -149,6 +156,7 @@
<include name="jbossws-spi.jar"/>
</fileset>
<fileset
dir="${jboss42.home}/server/${jboss.server.instance}/lib">
+ <include name="jbossws-jboss42.jar"/>
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
Modified: trunk/integration/jbws/build.xml
===================================================================
--- trunk/integration/jbws/build.xml 2007-05-22 19:17:16 UTC (rev 3194)
+++ trunk/integration/jbws/build.xml 2007-05-22 19:32:06 UTC (rev 3195)
@@ -135,9 +135,6 @@
<!-- Build jbossws-jbws50.deployer -->
<zip zipfile="${jbws.output.lib.dir}/jbossws-jbws50-deployer.zip">
- <fileset dir="${int.jboss50.dir}/output/lib">
- <include name="jbossws-jboss50.jar"/>
- </fileset>
<fileset dir="${jbws.resources.dir}/jbossws-jboss50.deployer">
<include name="META-INF/jbossws-deployer-beans.xml"/>
</fileset>
@@ -156,9 +153,6 @@
<!-- Build jbossws-jbws42.sar -->
<jar jarfile="${jbws.output.lib.dir}/jbossws-jbws42.sar"
manifest="${jbws.output.etc.dir}/default.mf">
- <fileset dir="${int.jboss42.dir}/output/lib">
- <include name="jbossws-jboss42.jar"/>
- </fileset>
<fileset dir="${jbws.output.lib.dir}">
<include name="jbossws-context.war"/>
</fileset>
Copied:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptor.java
(from rev 3187,
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAssociationAdaptor.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptor.java
(rev 0)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptor.java 2007-05-22
19:32:06 UTC (rev 3195)
@@ -0,0 +1,41 @@
+/*
+* 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.spi.invocation;
+
+// $Id$
+
+import java.security.Principal;
+
+/**
+ * A container idependent security adaptor
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-May-2005
+ */
+public interface SecurityAdaptor
+{
+ Principal getPrincipal();
+ void setPrincipal(Principal pricipal);
+
+ Object getCredential();
+ void setCredential(Object credential);
+}
Added:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptorFactory.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptorFactory.java
(rev 0)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptorFactory.java 2007-05-22
19:32:06 UTC (rev 3195)
@@ -0,0 +1,44 @@
+/*
+ * 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.spi.invocation;
+
+// $Id$
+
+import org.jboss.wsf.spi.utils.FactoryLoader;
+
+/**
+ * A container idependent SecurityAdaptorFactory
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-May-2005
+ */
+public final class SecurityAdaptorFactory
+{
+ public static SecurityAdaptor getSecurityAdaptor()
+ {
+ SecurityAdaptor securityAdaptor =
(SecurityAdaptor)FactoryLoader.loadFactory(SecurityAdaptor.class.getName(), null);
+ if (securityAdaptor == null)
+ throw new IllegalStateException("Cannot load SecurityAdaptor");
+
+ return securityAdaptor;
+ }
+}
Property changes on:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptorFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAssociationAdaptor.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAssociationAdaptor.java 2007-05-22
19:17:16 UTC (rev 3194)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAssociationAdaptor.java 2007-05-22
19:32:06 UTC (rev 3195)
@@ -1,38 +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.spi.invocation;
-
-// $Id$
-
-import java.security.Principal;
-
-/**
- * A container idependent security adaptor
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-May-2005
- */
-public interface SecurityAssociationAdaptor
-{
- void setPrincipal(Principal pricipal);
- void setCredential(Object credential);
-}
Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/utils/FactoryLoader.java
(from rev 3187, trunk/jbossws-core/src/main/java/javax/xml/soap/FactoryLoader.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/utils/FactoryLoader.java
(rev 0)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/utils/FactoryLoader.java 2007-05-22
19:32:06 UTC (rev 3195)
@@ -0,0 +1,197 @@
+/*
+ * 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.spi.utils;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Properties;
+
+import org.jboss.logging.Logger;
+
+// $Id$
+
+/**
+ * Load a factory using the factory lookup procedure
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 14-Dec-2006
+ */
+public class FactoryLoader
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(FactoryLoader.class);
+
+ private FactoryLoader()
+ {
+ }
+
+ /**
+ * Load a factory using this ordered lookup procedure
+ *
+ * 1. Use the system property
+ * 2. Use the properties file "lib/jaxm.properties" in the JRE directory
+ * 3. Use the Services API (as detailed in the JAR specification), if available, to
determine the classname
+ * 4. Use the default factory implementation class
+ *
+ * @return the factory impl, or null
+ */
+ public static Object loadFactory(String propertyName, String defaultFactory)
+ {
+ Object factory = null;
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+ // Use the system property
+ PrivilegedAction action = new PropertyAccessAction(propertyName);
+ String factoryName = (String)AccessController.doPrivileged(action);
+ if (factoryName != null)
+ {
+ try
+ {
+ if(log.isDebugEnabled()) log.debug("Load from system property: " +
factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName +
": " + factoryName, t);
+ }
+ }
+
+ // Use the properties file "lib/jaxm.properties" in the JRE directory.
+ // This configuration file is in standard java.util.Properties format and contains
the fully qualified name of the implementation class with the key being the system
property defined above.
+ if (factory == null)
+ {
+ action = new PropertyAccessAction("java.home");
+ String javaHome = (String)AccessController.doPrivileged(action);
+ File jaxmFile = new File(javaHome + "/lib/jaxm.properties");
+ if (jaxmFile.exists())
+ {
+ try
+ {
+ action = new PropertyFileAccessAction(jaxmFile.getCanonicalPath());
+ Properties jaxmProperties =
(Properties)AccessController.doPrivileged(action);
+ factoryName = jaxmProperties.getProperty(propertyName);
+ if (factoryName != null)
+ {
+ if(log.isDebugEnabled()) log.debug("Load from " + jaxmFile +
": " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName
+ ": " + factoryName, t);
+ }
+ }
+ }
+
+ // Use the Services API (as detailed in the JAR specification), if available, to
determine the classname.
+ if (factory == null)
+ {
+ String filename = "META-INF/services/" + propertyName;
+ InputStream inStream = loader.getResourceAsStream(filename);
+ if (inStream != null)
+ {
+ try
+ {
+ BufferedReader br = new BufferedReader(new InputStreamReader(inStream,
"UTF-8"));
+ factoryName = br.readLine();
+ br.close();
+ if (factoryName != null)
+ {
+ if(log.isTraceEnabled()) log.trace("Load from Service API " +
filename + ": " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName
+ ": " + factoryName, t);
+ }
+ }
+ }
+
+ // Use the default factory implementation class.
+ if (factory == null && defaultFactory != null)
+ {
+ try
+ {
+ factoryName = defaultFactory;
+ if(log.isDebugEnabled()) log.debug("Load from default: " +
factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName +
": " + factoryName, t);
+ }
+ }
+
+ return factory;
+ }
+
+ private static class PropertyAccessAction implements PrivilegedAction
+ {
+ private String name;
+
+ PropertyAccessAction(String name)
+ {
+ this.name = name;
+ }
+
+ public Object run()
+ {
+ return System.getProperty(name);
+ }
+ }
+
+ private static class PropertyFileAccessAction implements PrivilegedAction
+ {
+ private String filename;
+
+ PropertyFileAccessAction(String filename)
+ {
+ this.filename = filename;
+ }
+
+ public Object run()
+ {
+ try
+ {
+ InputStream inStream = new FileInputStream(filename);
+ Properties props = new Properties();
+ props.load(inStream);
+ return props;
+ }
+ catch (IOException ex)
+ {
+ throw new SecurityException("Cannot load properties: " + filename,
ex);
+ }
+ }
+ }
+}
Modified: trunk/jbossws-core/ant-import-tests/build-testsuite.xml
===================================================================
--- trunk/jbossws-core/ant-import-tests/build-testsuite.xml 2007-05-22 19:17:16 UTC (rev
3194)
+++ trunk/jbossws-core/ant-import-tests/build-testsuite.xml 2007-05-22 19:32:06 UTC (rev
3195)
@@ -34,7 +34,6 @@
<pathelement location="${core.dir}/output/lib/jboss-saaj.jar"/>
<pathelement location="${core.dir}/output/lib/jbossws-core.jar"/>
<pathelement
location="${core.dir}/output/lib/jbossws-client.jar"/>
- <pathelement
location="${core.dir}/../jbws-${jbossws.integration.target}/output/lib/jbossws-${jbossws.integration.target}.jar"/>
</path>
<!-- The combined compile classpath -->
@@ -64,6 +63,7 @@
<pathelement location="${jboss.server.lib}/hibernate3.jar"/>
<pathelement location="${jboss.server.lib}/jboss.jar"/>
<pathelement location="${jboss.server.lib}/jbosssx.jar"/>
+ <pathelement
location="${jboss.server.lib}/jbossws-${jbossws.integration.target}.jar"/>
<pathelement
location="${jboss.server.deploy}/juddi-service.sar/juddi.jar"/>
<pathelement
location="${jboss.server.deploy}/juddi-service.sar/juddi-saaj.jar"/>
<pathelement
location="${jboss.server.deploy}/juddi-service.sar/scout.jar"/>
Deleted: trunk/jbossws-core/src/main/java/javax/xml/soap/FactoryLoader.java
===================================================================
--- trunk/jbossws-core/src/main/java/javax/xml/soap/FactoryLoader.java 2007-05-22 19:17:16
UTC (rev 3194)
+++ trunk/jbossws-core/src/main/java/javax/xml/soap/FactoryLoader.java 2007-05-22 19:32:06
UTC (rev 3195)
@@ -1,197 +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 javax.xml.soap;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Properties;
-
-import org.jboss.logging.Logger;
-
-// $Id$
-
-/**
- * Load a factory using the factory lookup procedure
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 14-Dec-2006
- */
-public class FactoryLoader
-{
- // provide logging
- private static Logger log = Logger.getLogger(FactoryLoader.class);
-
- private FactoryLoader()
- {
- }
-
- /**
- * Load a factory using this ordered lookup procedure
- *
- * 1. Use the system property
- * 2. Use the properties file "lib/jaxm.properties" in the JRE directory
- * 3. Use the Services API (as detailed in the JAR specification), if available, to
determine the classname
- * 4. Use the default factory implementation class
- *
- * @return the factory impl, or null
- */
- public static Object loadFactory(String propertyName, String defaultFactory)
- {
- Object factory = null;
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
-
- // Use the system property
- PrivilegedAction action = new PropertyAccessAction(propertyName);
- String factoryName = (String)AccessController.doPrivileged(action);
- if (factoryName != null)
- {
- try
- {
- if(log.isDebugEnabled()) log.debug("Load from system property: " +
factoryName);
- Class factoryClass = loader.loadClass(factoryName);
- factory = factoryClass.newInstance();
- }
- catch (Throwable t)
- {
- throw new IllegalStateException("Failed to load " + propertyName +
": " + factoryName, t);
- }
- }
-
- // Use the properties file "lib/jaxm.properties" in the JRE directory.
- // This configuration file is in standard java.util.Properties format and contains
the fully qualified name of the implementation class with the key being the system
property defined above.
- if (factory == null)
- {
- action = new PropertyAccessAction("java.home");
- String javaHome = (String)AccessController.doPrivileged(action);
- File jaxmFile = new File(javaHome + "/lib/jaxm.properties");
- if (jaxmFile.exists())
- {
- try
- {
- action = new PropertyFileAccessAction(jaxmFile.getCanonicalPath());
- Properties jaxmProperties =
(Properties)AccessController.doPrivileged(action);
- factoryName = jaxmProperties.getProperty(propertyName);
- if (factoryName != null)
- {
- if(log.isDebugEnabled()) log.debug("Load from " + jaxmFile +
": " + factoryName);
- Class factoryClass = loader.loadClass(factoryName);
- factory = factoryClass.newInstance();
- }
- }
- catch (Throwable t)
- {
- throw new IllegalStateException("Failed to load " + propertyName
+ ": " + factoryName, t);
- }
- }
- }
-
- // Use the Services API (as detailed in the JAR specification), if available, to
determine the classname.
- if (factory == null)
- {
- String filename = "META-INF/services/" + propertyName;
- InputStream inStream = loader.getResourceAsStream(filename);
- if (inStream != null)
- {
- try
- {
- BufferedReader br = new BufferedReader(new InputStreamReader(inStream,
"UTF-8"));
- factoryName = br.readLine();
- br.close();
- if (factoryName != null)
- {
- if(log.isTraceEnabled()) log.trace("Load from Service API " +
filename + ": " + factoryName);
- Class factoryClass = loader.loadClass(factoryName);
- factory = factoryClass.newInstance();
- }
- }
- catch (Throwable t)
- {
- throw new IllegalStateException("Failed to load " + propertyName
+ ": " + factoryName, t);
- }
- }
- }
-
- // Use the default factory implementation class.
- if (factory == null && defaultFactory != null)
- {
- try
- {
- factoryName = defaultFactory;
- if(log.isDebugEnabled()) log.debug("Load from default: " +
factoryName);
- Class factoryClass = loader.loadClass(factoryName);
- factory = factoryClass.newInstance();
- }
- catch (Throwable t)
- {
- throw new IllegalStateException("Failed to load " + propertyName +
": " + factoryName, t);
- }
- }
-
- return factory;
- }
-
- private static class PropertyAccessAction implements PrivilegedAction
- {
- private String name;
-
- PropertyAccessAction(String name)
- {
- this.name = name;
- }
-
- public Object run()
- {
- return System.getProperty(name);
- }
- }
-
- private static class PropertyFileAccessAction implements PrivilegedAction
- {
- private String filename;
-
- PropertyFileAccessAction(String filename)
- {
- this.filename = filename;
- }
-
- public Object run()
- {
- try
- {
- InputStream inStream = new FileInputStream(filename);
- Properties props = new Properties();
- props.load(inStream);
- return props;
- }
- catch (IOException ex)
- {
- throw new SecurityException("Cannot load properties: " + filename,
ex);
- }
- }
- }
-}
Modified: trunk/jbossws-core/src/main/java/javax/xml/soap/MessageFactory.java
===================================================================
--- trunk/jbossws-core/src/main/java/javax/xml/soap/MessageFactory.java 2007-05-22
19:17:16 UTC (rev 3194)
+++ trunk/jbossws-core/src/main/java/javax/xml/soap/MessageFactory.java 2007-05-22
19:32:06 UTC (rev 3195)
@@ -24,6 +24,8 @@
import java.io.IOException;
import java.io.InputStream;
+import org.jboss.wsf.spi.utils.FactoryLoader;
+
/**
A factory for creating SOAPMessage objects.
Modified: trunk/jbossws-core/src/main/java/javax/xml/soap/SAAJMetaFactory.java
===================================================================
--- trunk/jbossws-core/src/main/java/javax/xml/soap/SAAJMetaFactory.java 2007-05-22
19:17:16 UTC (rev 3194)
+++ trunk/jbossws-core/src/main/java/javax/xml/soap/SAAJMetaFactory.java 2007-05-22
19:32:06 UTC (rev 3195)
@@ -21,7 +21,9 @@
*/
package javax.xml.soap;
+import org.jboss.wsf.spi.utils.FactoryLoader;
+
// $Id$
/**
Modified: trunk/jbossws-core/src/main/java/javax/xml/soap/SOAPFactory.java
===================================================================
--- trunk/jbossws-core/src/main/java/javax/xml/soap/SOAPFactory.java 2007-05-22 19:17:16
UTC (rev 3194)
+++ trunk/jbossws-core/src/main/java/javax/xml/soap/SOAPFactory.java 2007-05-22 19:32:06
UTC (rev 3195)
@@ -25,6 +25,7 @@
import javax.xml.namespace.QName;
+import org.jboss.wsf.spi.utils.FactoryLoader;
import org.w3c.dom.Element;
/** SOAPFactory is a factory for creating various objects that exist in the SOAP XML
tree.
Modified: trunk/jbossws-core/src/main/java/javax/xml/ws/spi/Provider.java
===================================================================
--- trunk/jbossws-core/src/main/java/javax/xml/ws/spi/Provider.java 2007-05-22 19:17:16
UTC (rev 3194)
+++ trunk/jbossws-core/src/main/java/javax/xml/ws/spi/Provider.java 2007-05-22 19:32:06
UTC (rev 3195)
@@ -26,7 +26,6 @@
import java.util.List;
import javax.xml.namespace.QName;
-import javax.xml.soap.FactoryLoader;
import javax.xml.transform.Source;
import javax.xml.ws.Endpoint;
import javax.xml.ws.EndpointReference;
@@ -34,6 +33,7 @@
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import org.jboss.wsf.spi.utils.FactoryLoader;
import org.w3c.dom.Element;
/**
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/HttpServer.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/HttpServer.java 2007-05-22
19:17:16 UTC (rev 3194)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/HttpServer.java 2007-05-22
19:32:06 UTC (rev 3195)
@@ -26,9 +26,10 @@
import java.util.HashMap;
import java.util.Map;
-import javax.xml.soap.FactoryLoader;
import javax.xml.ws.Endpoint;
+import org.jboss.wsf.spi.utils.FactoryLoader;
+
/**
* An abstract HTTP Server
*
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java 2007-05-22
19:17:16 UTC (rev 3194)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java 2007-05-22
19:32:06 UTC (rev 3195)
@@ -23,12 +23,11 @@
// $Id$
-import javax.xml.soap.FactoryLoader;
-
import org.jboss.ws.extensions.security.element.SecurityHeader;
import org.jboss.ws.extensions.security.element.Token;
import org.jboss.ws.extensions.security.element.UsernameToken;
-import org.jboss.wsf.spi.invocation.SecurityAssociationAdaptor;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
import org.w3c.dom.Document;
public class ReceiveUsernameOperation implements TokenOperation
@@ -45,12 +44,7 @@
public void process(Document message, Token token) throws WSSecurityException
{
UsernameToken user = (UsernameToken)token;
- String propName = SecurityAssociationAdaptor.class.getName();
-
- SecurityAssociationAdaptor securityAdaptor =
(SecurityAssociationAdaptor)FactoryLoader.loadFactory(propName, null);
- if (securityAdaptor == null)
- throw new WSSecurityException("Cannot load: " + propName);
-
+ SecurityAdaptor securityAdaptor = SecurityAdaptorFactory.getSecurityAdaptor();
securityAdaptor.setPrincipal(new SimplePrincipal(user.getUsername()));
securityAdaptor.setCredential(user.getPassword());
}