JBossWS SVN: r12503 - in stack/native/branches/dlofthouse/JBPAPP-4447/src: test/java/org/jboss/test/ws/jaxws/jbws1988 and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2010-06-18 08:53:20 -0400 (Fri, 18 Jun 2010)
New Revision: 12503
Modified:
stack/native/branches/dlofthouse/JBPAPP-4447/src/main/java/org/jboss/ws/extensions/security/auth/callback/UsernameTokenCallback.java
stack/native/branches/dlofthouse/JBPAPP-4447/src/test/java/org/jboss/test/ws/jaxws/jbws1988/DigestTestCase.java
Log:
Corrected format of nonce used to generate digest.
Modified: stack/native/branches/dlofthouse/JBPAPP-4447/src/main/java/org/jboss/ws/extensions/security/auth/callback/UsernameTokenCallback.java
===================================================================
--- stack/native/branches/dlofthouse/JBPAPP-4447/src/main/java/org/jboss/ws/extensions/security/auth/callback/UsernameTokenCallback.java 2010-06-18 12:46:49 UTC (rev 12502)
+++ stack/native/branches/dlofthouse/JBPAPP-4447/src/main/java/org/jboss/ws/extensions/security/auth/callback/UsernameTokenCallback.java 2010-06-18 12:53:20 UTC (rev 12503)
@@ -34,6 +34,7 @@
import org.jboss.crypto.digest.DigestCallback;
import org.jboss.security.Base64Encoder;
import org.jboss.security.auth.callback.MapCallback;
+import org.jboss.util.Base64;
import org.jboss.ws.WSException;
/**
@@ -68,7 +69,10 @@
{
String nonce = (String)info.getInfo(NONCE);
if (nonce != null)
- digest.update(nonce.getBytes("UTF-8"));
+ {
+ byte[] rawNonce = Base64.decode(nonce);
+ digest.update(rawNonce);
+ }
String created = (String)info.getInfo(CREATED);
if (created != null)
digest.update(created.getBytes("UTF-8"));
Modified: stack/native/branches/dlofthouse/JBPAPP-4447/src/test/java/org/jboss/test/ws/jaxws/jbws1988/DigestTestCase.java
===================================================================
--- stack/native/branches/dlofthouse/JBPAPP-4447/src/test/java/org/jboss/test/ws/jaxws/jbws1988/DigestTestCase.java 2010-06-18 12:46:49 UTC (rev 12502)
+++ stack/native/branches/dlofthouse/JBPAPP-4447/src/test/java/org/jboss/test/ws/jaxws/jbws1988/DigestTestCase.java 2010-06-18 12:53:20 UTC (rev 12503)
@@ -37,14 +37,14 @@
String password = "taadtaadpstcsm";
String nonce = "d36e316282959a9ed4c89851497a717f";
String created = "2003-12-15T14:43:07Z";
- String expectedDigest = "quR/EWLAV4xLf9Zqyw4pDmfV9OY=";
+ String expectedDigest = "0WSAldY9ogqqVyQo7ubbZxxFU/s=";
String digest = SendUsernameOperation.createPasswordDigest(nonce, created, password);
assertEquals(expectedDigest, digest);
password = "therealfrog";
nonce = "gHGIdDEWjX1Ay/LiVd3qJ1ua8VbjXis8CJwNDQh1ySA=";
created = "2008-03-12T17:12:31.310Z";
- expectedDigest = "IEeuDaP/NTozwiyJHzTgBoCCDjg=";
+ expectedDigest = "gx8TcJ9VG2hOFC6ZFmNi/JI2rh4=";
digest = SendUsernameOperation.createPasswordDigest(nonce, created, password);
assertEquals(expectedDigest, digest);
}
@@ -53,7 +53,7 @@
{
String password = "therealfrog";
String nonce = "gHGIdDEWjX1Ay/LiVd3qJ1ua8VbjXis8CJwNDQh1ySA=";
- String expectedDigest = "sdA2umjMZQEY2ejbt5L6WbJOrB0=";
+ String expectedDigest = "MBqDfskkdh3eEtRlLdkWa79+w58=";
String digest = SendUsernameOperation.createPasswordDigest(nonce, null, password);
assertEquals(expectedDigest, digest);
}
13 years, 10 months
JBossWS SVN: r12502 - in stack/native/trunk/modules: testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1988 and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2010-06-18 08:46:49 -0400 (Fri, 18 Jun 2010)
New Revision: 12502
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/auth/callback/UsernameTokenCallback.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1988/DigestTestCase.java
Log:
[JBWS-3014] Use raw nonce instead of Base64 encoded nonce when generating password digest.
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/auth/callback/UsernameTokenCallback.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/auth/callback/UsernameTokenCallback.java 2010-06-18 11:31:50 UTC (rev 12501)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/auth/callback/UsernameTokenCallback.java 2010-06-18 12:46:49 UTC (rev 12502)
@@ -32,6 +32,7 @@
import org.jboss.crypto.digest.DigestCallback;
import org.jboss.security.Base64Encoder;
import org.jboss.security.auth.callback.MapCallback;
+import org.jboss.util.Base64;
import org.jboss.ws.WSException;
/**
@@ -64,7 +65,10 @@
{
String nonce = (String)info.getInfo(NONCE);
if (nonce != null)
- digest.update(nonce.getBytes("UTF-8"));
+ {
+ byte[] rawNonce = Base64.decode(nonce);
+ digest.update(rawNonce);
+ }
String created = (String)info.getInfo(CREATED);
if (created != null)
digest.update(created.getBytes("UTF-8"));
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1988/DigestTestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1988/DigestTestCase.java 2010-06-18 11:31:50 UTC (rev 12501)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1988/DigestTestCase.java 2010-06-18 12:46:49 UTC (rev 12502)
@@ -37,14 +37,14 @@
String password = "taadtaadpstcsm";
String nonce = "d36e316282959a9ed4c89851497a717f";
String created = "2003-12-15T14:43:07Z";
- String expectedDigest = "quR/EWLAV4xLf9Zqyw4pDmfV9OY=";
+ String expectedDigest = "0WSAldY9ogqqVyQo7ubbZxxFU/s=";
String digest = SendUsernameOperation.createPasswordDigest(nonce, created, password);
assertEquals(expectedDigest, digest);
password = "therealfrog";
nonce = "gHGIdDEWjX1Ay/LiVd3qJ1ua8VbjXis8CJwNDQh1ySA=";
created = "2008-03-12T17:12:31.310Z";
- expectedDigest = "IEeuDaP/NTozwiyJHzTgBoCCDjg=";
+ expectedDigest = "gx8TcJ9VG2hOFC6ZFmNi/JI2rh4=";
digest = SendUsernameOperation.createPasswordDigest(nonce, created, password);
assertEquals(expectedDigest, digest);
}
@@ -53,7 +53,7 @@
{
String password = "therealfrog";
String nonce = "gHGIdDEWjX1Ay/LiVd3qJ1ua8VbjXis8CJwNDQh1ySA=";
- String expectedDigest = "sdA2umjMZQEY2ejbt5L6WbJOrB0=";
+ String expectedDigest = "MBqDfskkdh3eEtRlLdkWa79+w58=";
String digest = SendUsernameOperation.createPasswordDigest(nonce, null, password);
assertEquals(expectedDigest, digest);
}
13 years, 10 months
JBossWS SVN: r12501 - common/branches/dlofthouse/cached_db/src/main/java/org/jboss/wsf/common.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2010-06-18 07:31:50 -0400 (Fri, 18 Jun 2010)
New Revision: 12501
Modified:
common/branches/dlofthouse/cached_db/src/main/java/org/jboss/wsf/common/DOMUtils.java
Log:
Here is the prototype
Modified: common/branches/dlofthouse/cached_db/src/main/java/org/jboss/wsf/common/DOMUtils.java
===================================================================
--- common/branches/dlofthouse/cached_db/src/main/java/org/jboss/wsf/common/DOMUtils.java 2010-06-18 11:30:42 UTC (rev 12500)
+++ common/branches/dlofthouse/cached_db/src/main/java/org/jboss/wsf/common/DOMUtils.java 2010-06-18 11:31:50 UTC (rev 12501)
@@ -83,6 +83,43 @@
// All elements created by the same thread are created by the same builder and belong to the same doc
private static ThreadLocal<Document> documentThreadLocal = new ThreadLocal<Document>();
+
+ private static ThreadLocal<EntityResolver> entityResolver = new ThreadLocal<EntityResolver>() {
+ protected EntityResolver initialValue()
+ {
+ EntityResolver entityResolver = null;
+ try
+ {
+ entityResolver = new JBossWSEntityResolver();
+ }
+ catch (Throwable t)
+ {
+ boolean debugEnabled = log.isDebugEnabled();
+ if (debugEnabled)
+ log.debug("Cannot load: " + JBossWSEntityResolver.class.getCanonicalName());
+ String[] resolvers = new String[] { "org.jboss.util.xml.JBossEntityResolver" };
+ ClassLoader loader = SecurityActions.getContextClassLoader();
+ for (String resolver : resolvers)
+ {
+ try
+ {
+ Class<?> resolverClass = SecurityActions.loadClass(loader, resolver);
+ entityResolver = (EntityResolver)resolverClass.newInstance();
+ break;
+ }
+ catch (Exception ex)
+ {
+ if (debugEnabled)
+ log.debug("Cannot load: " + resolver);
+ }
+ }
+ }
+
+ return entityResolver;
+ }
+
+ };
+
private static ThreadLocal<DocumentBuilder> builderThreadLocal = new ThreadLocal<DocumentBuilder>() {
protected DocumentBuilder initialValue()
{
@@ -133,46 +170,16 @@
throw new RuntimeException("Unable to create document builder", e);
}
}
-
- @SuppressWarnings("deprecation")
- private void setEntityResolver(DocumentBuilder builder)
- {
- EntityResolver entityResolver = null;
- try
- {
- entityResolver = new JBossWSEntityResolver();
- }
- catch (Throwable t)
- {
- boolean debugEnabled = log.isDebugEnabled();
- if (debugEnabled)
- log.debug("Cannot load: " + JBossWSEntityResolver.class.getCanonicalName());
- String[] resolvers = new String[] { "org.jboss.util.xml.JBossEntityResolver" };
- ClassLoader loader = SecurityActions.getContextClassLoader();
- for (String resolver : resolvers)
- {
- try
- {
- Class<?> resolverClass = SecurityActions.loadClass(loader, resolver);
- entityResolver = (EntityResolver)resolverClass.newInstance();
- break;
- }
- catch (Exception ex)
- {
- if (debugEnabled)
- log.debug("Cannot load: " + resolver);
- }
- }
- }
- if (entityResolver != null)
- builder.setEntityResolver(entityResolver);
- }
+
+
};
public static void clearThreadLocals()
{
documentThreadLocal.remove();
- builderThreadLocal.remove();
+ DocumentBuilder documentBuilder = getDocumentBuilder();
+ documentBuilder.reset();
+ setEntityResolver(documentBuilder);
}
// Hide the constructor
@@ -186,7 +193,19 @@
{
return builderThreadLocal.get();
}
+
+ private static EntityResolver getEntityResolver()
+ {
+ return entityResolver.get();
+ }
+ private static void setEntityResolver(DocumentBuilder builder)
+ {
+ EntityResolver entityResolver = getEntityResolver();
+ if (entityResolver != null)
+ builder.setEntityResolver(entityResolver);
+ }
+
/** Parse the given XML string and return the root Element
*/
public static Element parse(String xmlString) throws IOException
13 years, 10 months
JBossWS SVN: r12500 - common/branches/dlofthouse.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2010-06-18 07:30:42 -0400 (Fri, 18 Jun 2010)
New Revision: 12500
Added:
common/branches/dlofthouse/cached_db/
Log:
Prototype caching the document builder
Copied: common/branches/dlofthouse/cached_db (from rev 12499, common/trunk)
13 years, 10 months
JBossWS SVN: r12499 - in stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws: extensions/security/jaxrpc and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2010-06-18 07:06:21 -0400 (Fri, 18 Jun 2010)
New Revision: 12499
Modified:
stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java
stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerInbound.java
stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Config.java
stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Encrypt.java
stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/RequireEncryption.java
stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/RequireSignature.java
stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Requires.java
stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Sign.java
stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
Log:
Round 1 of backports
Modified: stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2010-06-18 11:04:04 UTC (rev 12498)
+++ stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2010-06-18 11:06:21 UTC (rev 12499)
@@ -84,13 +84,10 @@
QName secQName = new QName(Constants.WSSE_NS, "Security");
Element secHeaderElement = (soapHeader != null) ? Util.findElement(soapHeader, secQName) : null;
+ boolean fault = message.getSOAPBody().getFault() != null;
if (secHeaderElement == null)
{
- // This is ok, we always allow faults to be received because WS-Security does not encrypt faults
- if (message.getSOAPBody().getFault() != null)
- return;
-
- if (hasRequirements(config))
+ if (hasRequirements(config, fault))
throw convertToFault(new InvalidSecurityHeaderException("This service requires <wsse:Security>, which is missing."));
}
@@ -98,7 +95,7 @@
{
if (secHeaderElement != null)
{
- decodeHeader(configuration, config, message, secHeaderElement);
+ decodeHeader(configuration, config, message, secHeaderElement, fault);
}
authorize(config);
@@ -115,7 +112,7 @@
}
- private void decodeHeader(WSSecurityConfiguration configuration, Config config, SOAPMessage message, Element secHeaderElement) throws WSSecurityException
+ private void decodeHeader(WSSecurityConfiguration configuration, Config config, SOAPMessage message, Element secHeaderElement, boolean fault) throws WSSecurityException
{
SecurityStore securityStore = new SecurityStore(configuration.getKeyStoreURL(), configuration.getKeyStoreType(), configuration.getKeyStorePassword(),
configuration.getKeyPasswords(), configuration.getTrustStoreURL(), configuration.getTrustStoreType(), configuration.getTrustStorePassword());
@@ -135,7 +132,7 @@
if (log.isTraceEnabled())
log.trace("Decoded Message:\n" + DOMWriter.printNode(message.getSOAPPart(), true));
- List<RequireOperation> operations = buildRequireOperations(config);
+ List<RequireOperation> operations = buildRequireOperations(config, fault);
decoder.verify(operations);
if (log.isDebugEnabled())
@@ -163,10 +160,11 @@
if (log.isDebugEnabled())
log.debug("WS-Security config: " + config);
+ boolean fault = message.getSOAPBody().getFault() != null;
// Nothing to process
- if (config == null)
+ if (config == null || (fault && !config.includesFaults()))
return;
-
+
ArrayList<EncodingOperation> operations = new ArrayList<EncodingOperation>();
Timestamp timestamp = config.getTimestamp();
if (timestamp != null)
@@ -182,7 +180,7 @@
}
Sign sign = config.getSign();
- if (sign != null)
+ if (sign != null && (!fault || sign.isIncludeFaults()))
{
List<Target> targets = convertTargets(sign.getTargets());
if (sign.isIncludeTimestamp())
@@ -198,7 +196,7 @@
}
Encrypt encrypt = config.getEncrypt();
- if (encrypt != null)
+ if (encrypt != null && (!fault || encrypt.isIncludeFaults()))
{
List<Target> targets = convertTargets(encrypt.getTargets());
operations.add(new EncryptionOperation(targets, encrypt.getAlias(), encrypt.getAlgorithm(), encrypt.getWrap(), encrypt.getTokenRefType()));
@@ -270,7 +268,7 @@
return new CommonSOAPFaultException(e.getFaultCode(), e.getFaultString());
}
- private List<RequireOperation> buildRequireOperations(Config operationConfig)
+ private List<RequireOperation> buildRequireOperations(Config operationConfig, boolean fault)
{
if (operationConfig == null)
return null;
@@ -285,14 +283,14 @@
operations.add(new RequireTimestampOperation(requireTimestamp.getMaxAge()));
RequireSignature requireSignature = requires.getRequireSignature();
- if (requireSignature != null)
+ if (requireSignature != null && (!fault || requireSignature.isIncludeFaults()))
{
List<Target> targets = convertTargets(requireSignature.getTargets());
operations.add(new RequireSignatureOperation(targets));
- }
+ }
RequireEncryption requireEncryption = requires.getRequireEncryption();
- if (requireEncryption != null)
+ if (requireEncryption != null && (!fault || requireEncryption.isIncludeFaults()))
{
List<Target> targets = convertTargets(requireEncryption.getTargets());
operations.add(new RequireEncryptionOperation(targets));
@@ -354,8 +352,9 @@
return operation.getConfig();
}
- private boolean hasRequirements(Config config)
+ private boolean hasRequirements(Config config, boolean fault)
{
- return config != null && config.getRequires() != null;
+ Requires requires = (config != null) ? config.getRequires() : null;
+ return requires != null && (!fault || requires.includesFaults());
}
}
Modified: stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java 2010-06-18 11:04:04 UTC (rev 12498)
+++ stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java 2010-06-18 11:06:21 UTC (rev 12499)
@@ -27,11 +27,11 @@
import javax.xml.rpc.Stub;
import javax.xml.rpc.handler.GenericHandler;
import javax.xml.rpc.handler.MessageContext;
-import javax.xml.soap.SOAPException;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.CommonSOAPFaultException;
import org.jboss.ws.core.soap.SOAPMessageImpl;
import org.jboss.ws.extensions.security.Constants;
import org.jboss.ws.extensions.security.WSSecurityDispatcher;
@@ -52,13 +52,22 @@
// provide logging
private static Logger log = Logger.getLogger(WSSecurityHandler.class);
+ protected static final String FAULT_THROWN = "org.jboss.ws.wsse.faultThrown";
+
public QName[] getHeaders()
{
return new QName[] {Constants.WSSE_HEADER_QNAME};
}
+
+ protected boolean thrownByMe(MessageContext msgContext)
+ {
+ Boolean bool = (Boolean) msgContext.getProperty(FAULT_THROWN);
+ return bool != null && bool.booleanValue();
+ }
protected boolean handleInboundSecurity(MessageContext msgContext)
{
+ Exception exception = null;
try
{
WSSecurityConfiguration configuration = getSecurityConfiguration(msgContext);
@@ -70,16 +79,28 @@
new WSSecurityDispatcher().decodeMessage(configuration, soapMessage, null);
}
}
- catch (SOAPException ex)
+ catch (Exception ex)
{
- log.error("Cannot handle inbound ws-security", ex);
+ exception = ex;
+ }
+
+ if (exception != null)
+ {
+ msgContext.setProperty(FAULT_THROWN, true);
+ if (exception instanceof CommonSOAPFaultException)
+ throw (CommonSOAPFaultException)exception;
+
+ // Unexpected exception, log it
+ log.error("Cannot handle inbound ws-security", exception);
return false;
}
+
return true;
}
protected boolean handleOutboundSecurity(MessageContext msgContext)
{
+ Exception exception = null;
try
{
WSSecurityConfiguration configuration = getSecurityConfiguration(msgContext);
@@ -93,11 +114,22 @@
new WSSecurityDispatcher().encodeMessage(configuration, soapMessage, null, user, pass);
}
}
- catch (SOAPException ex)
+ catch (Exception ex)
{
- log.error("Cannot handle outbound ws-security", ex);
+ exception = ex;
+ }
+
+ if (exception != null)
+ {
+ msgContext.setProperty(FAULT_THROWN, true);
+ if (exception instanceof CommonSOAPFaultException)
+ throw (CommonSOAPFaultException)exception;
+
+ // Unexpected exception, log it
+ log.error("Cannot handle outbound ws-security", exception);
return false;
}
+
return true;
}
Modified: stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerInbound.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerInbound.java 2010-06-18 11:04:04 UTC (rev 12498)
+++ stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandlerInbound.java 2010-06-18 11:06:21 UTC (rev 12499)
@@ -22,6 +22,7 @@
package org.jboss.ws.extensions.security.jaxrpc;
import javax.xml.rpc.handler.MessageContext;
+import javax.xml.rpc.handler.soap.SOAPMessageContext;
import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
@@ -43,7 +44,19 @@
{
return handleOutboundSecurity(msgContext);
}
+
+ public boolean handleFault(MessageContext msgContext)
+ {
+ // Skip any WS-Security Faults
+ if (thrownByMe(msgContext))
+ return true;
+ // Mark the message as a fault, in case it ends up being encrypted
+ ((SOAPMessageContext)msgContext).getMessage().setFaultMessage(true);
+
+ return handleOutboundSecurity(msgContext);
+ }
+
protected String getConfigResourceName() {
return WSSecurityOMFactory.SERVER_RESOURCE_NAME;
}
Modified: stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Config.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Config.java 2010-06-18 11:04:04 UTC (rev 12498)
+++ stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Config.java 2010-06-18 11:06:21 UTC (rev 12499)
@@ -75,6 +75,11 @@
return username;
}
+ public boolean includesFaults()
+ {
+ return (sign != null && sign.isIncludeFaults()) || (encrypt != null && encrypt.isIncludeFaults());
+ }
+
public void setUsername(Username username)
{
this.username = username;
Modified: stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Encrypt.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Encrypt.java 2010-06-18 11:04:04 UTC (rev 12498)
+++ stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Encrypt.java 2010-06-18 11:06:21 UTC (rev 12499)
@@ -38,14 +38,16 @@
private String algorithm;
private String keyWrapAlgorithm;
private String tokenRefType;
+ private boolean includeFaults;
- public Encrypt(String type, String alias, String algorithm, String wrap, String tokenRefType)
+ public Encrypt(String type, String alias, String algorithm, String wrap, String tokenRefType, boolean includeFaults)
{
this.type = type;
this.alias = alias;
this.algorithm = algorithm;
this.keyWrapAlgorithm = wrap;
this.tokenRefType = tokenRefType;
+ this.includeFaults = includeFaults;
}
public String getAlias()
@@ -97,4 +99,14 @@
{
this.tokenRefType = tokenRefType;
}
+
+ public boolean isIncludeFaults()
+ {
+ return includeFaults;
+ }
+
+ public void setIncludeFaults(boolean includeFaults)
+ {
+ this.includeFaults = includeFaults;
+ }
}
Modified: stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/RequireEncryption.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/RequireEncryption.java 2010-06-18 11:04:04 UTC (rev 12498)
+++ stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/RequireEncryption.java 2010-06-18 11:06:21 UTC (rev 12499)
@@ -30,4 +30,21 @@
public class RequireEncryption extends Targetable
{
private static final long serialVersionUID = 3765798680988205647L;
+
+ private boolean includeFaults;
+
+ public RequireEncryption(boolean includeFaults)
+ {
+ this.includeFaults = includeFaults;
+ }
+
+ public boolean isIncludeFaults()
+ {
+ return includeFaults;
+ }
+
+ public void setIncludeFaults(boolean includeFaults)
+ {
+ this.includeFaults = includeFaults;
+ }
}
Modified: stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/RequireSignature.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/RequireSignature.java 2010-06-18 11:04:04 UTC (rev 12498)
+++ stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/RequireSignature.java 2010-06-18 11:06:21 UTC (rev 12499)
@@ -22,12 +22,28 @@
package org.jboss.ws.metadata.wsse;
/**
- * <code>Sign</code> represents the sign tag, which declares that a message
- * should be signed.
+ * <code>RequireSignature</code> indicates that a message received from a peer must be signed.
*
* @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
*/
public class RequireSignature extends Targetable
{
private static final long serialVersionUID = -3854930944550152309L;
-}
+
+ private boolean includeFaults;
+
+ public RequireSignature(boolean includeFaults)
+ {
+ this.includeFaults = includeFaults;
+ }
+
+ public boolean isIncludeFaults()
+ {
+ return includeFaults;
+ }
+
+ public void setIncludeFaults(boolean includeFaults)
+ {
+ this.includeFaults = includeFaults;
+ }
+}
\ No newline at end of file
Modified: stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Requires.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Requires.java 2010-06-18 11:04:04 UTC (rev 12498)
+++ stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Requires.java 2010-06-18 11:06:21 UTC (rev 12499)
@@ -65,4 +65,10 @@
{
this.requireTimestamp = requireTimestamp;
}
+
+ public boolean includesFaults()
+ {
+ return (requireSignature != null && requireSignature.isIncludeFaults())
+ || (requireEncryption != null && requireEncryption.isIncludeFaults());
+ }
}
Modified: stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Sign.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Sign.java 2010-06-18 11:04:04 UTC (rev 12498)
+++ stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Sign.java 2010-06-18 11:06:21 UTC (rev 12499)
@@ -35,13 +35,15 @@
private String alias;
private boolean includeTimestamp;
private String tokenRefType;
+ private boolean includeFaults;
- public Sign(String type, String alias, boolean includeTimestamp, String tokenRefType)
+ public Sign(String type, String alias, boolean includeTimestamp, String tokenRefType, boolean includeFaults)
{
this.type = type;
this.alias = alias;
this.includeTimestamp = includeTimestamp;
this.tokenRefType = tokenRefType;
+ this.includeFaults = includeFaults;
}
public String getAlias()
@@ -59,6 +61,16 @@
return type;
}
+ public boolean isIncludeFaults()
+ {
+ return includeFaults;
+ }
+
+ public void setIncludeFaults(boolean includeFaults)
+ {
+ this.includeFaults = includeFaults;
+ }
+
public void setType(String type)
{
this.type = type;
Modified: stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java 2010-06-18 11:04:04 UTC (rev 12498)
+++ stack/native/branches/dlofthouse/JBWS-1119/modules/core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java 2010-06-18 11:06:21 UTC (rev 12499)
@@ -50,7 +50,7 @@
public static final String CLIENT_RESOURCE_NAME = "jboss-wsse-client.xml";
- private static HashMap options = new HashMap(7);
+ private static HashMap<String, String> options = new HashMap<String, String>(6);
static
{
@@ -93,6 +93,7 @@
}
catch (JBossXBException e)
{
+ log.error("Could not parse " + configURL + ":", e);
IOException ioex = new IOException("Cannot parse: " + configURL);
Throwable cause = e.getCause();
if (cause != null)
@@ -261,17 +262,26 @@
if ("sign".equals(localName))
{
// By default, we alwyas include a timestamp
- Boolean include = new Boolean(true);
- String timestamp = attrs.getValue("", "includeTimestamp");
- if (timestamp != null)
- include = (Boolean)SimpleTypeBindings.unmarshal(SimpleTypeBindings.XS_BOOLEAN_NAME, timestamp, null);
+ boolean includeTimestamp = true;
+ String value = attrs.getValue("", "includeTimestamp");
+ if (value != null)
+ includeTimestamp = (Boolean) SimpleTypeBindings.unmarshal(SimpleTypeBindings.XS_BOOLEAN_NAME, value, null);
- return new Sign(attrs.getValue("", "type"), attrs.getValue("", "alias"), include.booleanValue(), attrs.getValue("", "tokenReference"));
+ boolean includeFaults = false;
+ value = attrs.getValue("", "includeFaults");
+ if (value != null)
+ includeFaults = (Boolean) SimpleTypeBindings.unmarshal(SimpleTypeBindings.XS_BOOLEAN_NAME, value, null);
+
+ return new Sign(attrs.getValue("", "type"), attrs.getValue("", "alias"), includeTimestamp, attrs.getValue("", "tokenReference"), includeFaults);
}
else if ("encrypt".equals(localName))
{
- return new Encrypt(attrs.getValue("", "type"), attrs.getValue("", "alias"), attrs.getValue("", "algorithm"), attrs.getValue("", "keyWrapAlgorithm"), attrs
- .getValue("", "tokenReference"));
+ boolean includeFaults = false;
+ String value = attrs.getValue("", "includeFaults");
+ if (value != null)
+ includeFaults = (Boolean) SimpleTypeBindings.unmarshal(SimpleTypeBindings.XS_BOOLEAN_NAME, value, null);
+
+ return new Encrypt(attrs.getValue("", "type"), attrs.getValue("", "alias"), attrs.getValue("", "algorithm"), attrs.getValue("", "keyWrapAlgorithm"), attrs.getValue("", "tokenReference"),includeFaults);
}
else if ("timestamp".equals(localName))
{
@@ -452,11 +462,21 @@
log.trace("newChild: " + localName);
if ("signature".equals(localName))
{
- return new RequireSignature();
+ boolean includeFaults = false;
+ String value = attrs.getValue("", "includeFaults");
+ if (value != null)
+ includeFaults = (Boolean) SimpleTypeBindings.unmarshal(SimpleTypeBindings.XS_BOOLEAN_NAME, value, null);
+
+ return new RequireSignature(includeFaults);
}
else if ("encryption".equals(localName))
{
- return new RequireEncryption();
+ boolean includeFaults = false;
+ String value = attrs.getValue("", "includeFaults");
+ if (value != null)
+ includeFaults = (Boolean) SimpleTypeBindings.unmarshal(SimpleTypeBindings.XS_BOOLEAN_NAME, value, null);
+
+ return new RequireEncryption(includeFaults);
}
else if ("timestamp".equals(localName))
{
13 years, 10 months
JBossWS SVN: r12498 - stack/native/branches/dlofthouse.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2010-06-18 07:04:04 -0400 (Fri, 18 Jun 2010)
New Revision: 12498
Added:
stack/native/branches/dlofthouse/JBWS-1119/
Log:
Branch to work on backport.
Copied: stack/native/branches/dlofthouse/JBWS-1119 (from rev 12497, stack/native/trunk)
13 years, 10 months
JBossWS SVN: r12497 - in stack/cxf/branches/no-spring-support: modules/client and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-06-17 15:21:25 -0400 (Thu, 17 Jun 2010)
New Revision: 12497
Added:
stack/cxf/branches/no-spring-support/src/main/scripts/assembly-deploy-spring.xml
Modified:
stack/cxf/branches/no-spring-support/modules/client/pom.xml
stack/cxf/branches/no-spring-support/modules/server/pom.xml
stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/pom.xml
stack/cxf/branches/no-spring-support/modules/testsuite/framework-tests/pom.xml
stack/cxf/branches/no-spring-support/modules/testsuite/pom.xml
stack/cxf/branches/no-spring-support/pom.xml
stack/cxf/branches/no-spring-support/src/main/scripts/assembly-deploy-artifacts.xml
Log:
- Setting provided scope to springframework dependencies and moving them to specific profiles
- First changes for deploying spring libs separately
Modified: stack/cxf/branches/no-spring-support/modules/client/pom.xml
===================================================================
--- stack/cxf/branches/no-spring-support/modules/client/pom.xml 2010-06-17 14:32:18 UTC (rev 12496)
+++ stack/cxf/branches/no-spring-support/modules/client/pom.xml 2010-06-17 19:21:25 UTC (rev 12497)
@@ -155,6 +155,7 @@
<artifactId>asm</artifactId>
</dependency>
+ <!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
Modified: stack/cxf/branches/no-spring-support/modules/server/pom.xml
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/pom.xml 2010-06-17 14:32:18 UTC (rev 12496)
+++ stack/cxf/branches/no-spring-support/modules/server/pom.xml 2010-06-17 19:21:25 UTC (rev 12497)
@@ -157,6 +157,8 @@
<groupId>asm</groupId>
<artifactId>asm</artifactId>
</dependency>
+
+ <!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
@@ -182,12 +184,12 @@
<artifactId>spring-expression</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jms</artifactId>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
</dependency>
<dependency>
Modified: stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/pom.xml
===================================================================
--- stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/pom.xml 2010-06-17 14:32:18 UTC (rev 12496)
+++ stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/pom.xml 2010-06-17 19:21:25 UTC (rev 12497)
@@ -21,10 +21,42 @@
<version>${version}</version>
</dependency>
<dependency>
- <groupId>org.picketbox</groupId>
- <artifactId>picketbox-bare</artifactId>
- <scope>test</scope>
+ <groupId>org.picketbox</groupId>
+ <artifactId>picketbox-bare</artifactId>
+ <scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </dependency>
</dependencies>
<!-- Profiles -->
Modified: stack/cxf/branches/no-spring-support/modules/testsuite/framework-tests/pom.xml
===================================================================
--- stack/cxf/branches/no-spring-support/modules/testsuite/framework-tests/pom.xml 2010-06-17 14:32:18 UTC (rev 12496)
+++ stack/cxf/branches/no-spring-support/modules/testsuite/framework-tests/pom.xml 2010-06-17 19:21:25 UTC (rev 12497)
@@ -49,6 +49,48 @@
<profiles>
<!--
+ Name: spring
+ Descr: Add SpringFramework dependencies to test classpath
+ -->
+ <profile>
+ <id>spring</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+
+ <!--
Name: noprepare
Descr: Skip test preparation with -Dnoprepare
-->
Modified: stack/cxf/branches/no-spring-support/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/branches/no-spring-support/modules/testsuite/pom.xml 2010-06-17 14:32:18 UTC (rev 12496)
+++ stack/cxf/branches/no-spring-support/modules/testsuite/pom.xml 2010-06-17 19:21:25 UTC (rev 12497)
@@ -525,6 +525,11 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
+ <!-- Exclusion for keeping control over Spring inclusion/exclusion -->
+ <exclusion>
+ <groupId>org.jboss.snowdrop</groupId>
+ <artifactId>jboss-spring-deployer</artifactId>
+ </exclusion>
</exclusions>
</dependency>
</dependencies>
@@ -622,6 +627,11 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
+ <!-- Exclusion for keeping control over Spring inclusion/exclusion -->
+ <exclusion>
+ <groupId>org.jboss.snowdrop</groupId>
+ <artifactId>jboss-spring-deployer</artifactId>
+ </exclusion>
</exclusions>
</dependency>
</dependencies>
Modified: stack/cxf/branches/no-spring-support/pom.xml
===================================================================
--- stack/cxf/branches/no-spring-support/pom.xml 2010-06-17 14:32:18 UTC (rev 12496)
+++ stack/cxf/branches/no-spring-support/pom.xml 2010-06-17 19:21:25 UTC (rev 12497)
@@ -251,6 +251,38 @@
<groupId>com.sun.xml.fastinfoset</groupId>
<artifactId>FastInfoset</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -270,6 +302,38 @@
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-stax-api_1.0_spec</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -297,12 +361,78 @@
<groupId>asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
@@ -313,6 +443,38 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -328,6 +490,38 @@
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_1.1_spec</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -344,6 +538,38 @@
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jaxws_2.1_spec</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -359,6 +585,38 @@
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jaxws_2.1_spec</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -378,6 +636,38 @@
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jaxws_2.1_spec</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -397,38 +687,275 @@
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-stax-api_1.0_spec</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-tools-wsdlto-databinding-jaxb</artifactId>
<version>${cxf.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-tools-wsdlto-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf.xjcplugins</groupId>
<artifactId>cxf-xjc-boolean</artifactId>
<version>${cxf.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf.xjcplugins</groupId>
<artifactId>cxf-xjc-bug671</artifactId>
<version>${cxf.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-dv</artifactId>
<version>${cxf.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-ts</artifactId>
<version>${cxf.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
+
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxrpc-api</artifactId>
@@ -484,46 +1011,56 @@
<artifactId>asm</artifactId>
<version>${cxf.asm.version}</version>
</dependency>
+ <!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-asm</artifactId>
<version>${spring.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${spring.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>${spring.version}</version>
- </dependency>
+ <scope>provided</scope>
+ </dependency>
+
<dependency>
<groupId>javax.jws</groupId>
<artifactId>jsr181-api</artifactId>
@@ -721,6 +1258,29 @@
</profile>
<!--
+ Name: deploy-spring
+ Descr: Deploy Spring artifacts
+ -->
+ <profile>
+ <id>deploy-spring</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <finalName>deploy-spring</finalName>
+ <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+ <descriptor>src/main/scripts/assembly-deploy-spring.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!--
Name: srcdist
Descr: Build the source distribution
-->
Modified: stack/cxf/branches/no-spring-support/src/main/scripts/assembly-deploy-artifacts.xml
===================================================================
--- stack/cxf/branches/no-spring-support/src/main/scripts/assembly-deploy-artifacts.xml 2010-06-17 14:32:18 UTC (rev 12496)
+++ stack/cxf/branches/no-spring-support/src/main/scripts/assembly-deploy-artifacts.xml 2010-06-17 19:21:25 UTC (rev 12497)
@@ -33,14 +33,6 @@
<include>junit:junit:jar</include>
<include>org.apache.neethi:neethi:jar</include>
<include>com.sun.xml.messaging.saaj:saaj-impl:jar</include>
- <include>org.springframework:spring-aop:jar</include>
- <include>org.springframework:spring-asm:jar</include>
- <include>org.springframework:spring-beans:jar</include>
- <include>org.springframework:spring-context:jar</include>
- <include>org.springframework:spring-core:jar</include>
- <include>org.springframework:spring-expression:jar</include>
- <include>org.springframework:spring-jms:jar</include>
- <include>org.springframework:spring-tx:jar</include>
<include>wsdl4j:wsdl4j:jar</include>
<include>org.apache.ws.commons.schema:XmlSchema:jar</include>
<include>com.sun.xml.fastinfoset:FastInfoset:jar</include>
Added: stack/cxf/branches/no-spring-support/src/main/scripts/assembly-deploy-spring.xml
===================================================================
--- stack/cxf/branches/no-spring-support/src/main/scripts/assembly-deploy-spring.xml (rev 0)
+++ stack/cxf/branches/no-spring-support/src/main/scripts/assembly-deploy-spring.xml 2010-06-17 19:21:25 UTC (rev 12497)
@@ -0,0 +1,41 @@
+<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+
+ <id>deploy-spring</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <moduleSets>
+ <moduleSet>
+ <includes>
+ <include>org.jboss.ws.cxf:jbossws-cxf-client</include>
+ <include>org.jboss.ws.cxf:jbossws-cxf-server</include>
+ </includes>
+ <binaries>
+ <outputDirectory>lib</outputDirectory>
+ <outputFileNameMapping>${module.artifactId}.${module.extension}</outputFileNameMapping>
+ <unpack>false</unpack>
+ <dependencySets>
+ <dependencySet>
+ <outputFileNameMapping>${module.artifactId}.${module.extension}</outputFileNameMapping>
+ <useStrictFiltering>true</useStrictFiltering>
+ <scope>provided</scope>
+ <includes>
+ <include>org.springframework:spring-aop:jar</include>
+ <include>org.springframework:spring-asm:jar</include>
+ <include>org.springframework:spring-beans:jar</include>
+ <include>org.springframework:spring-context:jar</include>
+ <include>org.springframework:spring-core:jar</include>
+ <include>org.springframework:spring-expression:jar</include>
+ <include>org.springframework:spring-jms:jar</include>
+ <include>org.springframework:spring-tx:jar</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+ </binaries>
+ </moduleSet>
+ </moduleSets>
+
+</assembly>
Property changes on: stack/cxf/branches/no-spring-support/src/main/scripts/assembly-deploy-spring.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
13 years, 10 months
JBossWS SVN: r12496 - stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-06-17 10:32:18 -0400 (Thu, 17 Jun 2010)
New Revision: 12496
Modified:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
Log:
Prevent deferred activation of ConduitInitiator instances which can break jbossws-cxf integration
Modified: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2010-06-17 13:05:59 UTC (rev 12495)
+++ stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2010-06-17 14:32:18 UTC (rev 12496)
@@ -25,11 +25,12 @@
import javax.xml.ws.soap.SOAPBinding;
-import org.apache.cxf.binding.BindingConfiguration;
import org.apache.cxf.binding.soap.SoapTransportFactory;
+import org.apache.cxf.bus.extension.ExtensionManager;
import org.apache.cxf.configuration.Configurer;
import org.apache.cxf.resource.ResourceResolver;
import org.apache.cxf.service.invoker.Invoker;
+import org.apache.cxf.transport.ConduitInitiator;
import org.apache.cxf.transport.DestinationFactory;
import org.apache.cxf.transport.servlet.ServletTransportFactory;
import org.jboss.wsf.spi.binding.BindingCustomization;
@@ -57,6 +58,8 @@
super();
bus = new JBossWSNonSpringBusFactory().createBus();
//Force servlet transport to prevent CXF from using Jetty as a transport
+ ExtensionManager em = bus.getExtension(ExtensionManager.class);
+ em.activateAllByType(ConduitInitiator.class); //need to activate/register all the beans implementing ConduitInitiator so that does not happen later
DestinationFactory factory = new ServletTransportFactory(bus);
for (String s : factory.getTransportIds()) {
registerTransport(factory, s);
13 years, 10 months
JBossWS SVN: r12495 - in stack/cxf/trunk: modules/server and 12 other directories.
by jbossws-commits@lists.jboss.org
Author: sergeyb
Date: 2010-06-17 09:05:59 -0400 (Thu, 17 Jun 2010)
New Revision: 12495
Added:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/callback/
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/callback/UsernameTokenCallback.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/callback/UsernameTokenCallbackHandler.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/nonce/
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/nonce/NonceStore.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/MemoryNonceStore.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/ServiceIface.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/ServiceImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/UsernameDigestTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/UsernamePasswordCallback.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/GreetMe.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/GreetMeResponse.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/SayHello.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/SayHelloResponse.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jboss-service.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jboss-web.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jbossws-cxf.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jbossws-roles.properties
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jbossws-users.properties
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/login-config.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/web.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/wsdl/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/wsdl/SecurityService.wsdl
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/wsdl/SecurityService_schema1.xsd
Modified:
stack/cxf/trunk/modules/server/pom.xml
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml
stack/cxf/trunk/pom.xml
Log:
[JBWS-3028] Initial support for digests
Modified: stack/cxf/trunk/modules/server/pom.xml
===================================================================
--- stack/cxf/trunk/modules/server/pom.xml 2010-06-17 09:48:31 UTC (rev 12494)
+++ stack/cxf/trunk/modules/server/pom.xml 2010-06-17 13:05:59 UTC (rev 12495)
@@ -204,6 +204,14 @@
<groupId>org.jboss.security</groupId>
<artifactId>jboss-security-spi</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jbosssx</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossxb</artifactId>
+ </dependency>
<!-- transitve dependencies -->
<dependency>
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java 2010-06-17 09:48:31 UTC (rev 12494)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java 2010-06-17 13:05:59 UTC (rev 12495)
@@ -21,22 +21,34 @@
*/
package org.jboss.wsf.stack.cxf.security.authentication;
+import java.io.IOException;
import java.security.Principal;
+import java.util.Calendar;
import java.util.Collections;
import java.util.Map;
import javax.security.auth.Subject;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
import org.apache.cxf.binding.soap.SoapMessage;
import org.apache.cxf.common.security.SimplePrincipal;
import org.apache.cxf.phase.PhaseInterceptorChain;
import org.apache.cxf.ws.security.wss4j.AbstractUsernameTokenAuthenticatingInterceptor;
+import org.apache.ws.security.WSConstants;
+import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.handler.RequestData;
import org.jboss.logging.Logger;
import org.jboss.security.AuthenticationManager;
+import org.jboss.security.auth.callback.CallbackHandlerPolicyContextHandler;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.invocation.SecurityAdaptor;
import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
+import org.jboss.wsf.stack.cxf.security.authentication.callback.UsernameTokenCallbackHandler;
+import org.jboss.wsf.stack.cxf.security.nonce.NonceStore;
+import org.jboss.xb.binding.SimpleTypeBindings;
/**
* Interceptor which authenticates a current principal and populates Subject
@@ -47,11 +59,14 @@
public class SubjectCreatingInterceptor extends AbstractUsernameTokenAuthenticatingInterceptor
{
private static final Logger log = Logger.getLogger(SubjectCreatingInterceptor.class);
-
- private AuthenticationManagerLoader aml = null;
+ private static final int TIMESTAMP_FRESHNESS_THRESHOLD = 300;
+
+ private AuthenticationManagerLoader aml;
private boolean propagateContext;
private SecurityAdaptorFactory secAdaptorFactory;
-
+ private int timestampThreshold = TIMESTAMP_FRESHNESS_THRESHOLD;
+ private NonceStore nonceStore;
+ private boolean decodeNonce = true;
public SubjectCreatingInterceptor()
{
@@ -76,9 +91,42 @@
}
+ // TODO : this code has to go to the super class, AbstractUsernameTokenAuthenticatingInterceptor
+ // has a bug to do with handling digests
@Override
+ protected CallbackHandler getCallback(RequestData reqData, int doAction)
+ throws WSSecurityException {
+
+ if ((doAction & WSConstants.UT) != 0 && reqData.getPwType() != WSConstants.PASSWORD_TEXT) {
+ return new CallbackHandler()
+ {
+ @Override
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
+ {
+ // dummy handler
+ }
+ };
+ } else {
+ return super.getCallback(reqData, doAction);
+ }
+ }
+
+ @Override
public Subject createSubject(String name, String password, boolean isDigest, String nonce, String created)
{
+ if (isDigest)
+ {
+ verifyUsernameToken(nonce, created);
+ // It is not possible at the moment to figure out if the digest has been created
+ // using the original nonce bytes or the bytes of the (Base64)-encoded nonce, some
+ // legacy clients might use the (Base64)-encoded nonce bytes when creating a digest;
+ // lets default to true and assume the nonce has been Base-64 encoded, given that
+ // WSS4J client Base64-decodes the nonce before creating the digest
+
+ CallbackHandler handler = new UsernameTokenCallbackHandler(nonce, created, decodeNonce);
+ CallbackHandlerPolicyContextHandler.setCallbackHandler(handler);
+ }
+
// authenticate and populate Subject
AuthenticationManager am = aml.getManager();
@@ -89,11 +137,21 @@
if (TRACE)
log.trace("About to authenticate, using security domain '" + am.getSecurityDomain() + "'");
- if (am.isValid(principal, password, subject) == false)
+ try
{
- String msg = "Authentication failed, principal=" + principal.getName();
- log.error(msg);
- throw new SecurityException(msg);
+ if (am.isValid(principal, password, subject) == false)
+ {
+ String msg = "Authentication failed, principal=" + principal.getName();
+ log.error(msg);
+ throw new SecurityException(msg);
+ }
+ }
+ finally
+ {
+ if (isDigest)
+ {
+ // how do we remove the handler from the thread local storage ?
+ }
}
if (TRACE)
@@ -113,40 +171,47 @@
return subject;
}
- @Override
- public void handleFault(SoapMessage message) {
- SecurityAdaptor adaptor = message.getContent(SecurityAdaptor.class);
- if (adaptor != null) {
- //TODO: release the propagated state
- }
- }
-
-
- public void setPropagateContext(boolean propagateContext) {
- this.propagateContext = propagateContext;
- }
-
-
- /** TODO: JBWS-3028
- private static final int TIMESTAMP_FRESHNESS_THRESHOLD = 300;
- private NonceStore nonceStore;
-
private void verifyUsernameToken(String nonce, String created)
{
if (created != null)
{
Calendar cal = SimpleTypeBindings.unmarshalDateTime(created);
Calendar ref = Calendar.getInstance();
- ref.add(Calendar.SECOND, -TIMESTAMP_FRESHNESS_THRESHOLD);
+ ref.add(Calendar.SECOND, -timestampThreshold);
if (ref.after(cal))
throw new SecurityException("Request rejected since a stale timestamp has been provided: " + created);
}
- if (nonce != null)
+ if (nonce != null && nonceStore != null)
{
if (nonceStore.hasNonce(nonce))
throw new SecurityException("Request rejected since a message with the same nonce has been recently received; nonce = " + nonce);
+ nonceStore.putNonce(nonce);
}
}
- */
+
+ public void setPropagateContext(boolean propagateContext) {
+ this.propagateContext = propagateContext;
+ }
+
+ public void setTimestampThreshold(int timestampThreshold) {
+ this.timestampThreshold = timestampThreshold;
+ }
+
+ @Override
+ public void handleFault(SoapMessage message) {
+ SecurityAdaptor adaptor = message.getContent(SecurityAdaptor.class);
+ if (adaptor != null) {
+ //TODO: release the propagated state
+ }
+ }
+
+ public void setNonceStore(NonceStore nonceStore) {
+ this.nonceStore = nonceStore;
+ }
+
+ public void setDecodeNonce(boolean decodeNonce) {
+ this.decodeNonce = decodeNonce;
+ }
+
}
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/callback/UsernameTokenCallback.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/callback/UsernameTokenCallback.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/callback/UsernameTokenCallback.java 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf.security.authentication.callback;
+
+import java.io.UnsupportedEncodingException;
+import java.security.MessageDigest;
+import java.util.Map;
+
+import javax.security.auth.callback.Callback;
+
+import org.jboss.crypto.digest.DigestCallback;
+import org.jboss.security.auth.callback.MapCallback;
+
+/**
+ * An implementation of DigestCallback that generates password
+ * digests according to the UsernameTokenProfile 1.0 specification.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 12-Mar-2008
+ *
+ */
+public class UsernameTokenCallback implements DigestCallback
+{
+ static final String NONCE = "nonce";
+ static final String CREATED = "created";
+ static final String DECODE_NONCE = "decodeNonce";
+
+ private MapCallback info;
+
+ @SuppressWarnings("unchecked")
+ public void init(Map options)
+ {
+ // Ask for MapCallback to obtain the digest parameters
+ info = new MapCallback();
+ Callback[] callbacks = { info };
+ options.put("callbacks", callbacks);
+ }
+
+ public void preDigest(MessageDigest digest)
+ {
+ try
+ {
+ String nonce = (String)info.getInfo(NONCE);
+ if (nonce != null)
+ {
+ Boolean decodeNonce = (Boolean)info.getInfo(DECODE_NONCE);
+ byte[] nonceBytes = decodeNonce ? org.jboss.util.Base64.decode(nonce)
+ : nonce.getBytes("UTF-8");
+ digest.update(nonceBytes);
+ }
+ String created = (String)info.getInfo(CREATED);
+ if (created != null)
+ digest.update(created.getBytes("UTF-8"));
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ throw new SecurityException(e);
+ }
+ }
+
+ public void postDigest(MessageDigest digest)
+ {
+ }
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/callback/UsernameTokenCallback.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/callback/UsernameTokenCallbackHandler.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/callback/UsernameTokenCallbackHandler.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/callback/UsernameTokenCallbackHandler.java 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf.security.authentication.callback;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.jboss.security.auth.callback.MapCallback;
+
+/**
+ * A callback handler to be used to pass parameters to the
+ * UsernameTokenCallback.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 12-Mar-2008
+ *
+ */
+public class UsernameTokenCallbackHandler implements CallbackHandler
+{
+ private String nonce;
+ private String created;
+ private boolean decodeNonce;
+
+ public UsernameTokenCallbackHandler(String nonce, String created, boolean decodeNonce)
+ {
+ this.created = created;
+ this.nonce = nonce;
+ this.decodeNonce = decodeNonce;
+ }
+
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
+ {
+ boolean foundCallback = false;
+ Callback firstUnknown = null;
+ int count = callbacks != null ? callbacks.length : 0;
+ for(int n = 0; n < count; n ++)
+ {
+ Callback c = callbacks[n];
+ if( c instanceof MapCallback )
+ {
+ //set parameters to the MapCallback the UsernameTokenCallback
+ //created and set up in the init method
+ MapCallback mc = (MapCallback) c;
+ mc.setInfo(UsernameTokenCallback.NONCE, nonce);
+ mc.setInfo(UsernameTokenCallback.CREATED, created);
+ mc.setInfo(UsernameTokenCallback.DECODE_NONCE, Boolean.valueOf(decodeNonce));
+ foundCallback = true;
+ }
+ else if( firstUnknown == null )
+ {
+ firstUnknown = c;
+ }
+ }
+ if( foundCallback == false )
+ throw new UnsupportedCallbackException(firstUnknown, "Unrecognized Callback");
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/callback/UsernameTokenCallbackHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/nonce/NonceStore.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/nonce/NonceStore.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/nonce/NonceStore.java 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf.security.nonce;
+
+/**
+ * A nonce store collects recently used nonces.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 12-Mar-2008
+ *
+ */
+public interface NonceStore
+{
+ /**
+ * Checks whether the store contains the provided nonce.
+ *
+ * @param nonce
+ * @return True if the provided nonce has been recently put in the store
+ */
+ public boolean hasNonce(String nonce);
+
+ /**
+ * Put the given nonce in the store.
+ *
+ * @param nonce
+ */
+ public void putNonce(String nonce);
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/nonce/NonceStore.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml 2010-06-17 09:48:31 UTC (rev 12494)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml 2010-06-17 13:05:59 UTC (rev 12495)
@@ -218,6 +218,26 @@
</webinf>
</war>
+ <!-- jaxws-samples-wsse-username-digest -->
+ <war
+ warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-username-digest.war"
+ webxml="${tests.output.dir}/test-resources/jaxws/samples/wsse/username-digest/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/samples/wsseDigest/Service*.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wsseDigest/MemoryNonceStore.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/*.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/username-digest/WEB-INF">
+ <include name="jboss-web.xml"/>
+ <include name="jboss-service.xml"/>
+ <include name="jbossws-cxf.xml"/>
+ <include name="login-config.xml"/>
+ <include name="jbossws-users.properties"/>
+ <include name="jbossws-roles.properties"/>
+ <include name="wsdl/*"/>
+ </webinf>
+ </war>
+
<!-- jaxws-samples-wsseEJB -->
<jar destfile="${tests.output.dir}/test-libs/jaxws-samples-wsseEJB.jar">
<fileset dir="${tests.output.dir}/test-classes">
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/MemoryNonceStore.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/MemoryNonceStore.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/MemoryNonceStore.java 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsseDigest;
+
+import java.util.Set;
+import java.util.HashSet;
+import org.jboss.wsf.stack.cxf.security.nonce.NonceStore;
+
+public class MemoryNonceStore implements NonceStore
+{
+ private Set<String> nonces = new HashSet<String>();
+
+ public boolean hasNonce(String nonce)
+ {
+ synchronized (nonces)
+ {
+ return nonces.contains(nonce);
+ }
+ }
+
+ public void putNonce(String nonce)
+ {
+ synchronized (nonces)
+ {
+ nonces.add(nonce);
+ }
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/MemoryNonceStore.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/ServiceIface.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/ServiceIface.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/ServiceIface.java 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsseDigest;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService
+(
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity"
+)
+public interface ServiceIface
+{
+ @WebMethod
+ String sayHello();
+
+ @WebMethod
+ String greetMe();
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/ServiceIface.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/ServiceImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/ServiceImpl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/ServiceImpl.java 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsseDigest;
+
+import javax.jws.WebService;
+
+@WebService
+(
+ serviceName = "SecurityService",
+ wsdlLocation = "WEB-INF/wsdl/SecurityService.wsdl",
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.wsseDigest.ServiceIface"
+)
+public class ServiceImpl implements ServiceIface
+{
+ public String sayHello()
+ {
+ return "Secure Hello World!";
+ }
+ public String greetMe()
+ {
+ return "Greetings!";
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/ServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/UsernameDigestTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/UsernameDigestTestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/UsernameDigestTestCase.java 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,130 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsseDigest;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * WS-Security username authorization test case
+ *
+ * @author Sergey Beryozkin
+ *
+ */
+public final class UsernameDigestTestCase extends JBossWSTest
+{
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-username-digest";
+
+ private final QName servicePort = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecurity", "SecurityServicePort");
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(UsernameDigestTestCase.class, "jaxws-samples-wsse-username-digest.war");
+ }
+
+ public void testAuthorized() throws Exception
+ {
+ doTestAuthorized(serviceURL, servicePort, "kermit");
+ }
+
+private void doTestAuthorized(String endpointAddress, QName portName, String userName) throws Exception
+ {
+ QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecurity", "SecurityService");
+ URL wsdlURL = new URL(endpointAddress + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(portName, ServiceIface.class);
+ setupWsse(proxy, userName);
+ assertEquals("Secure Hello World!", proxy.sayHello());
+ }
+
+ public void testUnauthenticated() throws Exception
+ {
+ QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecurity", "SecurityService");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ setupWsse(proxy, "foo");
+ try
+ {
+ proxy.sayHello();
+ fail("User foo should not be authenticated.");
+ }
+ catch (Exception ex)
+ {
+ //expected
+ }
+ }
+
+ public void testUnauthorized() throws Exception
+ {
+ doTestUnauthorized(serviceURL, servicePort, "kermit");
+ }
+
+ private void doTestUnauthorized(String endpointAddress, QName portName, String userName) throws Exception
+ {
+ QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecurity", "SecurityService");
+ URL wsdlURL = new URL(endpointAddress + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(portName, ServiceIface.class);
+ setupWsse(proxy, userName);
+ try
+ {
+ proxy.greetMe();
+ fail("User kermit should not be authorized to invoke greetMe.");
+ }
+ catch (Exception ex)
+ {
+ assertEquals("Unauthorized", ex.getMessage());
+ }
+ }
+
+ private void setupWsse(ServiceIface proxy, String username)
+ {
+ Client client = ClientProxy.getClient(proxy);
+ Endpoint cxfEndpoint = client.getEndpoint();
+
+ Map<String, Object> outProps = new HashMap<String, Object>();
+ outProps.put("action", "UsernameToken");
+ outProps.put("user", username);
+ outProps.put("passwordType", "PasswordDigest");
+ outProps.put("passwordCallbackClass", "org.jboss.test.ws.jaxws.samples.wsseDigest.UsernamePasswordCallback");
+ WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps); //request
+ cxfEndpoint.getOutInterceptors().add(wssOut);
+ cxfEndpoint.getOutInterceptors().add(new SAAJOutInterceptor());
+ }
+
+
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/UsernameDigestTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/UsernamePasswordCallback.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/UsernamePasswordCallback.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/UsernamePasswordCallback.java 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsseDigest;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import org.apache.ws.security.WSPasswordCallback;
+
+public class UsernamePasswordCallback implements CallbackHandler
+{
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
+ {
+ WSPasswordCallback pc = (WSPasswordCallback)callbacks[0];
+ if ("kermit".equals(pc.getIdentifier()))
+ pc.setPassword("therealfrog");
+ else
+ pc.setPassword("wrong password");
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/UsernamePasswordCallback.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/GreetMe.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/GreetMe.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/GreetMe.java 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsseDigest.jaxws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(name = "greetMe", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "greetMe", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity")
+public class GreetMe {}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/GreetMe.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/GreetMeResponse.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/GreetMeResponse.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/GreetMeResponse.java 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsseDigest.jaxws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(name = "greetMeResponse", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "greetMeResponse", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity")
+public class GreetMeResponse
+{
+
+ @XmlElement(name = "return", namespace = "")
+ private String _return;
+
+ public String getReturn()
+ {
+ return this._return;
+ }
+
+ public void setReturn(String _return)
+ {
+ this._return = _return;
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/GreetMeResponse.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/SayHello.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/SayHello.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/SayHello.java 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsseDigest.jaxws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(name = "sayHello", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "sayHello", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity")
+public class SayHello {}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/SayHello.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/SayHelloResponse.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/SayHelloResponse.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/SayHelloResponse.java 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.samples.wsseDigest.jaxws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(name = "sayHelloResponse", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "sayHelloResponse", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity")
+public class SayHelloResponse
+{
+
+ @XmlElement(name = "return", namespace = "")
+ private String _return;
+
+ public String getReturn()
+ {
+ return this._return;
+ }
+
+ public void setReturn(String _return)
+ {
+ this._return = _return;
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsseDigest/jaxws/SayHelloResponse.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jboss-service.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jboss-service.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jboss-service.xml 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+ <!-- ==================================================================== -->
+ <!-- Dynamic login config to install the login module using digest -->
+ <!-- ==================================================================== -->
+ <mbean code="org.jboss.security.auth.login.DynamicLoginConfig"
+ name="jboss:service=DynamicLoginConfig">
+ <attribute name="AuthConfig">login-config.xml</attribute>
+ <!-- The service which supports dynamic processing of login-config.xml
+ configurations.
+ -->
+ <depends optional-attribute-name="LoginConfigService">
+ jboss.security:service=XMLLoginConfig
+ </depends>
+ <!-- Optionally specify the security mgr service to use when
+ this service is stopped to flush the auth caches of the domains
+ registered by this service.
+ -->
+ <depends optional-attribute-name="SecurityManagerService">
+ jboss.security:service=JaasSecurityManager
+ </depends>
+ </mbean>
+</server>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jboss-service.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jboss-web.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jboss-web.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jboss-web.xml 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+ <security-domain>java:/jaas/JBossWSDigest</security-domain>
+</jboss-web>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jboss-web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jbossws-cxf.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jbossws-cxf.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jbossws-cxf.xml 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,54 @@
+<beans
+ xmlns='http://www.springframework.org/schema/beans'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:beans='http://www.springframework.org/schema/beans'
+ xmlns:jaxws='http://cxf.apache.org/jaxws'
+ xmlns:util='http://www.springframework.org/schema/util'
+ xsi:schemaLocation='http://cxf.apache.org/core
+ http://cxf.apache.org/schemas/core.xsd
+ http://www.springframework.org/schema/util
+ http://www.springframework.org/schema/util/spring-util-2.0.xsd
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://cxf.apache.org/jaxws
+ http://cxf.apache.org/schemas/jaxws.xsd'>
+
+ <bean id="nonceStore" class="org.jboss.test.ws.jaxws.samples.wsseDigest.MemoryNonceStore"/>
+
+ <bean id="SecurityContextIn" class="org.jboss.wsf.stack.cxf.security.authentication.SubjectCreatingInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="UsernameToken"/>
+ </map>
+ </constructor-arg>
+ <property name="nonceStore" ref="nonceStore"/>
+ <property name="supportDigestPasswords" value="true"/>
+ </bean>
+
+ <util:map id="methodPermissions">
+ <entry key="sayHello" value="friend"/>
+ <entry key="greetMe" value="snoopies"/>
+ </util:map>
+
+ <bean id="AuthorizeIn" class="org.apache.cxf.interceptor.security.SimpleAuthorizingInterceptor">
+ <property name="methodRolesMap" ref="methodPermissions"/>
+ </bean>
+
+ <jaxws:endpoint
+ id='ServiceImpl'
+ address='http://@jboss.bind.address@:8080/jaxws-samples-wsse-username-digest'
+ implementor='org.jboss.test.ws.jaxws.samples.wsseDigest.ServiceImpl'
+ endpointName="ns:SecurityServicePort"
+ serviceName="ns:SecurityService"
+ xmlns:ns="http://www.jboss.org/jbossws/ws-extensions/wssecurity">
+ <jaxws:inInterceptors>
+ <ref bean="SecurityContextIn"/>
+ <ref bean="AuthorizeIn"/>
+ <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
+<!--
+ <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+-->
+ </jaxws:inInterceptors>
+ </jaxws:endpoint>
+
+</beans>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jbossws-cxf.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jbossws-roles.properties
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jbossws-roles.properties (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jbossws-roles.properties 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,2 @@
+# A sample roles.properties file for use with the UsersRolesLoginModule
+kermit=friend
\ No newline at end of file
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jbossws-roles.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jbossws-users.properties
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jbossws-users.properties (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jbossws-users.properties 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,2 @@
+# A sample users.properties file for use with the UsersRolesLoginModule
+kermit=therealfrog
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/jbossws-users.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/login-config.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/login-config.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/login-config.xml 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,25 @@
+<?xml version='1.0'?>
+<!DOCTYPE policy PUBLIC
+ "-//JBoss//DTD JBOSS Security Config 3.0//EN"
+ "http://www.jboss.org/j2ee/dtd/security_config.dtd">
+<policy> <!-- xmlns="urn:jboss:security-config:5.0"> -->
+
+ <application-policy name="JBossWSDigest">
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
+ flag="required">
+ <module-option name="usersProperties">jbossws-users.properties</module-option>
+ <module-option name="rolesProperties">jbossws-roles.properties</module-option>
+ <module-option name="hashAlgorithm">SHA</module-option>
+ <module-option name="hashEncoding">BASE64</module-option>
+ <module-option name="hashCharset">UTF-8</module-option>
+ <module-option name="hashUserPassword">false</module-option>
+ <module-option name="hashStorePassword">true</module-option>
+ <module-option name="storeDigestCallback">org.jboss.wsf.stack.cxf.security.authentication.callback.UsernameTokenCallback</module-option>
+ <module-option name="unauthenticatedIdentity">anonymous</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+</policy>
+
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/login-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/web.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/web.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/web.xml 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
+ version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <servlet>
+ <servlet-name>TestService</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.samples.wsseDigest.ServiceImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+
+</web-app>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/wsdl/SecurityService.wsdl
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/wsdl/SecurityService.wsdl (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/wsdl/SecurityService.wsdl 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<definitions targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wssecurity" name="SecurityService"
+ xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecurity"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema>
+ <xsd:import namespace="http://www.jboss.org/jbossws/ws-extensions/wssecurity" schemaLocation="SecurityService_schema1.xsd"/>
+ </xsd:schema>
+ </types>
+ <message name="sayHello">
+ <part name="parameters" element="tns:sayHello"/>
+ </message>
+ <message name="sayHelloResponse">
+ <part name="parameters" element="tns:sayHelloResponse"/>
+ </message>
+ <message name="greetMe">
+ <part name="parameters" element="tns:greetMe"/>
+ </message>
+ <message name="greetMeResponse">
+ <part name="parameters" element="tns:greetMeResponse"/>
+ </message>
+ <portType name="ServiceIface">
+ <operation name="sayHello">
+ <input message="tns:sayHello"/>
+ <output message="tns:sayHelloResponse"/>
+ </operation>
+ <operation name="greetMe">
+ <input message="tns:greetMe"/>
+ <output message="tns:greetMeResponse"/>
+ </operation>
+ </portType>
+ <binding name="SecurityServicePortBinding" type="tns:ServiceIface">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="greetMe">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="SecurityService">
+ <port name="SecurityServicePort" binding="tns:SecurityServicePortBinding">
+ <soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-username-digest"/>
+ </port>
+ </service>
+</definitions>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/wsdl/SecurityService.wsdl
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/wsdl/SecurityService_schema1.xsd
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/wsdl/SecurityService_schema1.xsd (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/wsdl/SecurityService_schema1.xsd 2010-06-17 13:05:59 UTC (rev 12495)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wssecurity" xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecurity" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="sayHello" type="tns:sayHello"/>
+
+ <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
+
+ <xs:complexType name="sayHello">
+ <xs:sequence/>
+ </xs:complexType>
+
+ <xs:complexType name="sayHelloResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:element name="greetMe" type="tns:greetMe"/>
+
+ <xs:element name="greetMeResponse" type="tns:greetMeResponse"/>
+
+ <xs:complexType name="greetMe">
+ <xs:sequence/>
+ </xs:complexType>
+
+ <xs:complexType name="greetMeResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-digest/WEB-INF/wsdl/SecurityService_schema1.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2010-06-17 09:48:31 UTC (rev 12494)
+++ stack/cxf/trunk/pom.xml 2010-06-17 13:05:59 UTC (rev 12495)
@@ -64,6 +64,8 @@
<jboss.common.core.version>2.2.16.GA</jboss.common.core.version>
<jboss.logging.version>2.2.0.CR1</jboss.logging.version>
<jboss.security.spi.version>2.0.4.SP4</jboss.security.spi.version>
+ <jboss.security.sx.version>2.0.4</jboss.security.sx.version>
+ <jboss.xb.version>2.0.2.Beta7</jboss.xb.version>
<picketbox.version>3.0.0.Beta5</picketbox.version>
<jaxb.api.version>1.0.0.Beta1</jaxb.api.version>
<jaxb.impl.version>2.2</jaxb.impl.version>
@@ -538,6 +540,18 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossxb</artifactId>
+ <version>${jboss.xb.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jbosssx</artifactId>
+ <version>${jboss.security.sx.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.picketbox</groupId>
<artifactId>picketbox-bare</artifactId>
<version>${picketbox.version}</version>
13 years, 10 months
JBossWS SVN: r12494 - in stack/cxf/branches/no-spring-support/modules: client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration and 9 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-06-17 05:48:31 -0400 (Thu, 17 Jun 2010)
New Revision: 12494
Added:
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BeanCustomizer.java
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSConfigurer.java
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/util/
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/util/SpringUtils.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerSpringConfigurer.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
Removed:
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerCXFConfigurer.java
Modified:
stack/cxf/branches/no-spring-support/modules/client/src/main/resources/META-INF/cxf/jbossws-cxf.xml
stack/cxf/branches/no-spring-support/modules/endorsed/src/main/resources/META-INF/services/org.apache.cxf.bus.factory
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endorse/Helper.java
stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java
Log:
First cut; most of the basic jaxws endpoints deploy correctly on AS 6 M3 without Spring libs (still need to manually change the endpoint servlet)
Added: stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BeanCustomizer.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BeanCustomizer.java (rev 0)
+++ stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BeanCustomizer.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -0,0 +1,160 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf.client.configuration;
+
+import org.apache.cxf.configuration.jsse.TLSClientParameters;
+import org.apache.cxf.databinding.DataBinding;
+import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
+import org.apache.cxf.frontend.ClientProxyFactoryBean;
+import org.apache.cxf.jaxb.JAXBDataBinding;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
+import org.apache.cxf.transport.http.HTTPConduit;
+import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.jboss.wsf.spi.binding.JAXBBindingCustomization;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ */
+public class BeanCustomizer
+{
+ protected BindingCustomization customization;
+
+ public void customize(Object beanInstance)
+ {
+ if (beanInstance instanceof AbstractWSDLBasedEndpointFactory)
+ {
+ configureEndpointFactory((AbstractWSDLBasedEndpointFactory)beanInstance);
+ }
+ else if (beanInstance instanceof ClientProxyFactoryBean)
+ {
+ configureClientProxyFactoryBean((ClientProxyFactoryBean)beanInstance);
+ }
+ else if (beanInstance instanceof HTTPConduit)
+ {
+ configureHTTPConduit((HTTPConduit)beanInstance);
+ }
+ //add other beans configuration here below
+ }
+
+ /**
+ * Configure the endpoint factory
+ *
+ * @param factory
+ */
+ protected void configureEndpointFactory(AbstractWSDLBasedEndpointFactory factory)
+ {
+ //Configure binding customization
+ if (customization != null)
+ {
+ ReflectionServiceFactoryBean serviceFactory = factory.getServiceFactory();
+ //customize default databinding (early pulls in ServiceFactory default databinding and configure it, as it's lazily loaded)
+ serviceFactory.reset();
+ DataBinding serviceFactoryDataBinding = serviceFactory.getDataBinding(true);
+ configureBindingCustomization(serviceFactoryDataBinding, customization);
+ serviceFactory.setDataBinding(serviceFactoryDataBinding);
+ //customize user provided databinding (CXF later overrides the ServiceFactory databinding using the user provided one)
+ if (factory.getDataBinding() == null)
+ {
+ //set the endpoint factory's databinding to prevent CXF resetting everything because user did not provide anything
+ factory.setDataBinding(serviceFactoryDataBinding);
+ }
+ else
+ {
+ configureBindingCustomization(factory.getDataBinding(), customization);
+ }
+ }
+ //add other configurations here below
+ }
+
+ /**
+ * Configure the client proxy factory; currently set the binding customization in the databinding (Client Side).
+ *
+ * @param factory
+ */
+ protected void configureClientProxyFactoryBean(ClientProxyFactoryBean factory)
+ {
+ //Configure binding customization
+ if (customization != null)
+ {
+ //customize default databinding (early pulls in ServiceFactory default databinding and configure it, as it's lazily loaded)
+ ReflectionServiceFactoryBean serviceFactory = factory.getServiceFactory();
+ serviceFactory.reset();
+ DataBinding serviceFactoryDataBinding = serviceFactory.getDataBinding(true);
+ configureBindingCustomization(serviceFactoryDataBinding, customization);
+ serviceFactory.setDataBinding(serviceFactoryDataBinding);
+ //customize user provided databinding (CXF later overrides the ServiceFactory databinding using the user provided one)
+ if (factory.getDataBinding() == null)
+ {
+ //set the endpoint factory's databinding to prevent CXF resetting everything because user did not provide anything
+ factory.setDataBinding(serviceFactoryDataBinding);
+ }
+ else
+ {
+ configureBindingCustomization(factory.getDataBinding(), customization);
+ }
+ }
+ //add other configurations here below
+ }
+
+ /**
+ * Configure the HTTPConduit; currently allows for setting disableCNcheck in TLS client parameters according
+ * to the JBoss' org.jboss.security.ignoreHttpsHost system property.
+ *
+ * @param conduit
+ */
+ protected void configureHTTPConduit(HTTPConduit conduit)
+ {
+ TLSClientParameters parameters = conduit.getTlsClientParameters();
+ if (parameters == null) //don't do anything when user already provided a configuration
+ {
+ parameters = new TLSClientParameters();
+ parameters.setUseHttpsURLConnectionDefaultSslSocketFactory(true);
+ if (Boolean.getBoolean("org.jboss.security.ignoreHttpsHost"))
+ {
+ parameters.setDisableCNCheck(true);
+ }
+ conduit.setTlsClientParameters(parameters);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ protected static void configureBindingCustomization(DataBinding db, BindingCustomization customization)
+ {
+ //JAXB
+ if (customization instanceof JAXBBindingCustomization)
+ {
+ if (db != null && db instanceof JAXBDataBinding)
+ {
+ ((JAXBDataBinding)db).setContextProperties(customization);
+ }
+ }
+ //add other binding customizations here below
+ }
+
+
+ public void setBindingCustomization(BindingCustomization customization)
+ {
+ this.customization = customization;
+ }
+}
Property changes on: stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BeanCustomizer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java (rev 0)
+++ stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -0,0 +1,134 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf.client.configuration;
+
+import java.net.URL;
+import java.util.Map;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.jboss.wsf.stack.cxf.client.util.SpringUtils;
+
+/**
+ * JBossWS version of @see{org.apache.cxf.BusFactory}. This detects if Spring is available or not when the default
+ * createBus() method is invoked; if Spring libraries are available in the classpath, an instance of
+ * @see{org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory} is internally used for
+ * creating the bus. On the contrary, an instance of @see{org.jboss.wsf.stack.cxf.client.configuration.JBossWSNonSpringBusFactory}
+ * is internally used when Spring is not available in the classpath.
+ * Users willing to create a bus factory given a parent @see{org.springframework.context.ApplicationContext} should
+ * directly create an instance of @see{org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory}.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ *
+ */
+public class JBossWSBusFactory extends BusFactory
+{
+ private JBossWSSpringBusFactory springBusFactory;
+ private JBossWSNonSpringBusFactory nonSpringBusFactory;
+
+ @Override
+ public Bus createBus()
+ {
+ if (SpringUtils.isSpringAvailable())
+ {
+ return getSpringBusFactory().createBus();
+ }
+ else
+ {
+ return getNonSpringBusFactory().createBus();
+ }
+ }
+
+ /** JBossWSSpringBusFactory methods **/
+ public Bus createBus(String cfgFile)
+ {
+ return getSpringBusFactory().createBus(cfgFile, true);
+ }
+
+ public Bus createBus(String cfgFiles[])
+ {
+ return getSpringBusFactory().createBus(cfgFiles, true);
+ }
+
+ public Bus createBus(String cfgFile, boolean includeDefaults)
+ {
+ return getSpringBusFactory().createBus(cfgFile, includeDefaults);
+ }
+
+ public Bus createBus(String cfgFiles[], boolean includeDefaults)
+ {
+ return getSpringBusFactory().createBus(cfgFiles, includeDefaults);
+ }
+
+ public Bus createBus(URL url)
+ {
+ return getSpringBusFactory().createBus(url);
+ }
+
+ public Bus createBus(URL[] urls)
+ {
+ return getSpringBusFactory().createBus(urls);
+ }
+
+ public Bus createBus(URL url, boolean includeDefaults)
+ {
+ return getSpringBusFactory().createBus(url, includeDefaults);
+ }
+
+ public Bus createBus(URL[] urls, boolean includeDefaults)
+ {
+ return getSpringBusFactory().createBus(urls, includeDefaults);
+ }
+
+ /** JBossWSNonSpringBusFactory methods **/
+ @SuppressWarnings("unchecked")
+ public Bus createBus(Map<Class, Object> extensions)
+ {
+ return getNonSpringBusFactory().createBus(extensions);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Bus createBus(Map<Class, Object> extensions, Map<String, Object> properties)
+ {
+ return getNonSpringBusFactory().createBus(extensions, properties);
+ }
+
+
+ public JBossWSSpringBusFactory getSpringBusFactory()
+ {
+ if (springBusFactory == null)
+ {
+ springBusFactory = new JBossWSSpringBusFactory();
+ }
+ return springBusFactory;
+ }
+
+ public JBossWSNonSpringBusFactory getNonSpringBusFactory()
+ {
+ if (nonSpringBusFactory == null)
+ {
+ nonSpringBusFactory = new JBossWSNonSpringBusFactory();
+ }
+ return nonSpringBusFactory;
+ }
+}
Property changes on: stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java 2010-06-17 09:31:35 UTC (rev 12493)
+++ stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -1,175 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf.client.configuration;
-
-import org.apache.cxf.configuration.jsse.TLSClientParameters;
-import org.apache.cxf.configuration.spring.ConfigurerImpl;
-import org.apache.cxf.databinding.DataBinding;
-import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
-import org.apache.cxf.frontend.ClientProxyFactoryBean;
-import org.apache.cxf.jaxb.JAXBDataBinding;
-import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
-import org.apache.cxf.transport.http.HTTPConduit;
-import org.jboss.wsf.spi.binding.BindingCustomization;
-import org.jboss.wsf.spi.binding.JAXBBindingCustomization;
-
-/**
- * A CXF configurer that sets JBossWS stuff / customizations / properties etc. in CXF configurable beans
- *
- * @author alessio.soldano(a)jboss.com
- * @since 05-Oct-2009
- */
-public class JBossWSCXFConfigurer extends ConfigurerImpl
-{
- protected BindingCustomization customization;
-
- @Override
- public void configureBean(Object beanInstance)
- {
- customConfigure(beanInstance);
- super.configureBean(beanInstance);
- }
-
- @Override
- public void configureBean(String name, Object beanInstance)
- {
- customConfigure(beanInstance);
- super.configureBean(name, beanInstance);
- }
-
- protected void customConfigure(Object beanInstance)
- {
- if (beanInstance instanceof AbstractWSDLBasedEndpointFactory)
- {
- configureEndpointFactory((AbstractWSDLBasedEndpointFactory)beanInstance);
- }
- else if (beanInstance instanceof ClientProxyFactoryBean)
- {
- configureClientProxyFactoryBean((ClientProxyFactoryBean)beanInstance);
- }
- else if (beanInstance instanceof HTTPConduit)
- {
- configureHTTPConduit((HTTPConduit)beanInstance);
- }
- //add other beans configuration here below
- }
-
- /**
- * Configure the endpoint factory
- *
- * @param factory
- */
- protected synchronized void configureEndpointFactory(AbstractWSDLBasedEndpointFactory factory)
- {
- //Configure binding customization
- if (customization != null)
- {
- ReflectionServiceFactoryBean serviceFactory = factory.getServiceFactory();
- //customize default databinding (early pulls in ServiceFactory default databinding and configure it, as it's lazily loaded)
- serviceFactory.reset();
- DataBinding serviceFactoryDataBinding = serviceFactory.getDataBinding(true);
- configureBindingCustomization(serviceFactoryDataBinding, customization);
- serviceFactory.setDataBinding(serviceFactoryDataBinding);
- //customize user provided databinding (CXF later overrides the ServiceFactory databinding using the user provided one)
- if (factory.getDataBinding() == null)
- {
- //set the endpoint factory's databinding to prevent CXF resetting everything because user did not provide anything
- factory.setDataBinding(serviceFactoryDataBinding);
- }
- else
- {
- configureBindingCustomization(factory.getDataBinding(), customization);
- }
- }
- //add other configurations here below
- }
-
- /**
- * Configure the client proxy factory; currently set the binding customization in the databinding (Client Side).
- *
- * @param factory
- */
- protected synchronized void configureClientProxyFactoryBean(ClientProxyFactoryBean factory)
- {
- //Configure binding customization
- if (customization != null)
- {
- //customize default databinding (early pulls in ServiceFactory default databinding and configure it, as it's lazily loaded)
- ReflectionServiceFactoryBean serviceFactory = factory.getServiceFactory();
- serviceFactory.reset();
- DataBinding serviceFactoryDataBinding = serviceFactory.getDataBinding(true);
- configureBindingCustomization(serviceFactoryDataBinding, customization);
- serviceFactory.setDataBinding(serviceFactoryDataBinding);
- //customize user provided databinding (CXF later overrides the ServiceFactory databinding using the user provided one)
- if (factory.getDataBinding() == null)
- {
- //set the endpoint factory's databinding to prevent CXF resetting everything because user did not provide anything
- factory.setDataBinding(serviceFactoryDataBinding);
- }
- else
- {
- configureBindingCustomization(factory.getDataBinding(), customization);
- }
- }
- //add other configurations here below
- }
-
- /**
- * Configure the HTTPConduit; currently allows for setting disableCNcheck in TLS client parameters according
- * to the JBoss' org.jboss.security.ignoreHttpsHost system property.
- *
- * @param conduit
- */
- protected synchronized void configureHTTPConduit(HTTPConduit conduit)
- {
- TLSClientParameters parameters = conduit.getTlsClientParameters();
- if (parameters == null) //don't do anything when user already provided a configuration
- {
- parameters = new TLSClientParameters();
- parameters.setUseHttpsURLConnectionDefaultSslSocketFactory(true);
- if (Boolean.getBoolean("org.jboss.security.ignoreHttpsHost"))
- {
- parameters.setDisableCNCheck(true);
- }
- conduit.setTlsClientParameters(parameters);
- }
- }
-
- @SuppressWarnings("unchecked")
- protected static void configureBindingCustomization(DataBinding db, BindingCustomization customization)
- {
- //JAXB
- if (customization instanceof JAXBBindingCustomization)
- {
- if (db != null && db instanceof JAXBDataBinding)
- {
- ((JAXBDataBinding)db).setContextProperties(customization);
- }
- }
- //add other binding customizations here below
- }
-
- public void setBindingCustomization(BindingCustomization customization)
- {
- this.customization = customization;
- }
-}
Added: stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSConfigurer.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSConfigurer.java (rev 0)
+++ stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSConfigurer.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf.client.configuration;
+
+import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.extension.BusExtension;
+
+/**
+ * A CXF configurer that sets JBossWS stuff / customizations / properties etc. in CXF configurable beans
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 05-Oct-2009
+ */
+public class JBossWSConfigurer implements Configurer, BusExtension
+{
+ private BeanCustomizer customizer;
+
+ public JBossWSConfigurer(BeanCustomizer customizer)
+ {
+ this.customizer = customizer;
+ }
+
+ @Override
+ public void configureBean(Object beanInstance)
+ {
+ customConfigure(beanInstance);
+ }
+
+ @Override
+ public void configureBean(String name, Object beanInstance)
+ {
+ customConfigure(beanInstance);
+ }
+
+ protected synchronized void customConfigure(Object beanInstance)
+ {
+ if (customizer != null)
+ {
+ customizer.customize(beanInstance);
+ }
+ }
+
+ public BeanCustomizer getCustomizer()
+ {
+ return customizer;
+ }
+
+ public void setCustomizer(BeanCustomizer customizer)
+ {
+ this.customizer = customizer;
+ }
+
+ @Override
+ public Class<?> getRegistrationType()
+ {
+ return Configurer.class;
+ }
+}
Property changes on: stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSConfigurer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java (rev 0)
+++ stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf.client.configuration;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.CXFBusFactory;
+import org.apache.cxf.bus.extension.ExtensionManagerBus;
+import org.apache.cxf.configuration.Configurer;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ *
+ */
+public class JBossWSNonSpringBusFactory extends CXFBusFactory
+{
+ @SuppressWarnings("unchecked")
+ @Override
+ public Bus createBus(Map<Class, Object> extensions, Map<String, Object> properties) {
+ if (extensions == null)
+ {
+ extensions = new HashMap<Class, Object>();
+ }
+ if (!extensions.containsKey(Configurer.class))
+ {
+ extensions.put(Configurer.class, new JBossWSConfigurer(new BeanCustomizer()));
+ }
+
+ Bus bus = new ExtensionManagerBus(extensions, properties);
+ possiblySetDefaultBus(bus);
+ initializeBus(bus);
+ return bus;
+ }
+
+ @Override
+ protected void initializeBus(Bus bus) {
+ super.initializeBus(bus);
+ }
+}
Property changes on: stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java (rev 0)
+++ stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf.client.configuration;
+
+import org.apache.cxf.configuration.spring.ConfigurerImpl;
+
+/**
+ * A CXF configurer (Spring based) that sets JBossWS stuff / customizations / properties etc. in CXF configurable beans
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 05-Oct-2009
+ */
+public class JBossWSSpringConfigurer extends ConfigurerImpl
+{
+ private BeanCustomizer customizer;
+
+ @Override
+ public void configureBean(Object beanInstance)
+ {
+ customConfigure(beanInstance);
+ super.configureBean(beanInstance);
+ }
+
+ @Override
+ public void configureBean(String name, Object beanInstance)
+ {
+ customConfigure(beanInstance);
+ super.configureBean(name, beanInstance);
+ }
+
+ protected synchronized void customConfigure(Object beanInstance)
+ {
+ if (customizer != null)
+ {
+ customizer.customize(beanInstance);
+ }
+ }
+
+ public BeanCustomizer getCustomizer()
+ {
+ return customizer;
+ }
+
+ public void setCustomizer(BeanCustomizer customizer)
+ {
+ this.customizer = customizer;
+ }
+}
Property changes on: stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/util/SpringUtils.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/util/SpringUtils.java (rev 0)
+++ stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/util/SpringUtils.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf.client.util;
+
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ *
+ */
+public class SpringUtils
+{
+ public static boolean isSpringAvailable()
+ {
+ try
+ {
+ Thread.currentThread().getContextClassLoader().loadClass("org.springframework.context.ApplicationContext");
+ return true;
+ }
+ catch (Exception e)
+ {
+ return false;
+ }
+ }
+}
Property changes on: stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/util/SpringUtils.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/cxf/branches/no-spring-support/modules/client/src/main/resources/META-INF/cxf/jbossws-cxf.xml
===================================================================
--- stack/cxf/branches/no-spring-support/modules/client/src/main/resources/META-INF/cxf/jbossws-cxf.xml 2010-06-17 09:31:35 UTC (rev 12493)
+++ stack/cxf/branches/no-spring-support/modules/client/src/main/resources/META-INF/cxf/jbossws-cxf.xml 2010-06-17 09:48:31 UTC (rev 12494)
@@ -45,7 +45,11 @@
<property name="bus" ref="cxf"/>
</bean>
- <bean id="org.apache.cxf.configuration.Configurer" class="org.jboss.wsf.stack.cxf.client.configuration.JBossWSCXFConfigurer"/>
+ <bean id="org.apache.cxf.configuration.Configurer" class="org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringConfigurer">
+ <property name="customizer">
+ <bean class="org.jboss.wsf.stack.cxf.client.configuration.BeanCustomizer"/>
+ </property>
+ </bean>
<bean id="org.apache.cxf.binding.BindingFactoryManager" class="org.apache.cxf.binding.BindingFactoryManagerImpl">
<property name="mapProvider">
Modified: stack/cxf/branches/no-spring-support/modules/endorsed/src/main/resources/META-INF/services/org.apache.cxf.bus.factory
===================================================================
--- stack/cxf/branches/no-spring-support/modules/endorsed/src/main/resources/META-INF/services/org.apache.cxf.bus.factory 2010-06-17 09:31:35 UTC (rev 12493)
+++ stack/cxf/branches/no-spring-support/modules/endorsed/src/main/resources/META-INF/services/org.apache.cxf.bus.factory 2010-06-17 09:48:31 UTC (rev 12494)
@@ -1 +1 @@
-org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory
\ No newline at end of file
+org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory
\ No newline at end of file
Added: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java (rev 0)
+++ stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.resource.ResourceManager;
+import org.apache.cxf.transport.servlet.CXFNonSpringServlet;
+import org.apache.cxf.transport.servlet.ServletContextResourceResolver;
+import org.apache.cxf.transport.servlet.ServletController;
+import org.apache.cxf.transport.servlet.ServletTransportFactory;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.stack.cxf.configuration.BusHolder;
+import org.jboss.wsf.stack.cxf.transport.ServletHelper;
+
+/**
+ * An extension to the CXFNonSpringServlet
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ *
+ */
+public class CXFNonSpringServletExt extends CXFNonSpringServlet
+{
+ protected Endpoint endpoint;
+
+ @Override
+ public ServletController createServletController(ServletConfig servletConfig)
+ {
+ ServletTransportFactory stf = (ServletTransportFactory)createServletTransportFactory();
+ return new ServletControllerExt(stf, servletConfig, servletConfig.getServletContext(), bus);
+ }
+
+ @Override
+ public void loadBus(ServletConfig servletConfig) throws ServletException {
+ //Init the Endpoint
+ endpoint = ServletHelper.initEndpoint(servletConfig, getServletName());
+
+ //keep the bus created during deployment and update it with the information coming from the servlet config
+ updateAvailableBusWithServletInfo(servletConfig);
+
+ //register the InstrumentManagementImpl
+ ServletHelper.registerInstrumentManger(bus, getServletContext());
+ }
+
+ private void updateAvailableBusWithServletInfo(ServletConfig servletConfig)
+ {
+ BusHolder holder = endpoint.getService().getDeployment().getAttachment(BusHolder.class);
+ //set the bus from deployment into the CXF servlet and assign it to the current thread
+ bus = holder.getBus();
+ BusFactory.possiblySetDefaultBus(bus);
+ //update the resource manager adding the ServletContextResourceResolver that was to be added by CXF servlet
+ ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
+ resourceManager.addResourceResolver(new ServletContextResourceResolver(servletConfig.getServletContext()));
+ replaceDestinationFactory();
+ //set up the ServletController as the CXF servlet would have done
+ controller = createServletController(servletConfig);
+ //set the controller in the servlet context now that the bus has been configured in the servlet
+ servletConfig.getServletContext().setAttribute(ServletController.class.getName(), getController());
+ }
+
+ @Override
+ protected void invoke(HttpServletRequest req, HttpServletResponse res) throws ServletException
+ {
+ ServletHelper.callRequestHandler(req, res, getServletContext(), getBus(), endpoint);
+ }
+}
Property changes on: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2010-06-17 09:31:35 UTC (rev 12493)
+++ stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -21,36 +21,20 @@
*/
package org.jboss.wsf.stack.cxf;
-import java.io.IOException;
-import java.lang.reflect.Method;
-
-import javax.management.ObjectName;
import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javax.xml.ws.WebServiceException;
-import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
-import org.apache.cxf.management.InstrumentationManager;
-import org.apache.cxf.management.counters.CounterRepository;
import org.apache.cxf.resource.ResourceManager;
import org.apache.cxf.transport.servlet.CXFServlet;
import org.apache.cxf.transport.servlet.ServletContextResourceResolver;
import org.apache.cxf.transport.servlet.ServletController;
import org.apache.cxf.transport.servlet.ServletTransportFactory;
-import org.jboss.wsf.common.ObjectNameFactory;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.EndpointAssociation;
-import org.jboss.wsf.spi.invocation.RequestHandler;
-import org.jboss.wsf.spi.management.EndpointRegistry;
-import org.jboss.wsf.spi.management.EndpointRegistryFactory;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
-import org.jboss.wsf.stack.cxf.management.InstrumentationManagerExtImpl;
+import org.jboss.wsf.stack.cxf.transport.ServletHelper;
/**
* An extension to the CXF servlet
@@ -60,8 +44,6 @@
*/
public class CXFServletExt extends CXFServlet
{
- public static final String ENABLE_CXF_MANAGEMENT = "enable.cxf.management";
-
protected Endpoint endpoint;
@Override
@@ -75,17 +57,13 @@
public void loadBus(ServletConfig servletConfig) throws ServletException
{
//Init the Endpoint
- initEndpoint(servletConfig);
+ endpoint = ServletHelper.initEndpoint(servletConfig, getServletName());
- ServletContext svCtx = getServletContext();
//keep the bus created during deployment and update it with the information coming from the servlet config
updateAvailableBusWithServletInfo(servletConfig);
//register the InstrumentManagementImpl
- //TODO!! remove reflection use inside this by providing proper hook in CXF and move this configuration to BusHolder
- if (svCtx.getInitParameter(ENABLE_CXF_MANAGEMENT) != null && "true".equalsIgnoreCase((String)svCtx.getInitParameter(ENABLE_CXF_MANAGEMENT))) {
- registerInstrumentManger(bus);
- }
+ ServletHelper.registerInstrumentManger(bus, getServletContext());
}
private void updateAvailableBusWithServletInfo(ServletConfig servletConfig)
@@ -104,94 +82,9 @@
servletConfig.getServletContext().setAttribute(ServletController.class.getName(), getController());
}
- private void initEndpoint(ServletConfig servletConfig)
- {
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- EndpointRegistry epRegistry = spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
-
- ServletContext context = servletConfig.getServletContext();
- String contextPath = context.getContextPath();
- endpoint = initServiceEndpoint(epRegistry, contextPath);
- }
-
@Override
protected void invoke(HttpServletRequest req, HttpServletResponse res) throws ServletException
{
- try
- {
- BusFactory.setThreadDefaultBus(getBus());
- //set the current endpoint into the threadlocal association that is later
- //used by the EndpointAssociationInterceptor for linking the message exchange
- //related to this invocation to the proper endpoint serving it (the bus, and
- //hence the interceptor, can span multiple invocation related to multiple
- //endpoints)
- EndpointAssociation.setEndpoint(endpoint);
- RequestHandler requestHandler = (RequestHandler)endpoint.getRequestHandler();
- requestHandler.handleHttpRequest(endpoint, req, res, getServletContext());
- }
- catch (IOException ioe)
- {
- throw new ServletException(ioe);
- }
- finally
- {
- EndpointAssociation.removeEndpoint();
- BusFactory.setThreadDefaultBus(null);
- }
+ ServletHelper.callRequestHandler(req, res, getServletContext(), getBus(), endpoint);
}
-
- /** Initialize the service endpoint
- */
- private Endpoint initServiceEndpoint(EndpointRegistry epRegistry, String contextPath)
- {
- if (contextPath.startsWith("/"))
- contextPath = contextPath.substring(1);
-
- Endpoint endpoint = null;
- String servletName = getServletName();
- for (ObjectName sepId : epRegistry.getEndpoints())
- {
- String propContext = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_CONTEXT);
- String propEndpoint = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_ENDPOINT);
- if (servletName.equals(propEndpoint) && contextPath.equals(propContext))
- {
- endpoint = epRegistry.getEndpoint(sepId);
- break;
- }
- }
-
- if (endpoint == null)
- {
- ObjectName oname = ObjectNameFactory.create(Endpoint.SEPID_DOMAIN + ":" + Endpoint.SEPID_PROPERTY_CONTEXT + "=" + contextPath + ","
- + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletName);
- throw new WebServiceException("Cannot obtain endpoint for: " + oname);
- }
-
- return endpoint;
- }
-
- private void registerInstrumentManger(Bus bus) throws ServletException
- {
- InstrumentationManagerExtImpl instrumentationManagerImpl = new InstrumentationManagerExtImpl();
- instrumentationManagerImpl.setBus(bus);
- instrumentationManagerImpl.setEnabled(true);
- instrumentationManagerImpl.initMBeanServer();
- instrumentationManagerImpl.register();
- bus.setExtension(instrumentationManagerImpl, InstrumentationManager.class);
-
- //attach couterRepository
- CounterRepository couterRepository = new CounterRepository();
- couterRepository.setBus(bus);
-
- try
- {
- Method method = CounterRepository.class.getDeclaredMethod("registerInterceptorsToBus", new Class[] {});
- method.setAccessible(true);
- method.invoke(couterRepository, new Object[] {});
- }
- catch (Exception e)
- {
- throw new ServletException(e);
- }
- }
}
Modified: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2010-06-17 09:31:35 UTC (rev 12493)
+++ stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -22,32 +22,18 @@
package org.jboss.wsf.stack.cxf.configuration;
import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
import org.apache.cxf.Bus;
import org.apache.cxf.binding.soap.SoapTransportFactory;
-import org.apache.cxf.bus.spring.BusApplicationContext;
import org.apache.cxf.configuration.Configurer;
import org.apache.cxf.resource.ResourceManager;
import org.apache.cxf.resource.ResourceResolver;
import org.apache.cxf.transport.DestinationFactory;
import org.apache.cxf.transport.DestinationFactoryManager;
-import org.apache.cxf.transport.servlet.ServletTransportFactory;
-import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.wsf.spi.binding.BindingCustomization;
-import org.jboss.wsf.stack.cxf.client.configuration.JBossWSCXFConfigurer;
-import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory;
import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
import org.jboss.wsf.stack.cxf.interceptor.EndpointAssociationInterceptor;
-import org.jboss.wsf.stack.cxf.spring.handler.NamespaceHandlerResolver;
-import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.GenericApplicationContext;
-import org.springframework.core.io.InputStreamResource;
/**
* A wrapper of the Bus for performing most of the configurations required on it by JBossWS
@@ -56,67 +42,32 @@
* @since 25-Mar-2010
*
*/
-public class BusHolder
+public abstract class BusHolder
{
- private static final Logger log = Logger.getLogger(BusHolder.class);
public static final String PARAM_CXF_BEANS_URL = "jbossws.cxf.beans.url";
- private boolean configured = false;
- protected BusApplicationContext ctx ;
- protected List<GenericApplicationContext> additionalCtx = new LinkedList<GenericApplicationContext>();
protected Bus bus;
- /**
- * Private constructor
- */
- private BusHolder()
+ public BusHolder()
{
- //NOP
+
}
- /**
- * Creates a new BusHolder instance; a new Bus is created using the
- * provided location for loading additional configurations
- *
- * @param location
- * @return
- */
- public static BusHolder create(URL location)
+ public BusHolder(Bus bus)
{
- BusHolder holder = new BusHolder();
- holder.createBus(location);
- return holder;
+ setBus(bus);
}
/**
- * Creates a new BusHolder instance using the provided Bus
- *
- * @param bus
- * @return
- */
- public static BusHolder create(Bus bus)
- {
- BusHolder holder = new BusHolder();
- holder.setBus(bus);
- holder.setContext(bus.getExtension(BusApplicationContext.class));
- return holder;
- }
-
- /**
* Update the Bus held by the this instance using the provided parameters.
* This basically prepares the bus for being used with JBossWS.
*
- * @param jbossCxfXml The location of the jboss-cxf.xml configuration file
* @param soapTransportFactory The SoapTransportFactory to configure, if any
* @param resolver The ResourceResolver to configure, if any
* @param configurer The JBossWSCXFConfigurer to install in the bus, if any
* @throws IOException Throws IOException if the jboss-cxf.xml file can't be read
*/
- public void configure(URL jbossCxfXml, SoapTransportFactory soapTransportFactory, ResourceResolver resolver, Configurer configurer) throws IOException
+ protected void configure(SoapTransportFactory soapTransportFactory, ResourceResolver resolver, Configurer configurer)
{
- if (configured)
- {
- throw new IllegalStateException("Underlying bus is already configured for JBossWS use!");
- }
if (configurer != null)
{
bus.setExtension(configurer, Configurer.class);
@@ -124,73 +75,26 @@
setInterceptors(bus);
setSoapTransportFactory(bus, soapTransportFactory);
setResourceResolver(bus, resolver);
- if (jbossCxfXml != null)
- {
- additionalCtx.add(loadAdditionalConfig(ctx, jbossCxfXml));
- }
- configured = true;
}
- /**
- * A convenient method for getting a jbossws cxf server configurer delegating to the
- * cxf configurer that's currently installed in the hold bus.
- *
- * @param customization The binding customization to set in the configurer, if any
- * @param wsdlPublisher The wsdl file publisher to set in the configurer, if any
- * @return The new jbossws cxf configurer
- */
- public Configurer createServerConfigurer(BindingCustomization customization, WSDLFilePublisher wsdlPublisher)
- {
- //the JBossWSCXFConfigurer should already be set through cxf-extensions-jbossws.xml
- ApplicationContext ctx = bus.getExtension(BusApplicationContext.class);
- JBossWSServerCXFConfigurer serverConfigurer = new JBossWSServerCXFConfigurer(ctx);
- serverConfigurer.setBindingCustomization(customization);
- serverConfigurer.setWsdlPublisher(wsdlPublisher);
- return serverConfigurer;
- }
/**
- * Performs close operations (currently implies destroying additional contexts)
+ * Performs close operations
*
*/
public void close()
{
- for (GenericApplicationContext gac : additionalCtx)
- {
- gac.destroy();
- }
+
}
/**
- * Creates the Bus using a SpringBusFactory with no specific Spring application context.
- * Then loads additional configurations from the provided location
+ * A convenient method for getting a jbossws cxf server configurer
*
- * @param location
- * @return
+ * @param customization The binding customization to set in the configurer, if any
+ * @param wsdlPublisher The wsdl file publisher to set in the configurer, if any
+ * @return The new jbossws cxf configurer
*/
- protected void createBus(URL location)
- {
- bus = new JBossWSSpringBusFactory().createBus();
- ctx = bus.getExtension(BusApplicationContext.class);
- //Load additional configurations from cxf-servlet.xml
- if (location != null)
- {
- try
- {
- additionalCtx.add(loadAdditionalConfig(ctx, location));
- }
- catch (IOException e)
- {
- if (log.isTraceEnabled())
- log.trace("Could not load additional config from location: " + location, e);
- }
- }
- //Force servlet transport to prevent CXF from using Jetty as a transport
- DestinationFactory factory = new ServletTransportFactory(bus);
- for (String s : factory.getTransportIds()) {
- registerTransport(factory, s);
- }
- }
+ public abstract Configurer createServerConfigurer(BindingCustomization customization, WSDLFilePublisher wsdlPublisher);
protected static void setInterceptors(Bus bus)
{
@@ -217,21 +121,8 @@
dfm.registerDestinationFactory(Constants.NS_SOAP12, factory);
}
}
-
- protected static GenericApplicationContext loadAdditionalConfig(ApplicationContext ctx, URL locationUrl) throws IOException
- {
- if (locationUrl == null) throw new IllegalArgumentException("Cannot load additional config from null location!");
- InputStream is = locationUrl.openStream();
- GenericApplicationContext childCtx = new GenericApplicationContext(ctx);
- XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(childCtx);
- reader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
- reader.setNamespaceHandlerResolver(new NamespaceHandlerResolver());
- reader.loadBeanDefinitions(new InputStreamResource(is));
- childCtx.refresh();
- return childCtx;
- }
- private void registerTransport(DestinationFactory factory, String namespace)
+ protected void registerTransport(DestinationFactory factory, String namespace)
{
bus.getExtension(DestinationFactoryManager.class).registerDestinationFactory(namespace, factory);
}
@@ -246,13 +137,8 @@
return bus;
}
- private void setBus(Bus bus)
+ protected void setBus(Bus bus)
{
this.bus = bus;
}
-
- private void setContext(BusApplicationContext ctx)
- {
- this.ctx = ctx;
- }
}
Deleted: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerCXFConfigurer.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerCXFConfigurer.java 2010-06-17 09:31:35 UTC (rev 12493)
+++ stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerCXFConfigurer.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -1,70 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf.configuration;
-
-import org.jboss.wsf.stack.cxf.client.configuration.JBossWSCXFConfigurer;
-import org.jboss.wsf.stack.cxf.deployment.EndpointImpl;
-import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
-import org.springframework.context.ApplicationContext;
-
-/**
- * A JBossWS CXF Configurer to be used on server side
- *
- * @author alessio.soldano(a)jboss.com
- * @author ema(a)redhat.com
- * @since 31-Mar-2010
- */
-public class JBossWSServerCXFConfigurer extends JBossWSCXFConfigurer
-{
- private WSDLFilePublisher wsdlPublisher;
-
- public JBossWSServerCXFConfigurer(ApplicationContext ctx)
- {
- setApplicationContext(ctx);
-
- }
-
- @Override
- protected void customConfigure(Object beanInstance)
- {
- if (beanInstance instanceof EndpointImpl)
- {
- configureEndpoint((EndpointImpl)beanInstance);
- }
- super.customConfigure(beanInstance);
- }
-
- protected synchronized void configureEndpoint(EndpointImpl endpoint)
- {
- //Configure wsdl file publisher
- if (wsdlPublisher != null)
- {
- endpoint.setWsdlPublisher(wsdlPublisher);
- }
- }
-
- public void setWsdlPublisher(WSDLFilePublisher wsdlPublisher)
- {
- this.wsdlPublisher = wsdlPublisher;
- }
-
-}
Added: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerSpringConfigurer.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerSpringConfigurer.java (rev 0)
+++ stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerSpringConfigurer.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf.configuration;
+
+import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringConfigurer;
+import org.springframework.context.ApplicationContext;
+
+/**
+ * A JBossWS CXF Configurer (Spring based) to be used on server side
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @author ema(a)redhat.com
+ * @since 31-Mar-2010
+ */
+public class JBossWSServerSpringConfigurer extends JBossWSSpringConfigurer
+{
+ public JBossWSServerSpringConfigurer(ApplicationContext ctx)
+ {
+ setApplicationContext(ctx);
+ }
+}
Property changes on: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerSpringConfigurer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java (rev 0)
+++ stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -0,0 +1,125 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf.configuration;
+
+import java.io.IOException;
+
+import javax.xml.ws.soap.SOAPBinding;
+
+import org.apache.cxf.binding.BindingConfiguration;
+import org.apache.cxf.binding.soap.SoapTransportFactory;
+import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.resource.ResourceResolver;
+import org.apache.cxf.service.invoker.Invoker;
+import org.apache.cxf.transport.DestinationFactory;
+import org.apache.cxf.transport.servlet.ServletTransportFactory;
+import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.jboss.wsf.stack.cxf.client.configuration.JBossWSConfigurer;
+import org.jboss.wsf.stack.cxf.client.configuration.JBossWSNonSpringBusFactory;
+import org.jboss.wsf.stack.cxf.deployment.EndpointImpl;
+import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
+import org.jboss.wsf.stack.cxf.metadata.services.DDBeans;
+import org.jboss.wsf.stack.cxf.metadata.services.DDEndpoint;
+
+/**
+ * A @see{org.jboss.wsf.stack.cxf.configuration.BusHolder} that
+ * does not use any Spring facilities.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ *
+ */
+public class NonSpringBusHolder extends BusHolder
+{
+ private boolean configured = false;
+
+ public NonSpringBusHolder()
+ {
+ super();
+ bus = new JBossWSNonSpringBusFactory().createBus();
+ //Force servlet transport to prevent CXF from using Jetty as a transport
+ DestinationFactory factory = new ServletTransportFactory(bus);
+ for (String s : factory.getTransportIds()) {
+ registerTransport(factory, s);
+ }
+ }
+
+ /**
+ * Update the Bus held by the this instance using the provided parameters.
+ * This basically prepares the bus for being used with JBossWS.
+ *
+ * @param jbossCxfXml The location of the jboss-cxf.xml configuration file
+ * @param soapTransportFactory The SoapTransportFactory to configure, if any
+ * @param resolver The ResourceResolver to configure, if any
+ * @param configurer The JBossWSCXFConfigurer to install in the bus, if any
+ * @throws IOException Throws IOException if the jboss-cxf.xml file can't be read
+ */
+ public void configure(DDBeans metadata, SoapTransportFactory soapTransportFactory, ResourceResolver resolver, Configurer configurer)
+ {
+ if (configured)
+ {
+ throw new IllegalStateException("Underlying bus is already configured for JBossWS use!");
+ }
+ super.configure(soapTransportFactory, resolver, configurer);
+
+ for (DDEndpoint dde : metadata.getEndpoints())
+ {
+ EndpointImpl endpoint = new EndpointImpl(bus, newInstance(dde.getImplementor()));
+ endpoint.setInvoker((Invoker)newInstance(dde.getInvoker()));
+ endpoint.setAddress(dde.getAddress());
+ endpoint.setEndpointName(dde.getPortName());
+ endpoint.setServiceName(dde.getServiceName());
+ endpoint.setWsdlLocation(dde.getWsdlLocation());
+ endpoint.publish();
+ if (dde.isMtomEnabled())
+ {
+ SOAPBinding binding = (SOAPBinding) endpoint.getBinding();
+ binding.setMTOMEnabled(true);
+ }
+ //TODO!! We need to stop the endpoint on undeployment
+ }
+ configured = true;
+ }
+
+ private static Object newInstance(String className)
+ {
+ try
+ {
+ Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass(className);
+ return clazz.newInstance();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public Configurer createServerConfigurer(BindingCustomization customization, WSDLFilePublisher wsdlPublisher)
+ {
+ ServerBeanCustomizer customizer = new ServerBeanCustomizer();
+ customizer.setBindingCustomization(customization);
+ customizer.setWsdlPublisher(wsdlPublisher);
+ return new JBossWSConfigurer(customizer);
+ }
+
+}
Property changes on: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java (rev 0)
+++ stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf.configuration;
+
+import org.jboss.wsf.stack.cxf.client.configuration.BeanCustomizer;
+import org.jboss.wsf.stack.cxf.deployment.EndpointImpl;
+import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ */
+public class ServerBeanCustomizer extends BeanCustomizer
+{
+ private WSDLFilePublisher wsdlPublisher;
+
+ @Override
+ public void customize(Object beanInstance)
+ {
+ if (beanInstance instanceof EndpointImpl)
+ {
+ configureEndpoint((EndpointImpl)beanInstance);
+ }
+ super.customize(beanInstance);
+ }
+
+ protected void configureEndpoint(EndpointImpl endpoint)
+ {
+ //Configure wsdl file publisher
+ if (wsdlPublisher != null)
+ {
+ endpoint.setWsdlPublisher(wsdlPublisher);
+ }
+ }
+
+ public void setWsdlPublisher(WSDLFilePublisher wsdlPublisher)
+ {
+ this.wsdlPublisher = wsdlPublisher;
+ }
+
+}
Property changes on: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java (rev 0)
+++ stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -0,0 +1,167 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf.configuration;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.binding.soap.SoapTransportFactory;
+import org.apache.cxf.bus.spring.BusApplicationContext;
+import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.resource.ResourceResolver;
+import org.apache.cxf.transport.DestinationFactory;
+import org.apache.cxf.transport.servlet.ServletTransportFactory;
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory;
+import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
+import org.jboss.wsf.stack.cxf.spring.handler.NamespaceHandlerResolver;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.core.io.InputStreamResource;
+
+/**
+ * A Spring-enabled version of @see{org.jboss.wsf.stack.cxf.configuration.BusHolder}
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ *
+ */
+public class SpringBusHolder extends BusHolder
+{
+ private static final Logger log = Logger.getLogger(BusHolder.class);
+ private boolean configured = false;
+ protected BusApplicationContext ctx ;
+ protected List<GenericApplicationContext> additionalCtx = new LinkedList<GenericApplicationContext>();
+
+ public SpringBusHolder(URL location)
+ {
+ super();
+ createBus(location);
+ }
+
+ /**
+ * Creates the Bus using a SpringBusFactory with no specific Spring application context.
+ * Then loads additional configurations from the provided location
+ *
+ * @param location
+ * @return
+ */
+ protected void createBus(URL location)
+ {
+ bus = new JBossWSSpringBusFactory().createBus();
+ ctx = bus.getExtension(BusApplicationContext.class);
+ //Load additional configurations from cxf-servlet.xml
+ if (location != null)
+ {
+ try
+ {
+ additionalCtx.add(loadAdditionalConfig(ctx, location));
+ }
+ catch (IOException e)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Could not load additional config from location: " + location, e);
+ }
+ }
+ //Force servlet transport to prevent CXF from using Jetty as a transport
+ DestinationFactory factory = new ServletTransportFactory(bus);
+ for (String s : factory.getTransportIds()) {
+ registerTransport(factory, s);
+ }
+ }
+
+ /**
+ * Update the Bus held by the this instance using the provided parameters.
+ * This basically prepares the bus for being used with JBossWS.
+ *
+ * @param jbossCxfXml The location of the jboss-cxf.xml configuration file
+ * @param soapTransportFactory The SoapTransportFactory to configure, if any
+ * @param resolver The ResourceResolver to configure, if any
+ * @param configurer The JBossWSCXFConfigurer to install in the bus, if any
+ * @throws IOException Throws IOException if the jboss-cxf.xml file can't be read
+ */
+ public void configure(URL jbossCxfXml, SoapTransportFactory soapTransportFactory, ResourceResolver resolver, Configurer configurer) throws IOException
+ {
+ if (configured)
+ {
+ throw new IllegalStateException("Underlying bus is already configured for JBossWS use!");
+ }
+ super.configure(soapTransportFactory, resolver, configurer);
+ if (jbossCxfXml != null)
+ {
+ additionalCtx.add(loadAdditionalConfig(ctx, jbossCxfXml));
+ }
+ configured = true;
+ }
+
+ @Override
+ public Configurer createServerConfigurer(BindingCustomization customization, WSDLFilePublisher wsdlPublisher)
+ {
+ ApplicationContext ctx = bus.getExtension(BusApplicationContext.class);
+ ServerBeanCustomizer customizer = new ServerBeanCustomizer();
+ customizer.setBindingCustomization(customization);
+ customizer.setWsdlPublisher(wsdlPublisher);
+ JBossWSServerSpringConfigurer serverConfigurer = new JBossWSServerSpringConfigurer(ctx);
+ serverConfigurer.setCustomizer(customizer);
+ return serverConfigurer;
+ }
+
+ protected static GenericApplicationContext loadAdditionalConfig(ApplicationContext ctx, URL locationUrl) throws IOException
+ {
+ if (locationUrl == null) throw new IllegalArgumentException("Cannot load additional config from null location!");
+ InputStream is = locationUrl.openStream();
+ GenericApplicationContext childCtx = new GenericApplicationContext(ctx);
+ XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(childCtx);
+ reader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
+ reader.setNamespaceHandlerResolver(new NamespaceHandlerResolver());
+ reader.loadBeanDefinitions(new InputStreamResource(is));
+ childCtx.refresh();
+ return childCtx;
+ }
+
+ /**
+ * Performs close operations (currently implies destroying additional contexts)
+ *
+ */
+ @Override
+ public void close()
+ {
+ for (GenericApplicationContext gac : additionalCtx)
+ {
+ gac.destroy();
+ }
+ super.close();
+ }
+
+ @Override
+ protected void setBus(Bus bus)
+ {
+ super.setBus(bus);
+ ctx = (bus.getExtension(BusApplicationContext.class));
+ }
+}
Property changes on: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2010-06-17 09:31:35 UTC (rev 12493)
+++ stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -34,7 +34,10 @@
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.ResourceResolver;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
+import org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder;
+import org.jboss.wsf.stack.cxf.configuration.SpringBusHolder;
import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
+import org.jboss.wsf.stack.cxf.metadata.services.DDBeans;
import org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver;
import org.jboss.wsf.stack.cxf.transport.SoapTransportFactoryExt;
@@ -50,7 +53,6 @@
@Override
public void start(Deployment dep)
{
- BusHolder holder;
ClassLoader origClassLoader = SecurityActions.getContextClassLoader();
try
{
@@ -59,30 +61,41 @@
SecurityActions.setContextClassLoader(dep.getRuntimeClassLoader());
ResourceResolver deploymentResolver = aDep.getResourceResolver();
-
- URL cxfServletURL = null;
- try
+ org.apache.cxf.resource.ResourceResolver resolver = new JBossWSResourceResolver(deploymentResolver);
+ Map<String, String> contextParams = (Map<String, String>)dep.getProperty(WSConstants.STACK_CONTEXT_PARAMS);
+ String jbosswsCxfXml = contextParams == null ? null : contextParams.get(BusHolder.PARAM_CXF_BEANS_URL);
+
+ if (jbosswsCxfXml != null) // Spring available
{
- cxfServletURL = deploymentResolver.resolve("WEB-INF/cxf-servlet.xml");
+ URL cxfServletURL = null;
+ try
+ {
+ cxfServletURL = deploymentResolver.resolve("WEB-INF/cxf-servlet.xml");
+ }
+ catch (IOException e)
+ {
+ } //ignore, cxf-servlet.xml is optional, we might even decide not to support this
+
+ SpringBusHolder holder = new SpringBusHolder(cxfServletURL);
+ try
+ {
+ Configurer configurer = holder.createServerConfigurer(dep.getAttachment(BindingCustomization.class), new WSDLFilePublisher(aDep));
+ holder.configure(deploymentResolver.resolve(jbosswsCxfXml), new SoapTransportFactoryExt(), resolver, configurer);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e); //re-throw, jboss-cxf.xml is required
+ }
+ dep.addAttachment(BusHolder.class, holder);
}
- catch (IOException e)
+ else //Spring not available
{
- } //ignore, cxf-servlet.xml is optional, we might even decide not to support this
-
- holder = BusHolder.create(cxfServletURL);
-
- Map<String, String> contextParams = (Map<String, String>)dep.getProperty(WSConstants.STACK_CONTEXT_PARAMS);
- try
- {
- URL jbossCxfXml = deploymentResolver.resolve(contextParams.get(BusHolder.PARAM_CXF_BEANS_URL));
- org.apache.cxf.resource.ResourceResolver resolver = new JBossWSResourceResolver(deploymentResolver);
+ DDBeans metadata = dep.getAttachment(DDBeans.class);
+ NonSpringBusHolder holder = new NonSpringBusHolder();
Configurer configurer = holder.createServerConfigurer(dep.getAttachment(BindingCustomization.class), new WSDLFilePublisher(aDep));
- holder.configure(jbossCxfXml, new SoapTransportFactoryExt(), resolver, configurer);
+ holder.configure(metadata, new SoapTransportFactoryExt(), resolver, configurer);
+ dep.addAttachment(BusHolder.class, holder);
}
- catch (IOException e)
- {
- throw new RuntimeException(e); //re-throw, jboss-cxf.xml is required
- }
}
finally
{
@@ -91,8 +104,6 @@
BusFactory.setThreadDefaultBus(null);
SecurityActions.setContextClassLoader(origClassLoader);
}
-
- dep.addAttachment(BusHolder.class, holder);
}
@Override
Modified: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2010-06-17 09:31:35 UTC (rev 12493)
+++ stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -32,6 +32,7 @@
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.stack.cxf.client.util.SpringUtils;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
import org.jboss.wsf.stack.cxf.metadata.MetadataBuilder;
import org.jboss.wsf.stack.cxf.metadata.services.DDBeans;
@@ -45,7 +46,7 @@
public class DescriptorDeploymentAspect extends AbstractDeploymentAspect
{
// provide logging
- private final Logger log = Logger.getLogger(DescriptorDeploymentAspect.class);
+ private static final Logger log = Logger.getLogger(DescriptorDeploymentAspect.class);
private String invokerEJB3;
private String invokerJSE;
@@ -63,16 +64,24 @@
@Override
public void start(Deployment dep)
{
- URL cxfURL = getCXFConfigFromClassLoader(dep);
- if (cxfURL == null)
+ if (SpringUtils.isSpringAvailable())
{
- cxfURL = getCXFConfigFromDeployment(dep);
+ URL cxfURL = getCXFConfigFromClassLoader(dep);
if (cxfURL == null)
{
- cxfURL = generateCXFConfigFromDeployment(dep);
+ cxfURL = getCXFConfigFromDeployment(dep);
+ if (cxfURL == null)
+ {
+ cxfURL = generateCXFConfigFromDeployment(dep);
+ }
+ putCXFConfigToDeployment(dep, cxfURL);
}
- putCXFConfigToDeployment(dep, cxfURL);
}
+ else
+ {
+ log.warn("Spring not available, skipping check for user provided jbossws-cxf.xml / cxf.xml configuration files.");
+ generateMetadataFromDeployment(dep);
+ }
}
@Override
@@ -155,16 +164,26 @@
private URL generateCXFConfigFromDeployment(Deployment dep)
{
// Generate the jbossws-cxf.xml descriptor
- MetadataBuilder builder = new MetadataBuilder();
- DDBeans dd = builder.build(dep, invokerEJB3, invokerJSE);
-
+ DDBeans dd = generateMetadataFromDeployment(dep);
URL cxfURL = dd.createFileURL();
log.info("JBossWS-CXF configuration generated: " + cxfURL);
- dep.addAttachment(DDBeans.class, dd);
return cxfURL;
}
+
+ /**
+ * Generates the jbossws-cxf metadata from the deployment
+ * @param dep
+ * @return
+ */
+ private DDBeans generateMetadataFromDeployment(Deployment dep)
+ {
+ MetadataBuilder builder = new MetadataBuilder();
+ DDBeans dd = builder.build(dep, invokerEJB3, invokerJSE);
+ dep.addAttachment(DDBeans.class, dd);
+ return dd;
+ }
/**
* Puts CXF config file reference to the stack specific context properties.
Added: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java (rev 0)
+++ stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -0,0 +1,150 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf.transport;
+
+import java.io.IOException;
+import java.lang.reflect.Method;
+
+import javax.management.ObjectName;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceException;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.management.InstrumentationManager;
+import org.apache.cxf.management.counters.CounterRepository;
+import org.jboss.wsf.common.ObjectNameFactory;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.EndpointAssociation;
+import org.jboss.wsf.spi.invocation.RequestHandler;
+import org.jboss.wsf.spi.management.EndpointRegistry;
+import org.jboss.wsf.spi.management.EndpointRegistryFactory;
+import org.jboss.wsf.stack.cxf.management.InstrumentationManagerExtImpl;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ *
+ */
+public class ServletHelper
+{
+ public static final String ENABLE_CXF_MANAGEMENT = "enable.cxf.management";
+
+ public static Endpoint initEndpoint(ServletConfig servletConfig, String servletName)
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ EndpointRegistry epRegistry = spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
+
+ ServletContext context = servletConfig.getServletContext();
+ String contextPath = context.getContextPath();
+ return initServiceEndpoint(epRegistry, contextPath, servletName);
+ }
+
+ /** Initialize the service endpoint
+ */
+ private static Endpoint initServiceEndpoint(EndpointRegistry epRegistry, String contextPath, String servletName)
+ {
+ if (contextPath.startsWith("/"))
+ contextPath = contextPath.substring(1);
+
+ Endpoint endpoint = null;
+ for (ObjectName sepId : epRegistry.getEndpoints())
+ {
+ String propContext = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_CONTEXT);
+ String propEndpoint = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_ENDPOINT);
+ if (servletName.equals(propEndpoint) && contextPath.equals(propContext))
+ {
+ endpoint = epRegistry.getEndpoint(sepId);
+ break;
+ }
+ }
+
+ if (endpoint == null)
+ {
+ ObjectName oname = ObjectNameFactory.create(Endpoint.SEPID_DOMAIN + ":" + Endpoint.SEPID_PROPERTY_CONTEXT + "=" + contextPath + ","
+ + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletName);
+ throw new WebServiceException("Cannot obtain endpoint for: " + oname);
+ }
+
+ return endpoint;
+ }
+
+ public static void callRequestHandler(HttpServletRequest req, HttpServletResponse res, ServletContext ctx, Bus bus, Endpoint endpoint) throws ServletException
+ {
+ try
+ {
+ BusFactory.setThreadDefaultBus(bus);
+ //set the current endpoint into the threadlocal association that is later
+ //used by the EndpointAssociationInterceptor for linking the message exchange
+ //related to this invocation to the proper endpoint serving it (the bus, and
+ //hence the interceptor, can span multiple invocation related to multiple
+ //endpoints)
+ EndpointAssociation.setEndpoint(endpoint);
+ RequestHandler requestHandler = (RequestHandler)endpoint.getRequestHandler();
+ requestHandler.handleHttpRequest(endpoint, req, res, ctx);
+ }
+ catch (IOException ioe)
+ {
+ throw new ServletException(ioe);
+ }
+ finally
+ {
+ EndpointAssociation.removeEndpoint();
+ BusFactory.setThreadDefaultBus(null);
+ }
+ }
+
+ public static void registerInstrumentManger(Bus bus, ServletContext svCtx) throws ServletException
+ {
+ //TODO!! Jim, remove reflection use inside this by providing proper hook in CXF and move this configuration to BusHolder
+ if (svCtx.getInitParameter(ENABLE_CXF_MANAGEMENT) != null && "true".equalsIgnoreCase((String)svCtx.getInitParameter(ENABLE_CXF_MANAGEMENT))) {
+ InstrumentationManagerExtImpl instrumentationManagerImpl = new InstrumentationManagerExtImpl();
+ instrumentationManagerImpl.setBus(bus);
+ instrumentationManagerImpl.setEnabled(true);
+ instrumentationManagerImpl.initMBeanServer();
+ instrumentationManagerImpl.register();
+ bus.setExtension(instrumentationManagerImpl, InstrumentationManager.class);
+
+ //attach couterRepository
+ CounterRepository couterRepository = new CounterRepository();
+ couterRepository.setBus(bus);
+
+ try
+ {
+ Method method = CounterRepository.class.getDeclaredMethod("registerInterceptorsToBus", new Class[] {});
+ method.setAccessible(true);
+ method.invoke(couterRepository, new Object[] {});
+ }
+ catch (Exception e)
+ {
+ throw new ServletException(e);
+ }
+ }
+ }
+}
Property changes on: stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endorse/Helper.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endorse/Helper.java 2010-06-17 09:31:35 UTC (rev 12493)
+++ stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endorse/Helper.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -22,7 +22,7 @@
package org.jboss.test.ws.jaxws.cxf.endorse;
import org.apache.cxf.BusFactory;
-import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory;
+import org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory;
import org.jboss.wsf.test.JBossWSTestHelper;
/**
@@ -37,8 +37,8 @@
{
//check BusFactory customization; this is required by the JBWS-CXF Configurer integration (HTTPConduit customization, JAXBIntros, ...)
BusFactory factory = BusFactory.newInstance();
- if (!(factory instanceof JBossWSSpringBusFactory))
- throw new RuntimeException("Expected " + JBossWSSpringBusFactory.class + " but got " + (factory == null ? null : factory.getClass()));
+ if (!(factory instanceof JBossWSBusFactory))
+ throw new RuntimeException("Expected " + JBossWSBusFactory.class + " but got " + (factory == null ? null : factory.getClass()));
//check the Apache CXF JAXWS implementation is actually used
if (!JBossWSTestHelper.isIntegrationCXF())
Modified: stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java
===================================================================
--- stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java 2010-06-17 09:31:35 UTC (rev 12493)
+++ stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java 2010-06-17 09:48:31 UTC (rev 12494)
@@ -36,7 +36,7 @@
import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.spi.binding.BindingCustomization;
import org.jboss.wsf.spi.binding.JAXBBindingCustomization;
-import org.jboss.wsf.stack.cxf.client.configuration.JBossWSCXFConfigurer;
+import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringConfigurer;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
import org.w3c.dom.Element;
@@ -54,7 +54,7 @@
private String endpointAddress = "http://" + getServerHost() + ":8080/jaxws-cxf-jaxbintros/EndpointService";
private Bus bus;
- private JBossWSCXFConfigurer configurer;
+ private JBossWSSpringConfigurer configurer;
public static Test suite()
{
@@ -109,7 +109,7 @@
}
/**
- * Client side uses the annotated user type class, server side uses the plain one but has jaxintros in place
+ * Client side uses the annotated user type class, server side uses the plain one but has jaxbintros in place
*
* @throws Exception
*/
@@ -141,13 +141,13 @@
BindingCustomizationFactory.populateBindingCustomization(getResourceURL("jaxws/cxf/jaxbintros/META-INF/jaxb-intros.xml").openStream(), jaxbCustomizations);
bus = BusFactory.getThreadDefaultBus();
- configurer = (JBossWSCXFConfigurer)bus.getExtension(Configurer.class);
- configurer.setBindingCustomization(jaxbCustomizations);
+ configurer = (JBossWSSpringConfigurer)bus.getExtension(Configurer.class);
+ configurer.getCustomizer().setBindingCustomization(jaxbCustomizations);
}
private void unsetBindingCustomizationOnClientSide()
{
if (configurer != null)
- configurer.setBindingCustomization(null);
+ configurer.getCustomizer().setBindingCustomization(null);
}
}
13 years, 10 months