JBossWS SVN: r18107 - spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-11-29 08:51:42 -0500 (Fri, 29 Nov 2013)
New Revision: 18107
Modified:
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java
Log:
Adding convenient method
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java 2013-11-28 17:57:18 UTC (rev 18106)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java 2013-11-29 13:51:42 UTC (rev 18107)
@@ -131,6 +131,14 @@
this.handlerChains = handlerChains;
}
+ public PortComponentMetaData(String portComponentName, QName wsdlPort, String serviceEndpointInterface,
+ String ejbLink, String servletLink, List<UnifiedHandlerMetaData> handlers, String contextRoot,
+ QName wsdlService, String protocolBinding, UnifiedHandlerChainsMetaData handlerChains)
+ {
+ this(portComponentName, wsdlPort, serviceEndpointInterface, ejbLink, servletLink, handlers, contextRoot,
+ false, false, "ALL", false, 0, false, wsdlService, protocolBinding, handlerChains);
+ }
+
public WebserviceDescriptionMetaData getWebserviceDescription()
{
return webserviceDescription;
11 years, 1 month
JBossWS SVN: r18106 - in spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi: metadata and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-11-28 12:57:18 -0500 (Thu, 28 Nov 2013)
New Revision: 18106
Modified:
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/management/ServerConfig.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/AbstractHandlerChainsMetaDataParser.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerChainMetaData.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerChainsMetaData.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedInitParamMetaData.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedStubPropertyMetaData.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/jms/JMSEndpointMetaData.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/jms/JMSEndpointsMetaData.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossPortComponentMetaData.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebserviceDescriptionMetaData.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesFactory.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesMetaData.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesMetaData.java
Log:
Making a bunch of metadata classes immutable
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/management/ServerConfig.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/management/ServerConfig.java 2013-11-28 17:53:20 UTC (rev 18105)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/management/ServerConfig.java 2013-11-28 17:57:18 UTC (rev 18106)
@@ -66,6 +66,12 @@
void setModifySOAPAddress(boolean flag);
+ /**
+ * Adds a provided endpoint config to the server configuration; the provided EndpoinConfig instance
+ * is cloned into a new instance which is actually stored in the server configuration.
+ *
+ * @param config
+ */
void addEndpointConfig(EndpointConfig config);
List<EndpointConfig> getEndpointConfigs();
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/AbstractHandlerChainsMetaDataParser.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/AbstractHandlerChainsMetaDataParser.java 2013-11-28 17:53:20 UTC (rev 18105)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/AbstractHandlerChainsMetaDataParser.java 2013-11-28 17:57:18 UTC (rev 18106)
@@ -39,6 +39,13 @@
import static org.jboss.wsf.spi.util.StAXUtils.elementAsString;
import static org.jboss.wsf.spi.util.StAXUtils.match;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
@@ -64,7 +71,7 @@
protected UnifiedHandlerChainsMetaData parseHandlerChains(XMLStreamReader reader, String nsUri,
String handlerChainsElementNS, String handlerChainsElementName) throws XMLStreamException
{
- UnifiedHandlerChainsMetaData handlerChains = new UnifiedHandlerChainsMetaData();
+ List<UnifiedHandlerChainMetaData> handlerChains = new LinkedList<UnifiedHandlerChainMetaData>();
while (reader.hasNext())
{
switch (reader.nextTag())
@@ -72,7 +79,7 @@
case XMLStreamConstants.END_ELEMENT : {
if (match(reader, handlerChainsElementNS, handlerChainsElementName))
{
- return handlerChains;
+ return new UnifiedHandlerChainsMetaData(handlerChains);
}
else
{
@@ -81,7 +88,7 @@
}
case XMLStreamConstants.START_ELEMENT : {
if (match(reader, nsUri, HANDLER_CHAIN)) {
- handlerChains.addHandlerChain(parseHandlerChain(reader, nsUri));
+ handlerChains.add(parseHandlerChain(reader, nsUri));
}
else
{
@@ -95,7 +102,10 @@
private UnifiedHandlerChainMetaData parseHandlerChain(XMLStreamReader reader, String nsUri) throws XMLStreamException
{
- UnifiedHandlerChainMetaData handlerChain = new UnifiedHandlerChainMetaData();
+ QName portNamePattern = null;
+ QName serviceNamePattern = null;
+ String protocolBindings = null;
+ List<UnifiedHandlerMetaData> handlers = new ArrayList<UnifiedHandlerMetaData>(4);
while (reader.hasNext())
{
switch (reader.nextTag())
@@ -103,7 +113,7 @@
case XMLStreamConstants.END_ELEMENT : {
if (match(reader, nsUri, HANDLER_CHAIN))
{
- return handlerChain;
+ return new UnifiedHandlerChainMetaData(serviceNamePattern, portNamePattern, protocolBindings, handlers, false, null);
}
else
{
@@ -113,18 +123,18 @@
case XMLStreamConstants.START_ELEMENT : {
if (match(reader, nsUri, CHAIN_PORT_PATTERN))
{
- handlerChain.setPortNamePattern(elementAsQName(reader));
+ portNamePattern = elementAsQName(reader);
}
else if (match(reader, nsUri, CHAIN_SERVICE_PATTERN))
{
- handlerChain.setServiceNamePattern(elementAsQName(reader));
+ serviceNamePattern = elementAsQName(reader);
}
else if(match(reader, nsUri, CHAIN_PROTOCOL_BINDING))
{
- handlerChain.setProtocolBindings(elementAsString(reader));
+ protocolBindings = elementAsString(reader);
}
else if (match(reader, nsUri, HANDLER)) {
- handlerChain.addHandler(parseHandler(reader, nsUri, handlerChain));
+ handlers.add(parseHandler(reader, nsUri));
}
else
{
@@ -138,12 +148,12 @@
protected UnifiedHandlerMetaData parseHandler(XMLStreamReader reader, String nsUri) throws XMLStreamException
{
- return parseHandler(reader, nsUri, null);
- }
-
- private UnifiedHandlerMetaData parseHandler(XMLStreamReader reader, String nsUri, UnifiedHandlerChainMetaData handlerChain) throws XMLStreamException
- {
- UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData(handlerChain);
+ String handlerName = null;
+ String handlerClass = null;
+ List<UnifiedInitParamMetaData> initParams = new LinkedList<UnifiedInitParamMetaData>();
+ Set<QName> soapHeaders = new HashSet<QName>(2);
+ Set<String> soapRoles = new HashSet<String>(2);
+ Set<String> portNames = new HashSet<String>(4);
while (reader.hasNext())
{
switch (reader.nextTag())
@@ -151,7 +161,7 @@
case XMLStreamConstants.END_ELEMENT : {
if (match(reader, nsUri, HANDLER))
{
- return handler;
+ return new UnifiedHandlerMetaData(handlerClass, handlerName, initParams, soapHeaders, soapRoles, portNames);
}
else
{
@@ -161,20 +171,20 @@
case XMLStreamConstants.START_ELEMENT : {
if (match(reader, nsUri, HANDLER_NAME))
{
- handler.setHandlerName(elementAsString(reader));
+ handlerName = elementAsString(reader);
}
else if (match(reader, nsUri, HANDLER_CLASS))
{
- handler.setHandlerClass(elementAsString(reader));
+ handlerClass = elementAsString(reader);
}
else if (match(reader, nsUri, HANDLER_PARAM)) {
- handler.addInitParam(parseInitParam(reader, nsUri));
+ initParams.add(parseInitParam(reader, nsUri));
}
else if (match(reader, nsUri, HANDLER_SOAP_ROLE)) {
- handler.addSoapRole(elementAsString(reader));
+ soapRoles.add(elementAsString(reader));
}
else if (match(reader, nsUri, HANDLER_SOAP_HEADER)) {
- handler.addSoapHeader(elementAsQName(reader));
+ soapHeaders.add(elementAsQName(reader));
}
else
{
@@ -188,7 +198,8 @@
private UnifiedInitParamMetaData parseInitParam(XMLStreamReader reader, String nsUri) throws XMLStreamException
{
- UnifiedInitParamMetaData initParam = new UnifiedInitParamMetaData();
+ String paramName = null;
+ String paramValue = null;
while (reader.hasNext())
{
switch (reader.nextTag())
@@ -196,7 +207,7 @@
case XMLStreamConstants.END_ELEMENT : {
if (match(reader, nsUri, HANDLER_PARAM))
{
- return initParam;
+ return new UnifiedInitParamMetaData(paramName, paramValue);
}
else
{
@@ -206,11 +217,11 @@
case XMLStreamConstants.START_ELEMENT : {
if (match(reader, nsUri, HANDLER_PARAM_NAME))
{
- initParam.setParamName(elementAsString(reader));
+ paramName = elementAsString(reader);
}
else if (match(reader, nsUri, HANDLER_PARAM_VALUE))
{
- initParam.setParamValue(elementAsString(reader));
+ paramValue = elementAsString(reader);
}
else
{
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerChainMetaData.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerChainMetaData.java 2013-11-28 17:53:20 UTC (rev 18105)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerChainMetaData.java 2013-11-28 17:57:18 UTC (rev 18106)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, 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.
*
@@ -22,27 +22,47 @@
package org.jboss.wsf.spi.metadata.j2ee.serviceref;
import java.io.Serializable;
-import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import javax.xml.namespace.QName;
/** The unified metadata data for a handler chain element
- *
+ *
* @author Thomas.Diesler(a)jboss.org
+ * @author alessio.soldano(a)jboss.com
*/
public class UnifiedHandlerChainMetaData implements Serializable
{
- private static final long serialVersionUID = 1L;
- private QName serviceNamePattern;
- private QName portNamePattern;
- private String protocolBindings;
- private List<UnifiedHandlerMetaData> handlers = new ArrayList<UnifiedHandlerMetaData>(4);
- private boolean excluded;
- private String id;
+ private static final long serialVersionUID = 4612021639718764949L;
+
+ private final QName serviceNamePattern;
+ private final QName portNamePattern;
+ private final String protocolBindings;
+ private final List<UnifiedHandlerMetaData> handlers;
+ private final boolean excluded;
+ private final String id;
- public UnifiedHandlerChainMetaData()
+ public UnifiedHandlerChainMetaData(QName serviceNamePattern,
+ QName portNamePattern,
+ String protocolBindings,
+ List<UnifiedHandlerMetaData> handlers,
+ boolean excluded,
+ String id)
{
+ this.serviceNamePattern = serviceNamePattern;
+ this.portNamePattern = portNamePattern;
+ this.protocolBindings = protocolBindings;
+ this.excluded = excluded;
+ this.id = id;
+ if (handlers != null && !handlers.isEmpty()) {
+ this.handlers = Collections.unmodifiableList(handlers);
+ for (UnifiedHandlerMetaData uhmd : handlers) {
+ uhmd.setHandlerChain(this);
+ }
+ } else {
+ this.handlers = Collections.emptyList();
+ }
}
public String getId()
@@ -50,56 +70,27 @@
return id;
}
- public void setId(final String id)
- {
- this.id = id;
- }
-
public QName getPortNamePattern()
{
return portNamePattern;
}
- public void setPortNamePattern(QName portNamePattern)
- {
- this.portNamePattern = portNamePattern;
- }
-
public QName getServiceNamePattern()
{
return serviceNamePattern;
}
- public void setServiceNamePattern(QName serviceNamePattern)
- {
- this.serviceNamePattern = serviceNamePattern;
- }
-
public String getProtocolBindings()
{
return protocolBindings;
}
- public void setProtocolBindings(String protocolBindings)
- {
- this.protocolBindings = protocolBindings;
- }
-
public List<UnifiedHandlerMetaData> getHandlers()
{
return handlers;
}
- public void addHandler(UnifiedHandlerMetaData handler)
- {
- handlers.add(handler);
- }
-
public boolean isExcluded() {
return this.excluded;
}
-
- public void setExcluded(boolean excluded) {
- this.excluded = excluded;
- }
}
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerChainsMetaData.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerChainsMetaData.java 2013-11-28 17:53:20 UTC (rev 18105)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerChainsMetaData.java 2013-11-28 17:57:18 UTC (rev 18106)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, 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.
*
@@ -22,30 +22,31 @@
package org.jboss.wsf.spi.metadata.j2ee.serviceref;
import java.io.Serializable;
-import java.util.LinkedList;
+import java.util.Collections;
import java.util.List;
/** The unified metadata data for a handler chains element
*
* @author Thomas.Diesler(a)jboss.org
+ * @author alessio.soldano(a)jboss.com
*/
public class UnifiedHandlerChainsMetaData implements Serializable
{
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = -4983482217732535558L;
+
+ private final List<UnifiedHandlerChainMetaData> handlerChains;
- private List<UnifiedHandlerChainMetaData> handlerChains = new LinkedList<UnifiedHandlerChainMetaData>();
-
- public UnifiedHandlerChainsMetaData()
+ public UnifiedHandlerChainsMetaData(List<UnifiedHandlerChainMetaData> handlerChains)
{
+ if (handlerChains != null && !handlerChains.isEmpty()) {
+ this.handlerChains = Collections.unmodifiableList(handlerChains);
+ } else {
+ this.handlerChains = Collections.emptyList();
+ }
}
public List<UnifiedHandlerChainMetaData> getHandlerChains()
{
return handlerChains;
}
-
- public void addHandlerChain(UnifiedHandlerChainMetaData handlerChain)
- {
- handlerChains.add(handlerChain);
- }
}
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java 2013-11-28 17:53:20 UTC (rev 18105)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java 2013-11-28 17:57:18 UTC (rev 18106)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, 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.
*
@@ -22,8 +22,7 @@
package org.jboss.wsf.spi.metadata.j2ee.serviceref;
import java.io.Serializable;
-import java.util.HashSet;
-import java.util.LinkedList;
+import java.util.Collections;
import java.util.List;
import java.util.Set;
@@ -33,48 +32,66 @@
* The unified metadata data for a handler element
*
* @author Thomas.Diesler(a)jboss.org
+ * @author alessio.soldano(a)jboss.com
*/
public class UnifiedHandlerMetaData implements Serializable
{
- private static final long serialVersionUID = 1L;
-
+ private static final long serialVersionUID = 1042008569778083467L;
+
public enum HandlerType
{
PRE, ENDPOINT, POST, ALL
}
- private UnifiedHandlerChainMetaData handlerChain;
+ private volatile UnifiedHandlerChainMetaData handlerChain;
// The required <handler-name> element
- private String handlerName;
+ private final String handlerName;
// The required <handler-class> element
- private String handlerClass;
+ private final String handlerClass;
// The optional <init-param> elements
- private List<UnifiedInitParamMetaData> initParams = new LinkedList<UnifiedInitParamMetaData>();
+ private final List<UnifiedInitParamMetaData> initParams;
// The optional <soap-header> elements
- private Set<QName> soapHeaders = new HashSet<QName>(2);
+ private final Set<QName> soapHeaders;
// The optional <soap-role> elements
- private Set<String> soapRoles = new HashSet<String>(2);
+ private final Set<String> soapRoles;
// The optional <port-name> elements, these only apply to webservice clients
- private Set<String> portNames = new HashSet<String>(4);
+ private final Set<String> portNames;
- public UnifiedHandlerMetaData(UnifiedHandlerChainMetaData handlerChain)
- {
- this.handlerChain = handlerChain;
+ public UnifiedHandlerMetaData(String handlerClass,
+ String handlerName,
+ List<UnifiedInitParamMetaData> initParams,
+ Set<QName> soapHeaders,
+ Set<String> soapRoles,
+ Set<String> portNames) {
+ this.handlerClass = handlerClass;
+ this.handlerName = handlerName;
+ this.initParams = initParams != null ? Collections.unmodifiableList(initParams) : null;
+ if (soapHeaders != null && !soapHeaders.isEmpty()) {
+ this.soapHeaders = Collections.unmodifiableSet(soapHeaders);
+ } else {
+ this.soapHeaders = Collections.emptySet();
+ }
+ if (soapRoles != null && !soapRoles.isEmpty()) {
+ this.soapRoles = Collections.unmodifiableSet(soapRoles);
+ } else {
+ this.soapRoles = Collections.emptySet();
+ }
+ if (portNames != null && !portNames.isEmpty()) {
+ this.portNames = Collections.unmodifiableSet(portNames);
+ } else {
+ this.portNames = Collections.emptySet();
+ }
}
- public UnifiedHandlerMetaData()
- {
- }
-
public UnifiedHandlerChainMetaData getHandlerChain()
{
return handlerChain;
}
-
- public void setHandlerName(String value)
+
+ protected void setHandlerChain(UnifiedHandlerChainMetaData handlerChain)
{
- this.handlerName = value;
+ this.handlerChain = handlerChain;
}
public String getHandlerName()
@@ -82,41 +99,21 @@
return handlerName;
}
- public void setHandlerClass(String handlerClass)
- {
- this.handlerClass = handlerClass;
- }
-
public String getHandlerClass()
{
return handlerClass;
}
- public void addInitParam(UnifiedInitParamMetaData param)
- {
- initParams.add(param);
- }
-
public List<UnifiedInitParamMetaData> getInitParams()
{
return initParams;
}
- public void addSoapHeader(QName qName)
- {
- soapHeaders.add(qName);
- }
-
public Set<QName> getSoapHeaders()
{
return soapHeaders;
}
- public void addSoapRole(String value)
- {
- soapRoles.add(value);
- }
-
public Set<String> getSoapRoles()
{
return soapRoles;
@@ -127,11 +124,6 @@
return portNames;
}
- public void addPortName(String value)
- {
- portNames.add(value);
- }
-
public String toString()
{
StringBuilder str = new StringBuilder();
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedInitParamMetaData.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedInitParamMetaData.java 2013-11-28 17:53:20 UTC (rev 18105)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedInitParamMetaData.java 2013-11-28 17:57:18 UTC (rev 18106)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, 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.
*
@@ -25,15 +25,18 @@
/**
* @author Thomas.Diesler(a)jboss.org
+ * @author alessio.soldano(a)jboss.com
+ *
* @since 06-May-2004
*/
public class UnifiedInitParamMetaData implements Serializable
{
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2508971618066360091L;
+
// The required <param-name> element
- private String paramName;
+ private final String paramName;
// The required <param-value> element
- private String paramValue;
+ private final String paramValue;
public UnifiedInitParamMetaData(String paramName, String paramValue)
{
@@ -41,30 +44,16 @@
this.paramValue = paramValue;
}
- public UnifiedInitParamMetaData()
- {
- }
-
public String getParamName()
{
return paramName;
}
- public void setParamName(String paramName)
- {
- this.paramName = paramName;
- }
-
public String getParamValue()
{
return paramValue;
}
- public void setParamValue(String paramValue)
- {
- this.paramValue = paramValue;
- }
-
public String toString()
{
return "[name=" + paramName + ",value=" + paramValue + "]";
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedStubPropertyMetaData.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedStubPropertyMetaData.java 2013-11-28 17:53:20 UTC (rev 18105)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedStubPropertyMetaData.java 2013-11-28 17:57:18 UTC (rev 18106)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, 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.
*
@@ -25,36 +25,33 @@
/**
* @author Thomas.Diesler(a)jboss.org
+ * @author alessio.soldano(a)jboss.com
* @since 06-May-2004
*/
public class UnifiedStubPropertyMetaData implements Serializable
{
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = -4584869798181720949L;
// The required <prop-name> element
- private String propName;
+ private final String propName;
// The required <prop-value> element
- private String propValue;
+ private final String propValue;
+
+ public UnifiedStubPropertyMetaData(String propName, String propValue)
+ {
+ this.propName = propName;
+ this.propValue = propValue;
+ }
public String getPropName()
{
return propName;
}
- public void setPropName(String paramName)
- {
- this.propName = paramName;
- }
-
public String getPropValue()
{
return propValue;
}
- public void setPropValue(String paramValue)
- {
- this.propValue = paramValue;
- }
-
public String toString()
{
return "[name=" + propName + ",value=" + propValue + "]";
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/jms/JMSEndpointMetaData.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/jms/JMSEndpointMetaData.java 2013-11-28 17:53:20 UTC (rev 18105)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/jms/JMSEndpointMetaData.java 2013-11-28 17:57:18 UTC (rev 18106)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, 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.
*
@@ -24,35 +24,43 @@
/**
* JMS Meta data class contains the implementor and address information
* @author <a href="ema(a)redhat.com">Jim Ma</a>
+ * @author <a href="alessio.soldano(a)jboss.com">Alessio Soldano</a>
*/
public class JMSEndpointMetaData
{
//Endpoint name
- private String name;
-
+ private final String name;
//port name
- private String endpointName = "";
-
+ private final String endpointName;
//implementor class
- private String implementor = "";
-
+ private final String implementor;
//wsdl location
- private String wsdlLocation = "";
-
- private String soapAddress = "";
-
+ private final String wsdlLocation;
+ private final String soapAddress;
//parent component
- private JMSEndpointsMetaData endpointsMetaData = null;
-
- public JMSEndpointMetaData(JMSEndpointsMetaData endpoints)
+ private volatile JMSEndpointsMetaData endpointsMetaData;
+
+ public JMSEndpointMetaData(String name, String endpointName, String implementor, String wsdlLocation,
+ String soapAddress)
{
- endpointsMetaData = endpoints;
+ this.name = name;
+ this.endpointName = endpointName;
+ this.implementor = implementor;
+ this.wsdlLocation = wsdlLocation;
+ this.soapAddress = soapAddress;
}
public JMSEndpointsMetaData getParentMetaData()
{
return endpointsMetaData;
}
+
+ public void setParentMetaData(JMSEndpointsMetaData endpointsMetaData) {
+ if (endpointsMetaData != null) {
+ throw new IllegalStateException();
+ }
+ this.endpointsMetaData = endpointsMetaData;
+ }
public String getImplementor()
{
@@ -74,34 +82,8 @@
return wsdlLocation;
}
- public void setImplementor(String implementor)
- {
- this.implementor = implementor;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public void setEndpointName(String endpointName)
- {
- this.endpointName = endpointName;
- }
-
- public void setWsdlLocation(String wsdlLocation)
- {
- this.wsdlLocation = wsdlLocation;
- }
-
public String getSoapAddress()
{
return soapAddress;
}
-
- public void setSoapAddress(String soapAddress)
- {
- this.soapAddress = soapAddress;
- }
-
}
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/jms/JMSEndpointsMetaData.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/jms/JMSEndpointsMetaData.java 2013-11-28 17:53:20 UTC (rev 18105)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/jms/JMSEndpointsMetaData.java 2013-11-28 17:57:18 UTC (rev 18106)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, 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,22 +21,26 @@
*/
package org.jboss.wsf.spi.metadata.jms;
-import java.util.LinkedList;
+import java.util.Collections;
import java.util.List;
/**
* @author <a href="ema(a)redhat.com">Jim Ma</a>
+ * @author <a href="alessio.soldano(a)jboss.com">Alessio Soldano</a>
*/
public final class JMSEndpointsMetaData
{
-
- private List<JMSEndpointMetaData> jmsEndpointsMD = new LinkedList<JMSEndpointMetaData>();
-
- public void addEndpointMetaData(JMSEndpointMetaData endpointMetaData)
+ private final List<JMSEndpointMetaData> jmsEndpointsMD;
+
+ public JMSEndpointsMetaData(List<JMSEndpointMetaData> jmsEndpointsMD)
{
- jmsEndpointsMD.add(endpointMetaData);
+ if (jmsEndpointsMD != null && !jmsEndpointsMD.isEmpty()) {
+ this.jmsEndpointsMD = Collections.unmodifiableList(jmsEndpointsMD);
+ } else {
+ this.jmsEndpointsMD = Collections.emptyList();
+ }
}
-
+
public List<JMSEndpointMetaData> getEndpointsMetaData() {
return jmsEndpointsMD;
}
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossPortComponentMetaData.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossPortComponentMetaData.java 2013-11-28 17:53:20 UTC (rev 18105)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossPortComponentMetaData.java 2013-11-28 17:57:18 UTC (rev 18106)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., and individual contributors
+ * Copyright 2013, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -24,60 +24,48 @@
/**
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
*/
public final class JBossPortComponentMetaData {
- private String ejbName;
- private String portComponentName;
- private String portComponentURI;
- private String authMethod;
- private String transportGuarantee;
- private Boolean secureWSDLAccess;
+ private final String ejbName;
+ private final String portComponentName;
+ private final String portComponentURI;
+ private final String authMethod;
+ private final String transportGuarantee;
+ private final Boolean secureWSDLAccess;
- public void setEjbName(String ejbName) {
- this.ejbName = ejbName;
- }
+ public JBossPortComponentMetaData(String ejbName, String portComponentName, String portComponentURI,
+ String authMethod, String transportGuarantee, Boolean secureWSDLAccess)
+ {
+ this.ejbName = ejbName;
+ this.portComponentName = portComponentName;
+ this.portComponentURI = portComponentURI;
+ this.authMethod = authMethod;
+ this.transportGuarantee = transportGuarantee;
+ this.secureWSDLAccess = secureWSDLAccess;
+ }
public String getEjbName() {
return ejbName;
}
- public void setPortComponentName(String portComponentName) {
- this.portComponentName = portComponentName;
- }
-
public String getPortComponentName() {
return portComponentName;
}
- public void setPortComponentURI(String portComponentURI) {
- this.portComponentURI = portComponentURI;
- }
-
public String getPortComponentURI() {
return portComponentURI;
}
- public void setAuthMethod(String authMethod) {
- this.authMethod = authMethod;
- }
-
public String getAuthMethod() {
return authMethod;
}
- public void setTransportGuarantee(String transportGuarantee) {
- this.transportGuarantee = transportGuarantee;
- }
-
public String getTransportGuarantee() {
return transportGuarantee;
}
- public void setSecureWSDLAccess(Boolean secureWSDLAccess) {
- this.secureWSDLAccess = secureWSDLAccess;
- }
-
public Boolean getSecureWSDLAccess() {
return secureWSDLAccess;
}
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebserviceDescriptionMetaData.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebserviceDescriptionMetaData.java 2013-11-28 17:53:20 UTC (rev 18105)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebserviceDescriptionMetaData.java 2013-11-28 17:57:18 UTC (rev 18106)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, 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.
*
@@ -24,26 +24,27 @@
/**
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
*/
-public final class JBossWebserviceDescriptionMetaData {
+public final class JBossWebserviceDescriptionMetaData
+{
+ private final String webserviceDescriptionName;
+ private final String wsdlPublishLocation;
- private String webserviceDescriptionName;
- private String wsdlPublishLocation;
+ public JBossWebserviceDescriptionMetaData(String webserviceDescriptionName, String wsdlPublishLocation)
+ {
+ this.webserviceDescriptionName = webserviceDescriptionName;
+ this.wsdlPublishLocation = wsdlPublishLocation;
+ }
- public void setWsdlPublishLocation(final String wsdlPublishLocation) {
- this.wsdlPublishLocation = wsdlPublishLocation;
- }
+ public String getWsdlPublishLocation()
+ {
+ return wsdlPublishLocation;
+ }
- public String getWsdlPublishLocation() {
- return wsdlPublishLocation;
- }
+ public String getWebserviceDescriptionName()
+ {
+ return webserviceDescriptionName;
+ }
- public void setWebserviceDescriptionName(final String webserviceDescriptionName) {
- this.webserviceDescriptionName = webserviceDescriptionName;
- }
-
- public String getWebserviceDescriptionName() {
- return webserviceDescriptionName;
- }
-
}
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesFactory.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesFactory.java 2013-11-28 17:53:20 UTC (rev 18105)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesFactory.java 2013-11-28 17:57:18 UTC (rev 18106)
@@ -50,6 +50,10 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
@@ -165,29 +169,34 @@
private JBossWebservicesMetaData parseWebservices(final XMLStreamReader reader, final String nsUri, final URL descriptorURL)
throws XMLStreamException {
- JBossWebservicesMetaData metadata = new JBossWebservicesMetaData(descriptorURL);
+ String contextRoot = null;
+ String configName = null;
+ String configFile = null;
+ List<JBossPortComponentMetaData> jpcmds = new LinkedList<JBossPortComponentMetaData>();
+ List<JBossWebserviceDescriptionMetaData> jwsdmds = new LinkedList<JBossWebserviceDescriptionMetaData>();
+ Map<String, String> props = new HashMap<String, String>();
while (reader.hasNext()) {
switch (reader.nextTag()) {
case XMLStreamConstants.END_ELEMENT: {
if (match(reader, nsUri, WEBSERVICES)) {
- return metadata;
+ return new JBossWebservicesMetaData(contextRoot, configName, configFile, descriptorURL, props, jpcmds, jwsdmds);
} else {
throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(), reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT: {
if (match(reader, nsUri, CONTEXT_ROOT)) {
- metadata.setContextRoot(getElementText(reader));
+ contextRoot = getElementText(reader);
} else if (match(reader, nsUri, CONFIG_NAME)) {
- metadata.setConfigName(getElementText(reader));
+ configName = getElementText(reader);
} else if (match(reader, nsUri, CONFIG_FILE)) {
- metadata.setConfigFile(getElementText(reader));
+ configFile = getElementText(reader);
} else if (match(reader, nsUri, PROPERTY)) {
- parseProperty(reader, nsUri, metadata);
+ parseProperty(reader, nsUri, props);
} else if (match(reader, nsUri, PORT_COMPONENT)) {
- metadata.addPortComponent(parsePortComponent(reader, nsUri));
+ jpcmds.add(parsePortComponent(reader, nsUri));
} else if (match(reader, nsUri, WEBSERVICE_DESCRIPTION)) {
- metadata.addWebserviceDescription(parseWebserviceDescription(reader, nsUri));
+ jwsdmds.add(parseWebserviceDescription(reader, nsUri));
} else {
throw MESSAGES.unexpectedElement(getDescriptorForLogs(), reader.getLocalName());
}
@@ -198,29 +207,35 @@
}
private JBossPortComponentMetaData parsePortComponent(XMLStreamReader reader, String nsUri) throws XMLStreamException {
- JBossPortComponentMetaData pc = new JBossPortComponentMetaData();
+ String ejbName = null;
+ String portComponentName = null;
+ String portComponentURI = null;
+ String authMethod = null;
+ String transportGuarantee = null;
+ Boolean secureWsdlAccess = null;
while (reader.hasNext()) {
switch (reader.nextTag()) {
case XMLStreamConstants.END_ELEMENT: {
if (match(reader, nsUri, PORT_COMPONENT)) {
- return pc;
+ return new JBossPortComponentMetaData(ejbName, portComponentName, portComponentURI,
+ authMethod, transportGuarantee, secureWsdlAccess);
} else {
throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(), reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT: {
if (match(reader, nsUri, EJB_NAME)) {
- pc.setEjbName(getElementText(reader));
+ ejbName = getElementText(reader);
} else if (match(reader, nsUri, PORT_COMPONENT_NAME)) {
- pc.setPortComponentName(getElementText(reader));
+ portComponentName = getElementText(reader);
} else if (match(reader, nsUri, PORT_COMPONENT_URI)) {
- pc.setPortComponentURI(getElementText(reader));
+ portComponentURI = getElementText(reader);
} else if (match(reader, nsUri, AUTH_METHOD)) {
- pc.setAuthMethod(getElementText(reader));
+ authMethod = getElementText(reader);
} else if (match(reader, nsUri, TRANSPORT_GUARANTEE)) {
- pc.setTransportGuarantee(getElementText(reader));
+ transportGuarantee = getElementText(reader);
} else if (match(reader, nsUri, SECURE_WSDL_ACCESS)) {
- pc.setSecureWSDLAccess(elementAsBoolean(reader));
+ secureWsdlAccess = elementAsBoolean(reader);
} else {
throw MESSAGES.unexpectedElement(getDescriptorForLogs(), reader.getLocalName());
}
@@ -232,21 +247,22 @@
private JBossWebserviceDescriptionMetaData parseWebserviceDescription(XMLStreamReader reader, String nsUri)
throws XMLStreamException {
- JBossWebserviceDescriptionMetaData description = new JBossWebserviceDescriptionMetaData();
+ String webserviceDescriptionName = null;
+ String wsdlPublishLocation = null;
while (reader.hasNext()) {
switch (reader.nextTag()) {
case XMLStreamConstants.END_ELEMENT: {
if (match(reader, nsUri, WEBSERVICE_DESCRIPTION)) {
- return description;
+ return new JBossWebserviceDescriptionMetaData(webserviceDescriptionName, wsdlPublishLocation);
} else {
throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(), reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT: {
if (match(reader, nsUri, WEBSERVICE_DESCRIPTION_NAME)) {
- description.setWebserviceDescriptionName(getElementText(reader));
+ webserviceDescriptionName = getElementText(reader);
} else if (match(reader, nsUri, WSDL_PUBLISH_LOCATION)) {
- description.setWsdlPublishLocation(getElementText(reader));
+ wsdlPublishLocation = getElementText(reader);
} else {
throw MESSAGES.unexpectedElement(getDescriptorForLogs(), reader.getLocalName());
}
@@ -256,7 +272,7 @@
throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
- private void parseProperty(XMLStreamReader reader, String nsUri, JBossWebservicesMetaData metadata) throws XMLStreamException
+ private void parseProperty(XMLStreamReader reader, String nsUri, Map<String, String> map) throws XMLStreamException
{
String name = null;
String value = null;
@@ -271,7 +287,7 @@
{
throw MESSAGES.couldNotGetPropertyName(getDescriptorForLogs());
}
- metadata.setProperty(name, value);
+ map.put(name, value);
return;
}
else
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesMetaData.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesMetaData.java 2013-11-28 17:53:20 UTC (rev 18105)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesMetaData.java 2013-11-28 17:57:18 UTC (rev 18106)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., and individual contributors
+ * Copyright 2013, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -23,86 +23,81 @@
package org.jboss.wsf.spi.metadata.webservices;
import java.net.URL;
-import java.util.HashMap;
-import java.util.LinkedList;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
*/
public final class JBossWebservicesMetaData {
- private String contextRoot;
-
- private String configName;
-
- private String configFile;
+ private final String contextRoot;
+ private final String configName;
+ private final String configFile;
+ private final Map<String, String> properties;
+ private final List<JBossPortComponentMetaData> portComponents;
+ private final List<JBossWebserviceDescriptionMetaData> webserviceDescriptions;
+ private final URL descriptorURL;
- private Map<String, String> properties = new HashMap<String, String>();
-
- private List<JBossPortComponentMetaData> portComponents = new LinkedList<JBossPortComponentMetaData>();
-
- private List<JBossWebserviceDescriptionMetaData> webserviceDescriptions = new LinkedList<JBossWebserviceDescriptionMetaData>();
-
- private URL descriptorURL;
-
- public JBossWebservicesMetaData(final URL descriptorURL) {
- this.descriptorURL = descriptorURL;
+ public JBossWebservicesMetaData(String contextRoot,
+ String configName,
+ String configFile,
+ URL descriptorURL,
+ Map<String, String> properties,
+ List<JBossPortComponentMetaData> portComponents,
+ List<JBossWebserviceDescriptionMetaData> webserviceDescriptions)
+ {
+ this.contextRoot = contextRoot;
+ this.configName = configName;
+ this.configFile = configFile;
+ this.descriptorURL = descriptorURL;
+ if (properties != null && !properties.isEmpty()) {
+ this.properties = Collections.unmodifiableMap(properties);
+ } else {
+ this.properties = Collections.emptyMap();
+ }
+ if (portComponents != null && !portComponents.isEmpty()) {
+ this.portComponents = Collections.unmodifiableList(portComponents);
+ } else {
+ this.portComponents = Collections.emptyList();
+ }
+ if (webserviceDescriptions != null && !webserviceDescriptions.isEmpty()) {
+ this.webserviceDescriptions = Collections.unmodifiableList(webserviceDescriptions);
+ } else {
+ this.webserviceDescriptions = Collections.emptyList();
+ }
}
public URL getDescriptorURL() {
return descriptorURL;
}
- public void setContextRoot(final String contextRoot) {
- this.contextRoot = contextRoot;
- }
-
public String getContextRoot() {
return contextRoot;
}
- public void setConfigName(final String configName) {
- this.configName = configName;
- }
-
public String getConfigName() {
return configName;
}
- public void setConfigFile(final String configFile) {
- this.configFile = configFile;
- }
-
public String getConfigFile() {
return configFile;
}
- public void addPortComponent(final JBossPortComponentMetaData portComponent) {
- portComponents.add(portComponent);
- }
-
public JBossPortComponentMetaData[] getPortComponents() {
final JBossPortComponentMetaData[] array = new JBossPortComponentMetaData[portComponents.size()];
portComponents.toArray(array);
return array;
}
- public void addWebserviceDescription(final JBossWebserviceDescriptionMetaData webserviceDescriptionMD) {
- webserviceDescriptions.add(webserviceDescriptionMD);
- }
-
public JBossWebserviceDescriptionMetaData[] getWebserviceDescriptions() {
final JBossWebserviceDescriptionMetaData[] array = new JBossWebserviceDescriptionMetaData[webserviceDescriptions.size()];
webserviceDescriptions.toArray(array);
return array;
}
- public void setProperty(String name, String value) {
- properties.put(name, value);
- }
-
public String getProperty(String name) {
return properties.get(name);
}
@@ -110,5 +105,4 @@
public Map<String, String> getProperties() {
return properties;
}
-
}
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java 2013-11-28 17:53:20 UTC (rev 18105)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java 2013-11-28 17:57:18 UTC (rev 18106)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, 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,7 +21,7 @@
*/
package org.jboss.wsf.spi.metadata.webservices;
-import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import javax.xml.namespace.QName;
@@ -40,6 +40,7 @@
* <p/>
*
* @author Thomas.Diesler(a)jboss.org
+ * @author alessio.soldano(a)jboss.com
* @since 15-April-2004
*/
public class PortComponentMetaData
@@ -50,109 +51,121 @@
public static final String PARAMETER_WEBSERVICE_ID = "webserviceID";
// The parent <webservice-description> element
- private WebserviceDescriptionMetaData webserviceDescription;
+ private volatile WebserviceDescriptionMetaData webserviceDescription;
/** The required <port-component-name> element
* This name bears no relationship to the WSDL port name.
* This name must be unique amongst all port component names in a module.
*/
- private String portComponentName;
+ private final String portComponentName;
// The required <wsdl-port> element
- private QName wsdlPort;
+ private final QName wsdlPort;
// The required <service-endpoint-interface> element
- private String serviceEndpointInterface;
+ private final String serviceEndpointInterface;
// The required <ejb-link> or <servlet-link> in the <service-impl-bean> element
- private String ejbLink;
- private String servletLink;
+ private final String ejbLink;
+ private final String servletLink;
// The optional <handler> elements
- private List<UnifiedHandlerMetaData> handlers = new ArrayList<UnifiedHandlerMetaData>(2);
+ private final List<UnifiedHandlerMetaData> handlers;
// The HTTP context root
- private String contextRoot;
+ private final String contextRoot;
// -----------------------------------------
// JAX-WS additions
// The optional <adressing> element
- private boolean addressingEnabled;
- private boolean addressingRequired;
- private String addressingResponses = "ALL";
+ private final boolean addressingEnabled;
+ private final boolean addressingRequired;
+ private final String addressingResponses;
// The optional <enable-mtom> element
- private boolean mtomEnabled;
+ private final boolean mtomEnabled;
// The optional <mtom-threshold> element
- private int mtomThreshold;
+ private final int mtomThreshold;
// @RespectBinding annotation metadata
- private boolean respectBindingEnabled;
- private QName wsdlService;
- private String protocolBinding;
- private UnifiedHandlerChainsMetaData handlerChains;
+ private final boolean respectBindingEnabled;
+ private final QName wsdlService;
+ private final String protocolBinding;
+ private final UnifiedHandlerChainsMetaData handlerChains;
-
- /** Construct a new PortComponentMetaData for a given WebserviceDescriptionMetaData
- */
- public PortComponentMetaData(WebserviceDescriptionMetaData webserviceDescription)
+ public PortComponentMetaData(String portComponentName,
+ QName wsdlPort,
+ String serviceEndpointInterface,
+ String ejbLink,
+ String servletLink,
+ List<UnifiedHandlerMetaData> handlers,
+ String contextRoot,
+ boolean addressingEnabled,
+ boolean addressingRequired,
+ String addressingResponses,
+ boolean mtomEnabled,
+ int mtomThreshold,
+ boolean respectBindingEnabled,
+ QName wsdlService,
+ String protocolBinding,
+ UnifiedHandlerChainsMetaData handlerChains)
{
- this.webserviceDescription = webserviceDescription;
+ this.portComponentName = portComponentName;
+ if (wsdlPort.getNamespaceURI().length() == 0)
+ Loggers.METADATA_LOGGER.webservicesXmlElementNotNamespaceQualified(wsdlPort);
+ this.wsdlPort = wsdlPort;
+ this.serviceEndpointInterface = serviceEndpointInterface;
+ this.ejbLink = ejbLink;
+ this.servletLink = servletLink;
+ if (handlers != null && !handlers.isEmpty()) {
+ this.handlers = Collections.unmodifiableList(handlers);
+ } else {
+ this.handlers = Collections.emptyList();
+ }
+ this.contextRoot = contextRoot;
+ this.addressingEnabled = addressingEnabled;
+ this.addressingRequired = addressingRequired;
+ if (!"ANONYMOUS".equals(addressingResponses) && !"NON_ANONYMOUS".equals(addressingResponses) && !"ALL".equals(addressingResponses))
+ throw Messages.MESSAGES.unsupportedAddressingResponseType(addressingResponses);
+ this.addressingResponses = addressingResponses;
+ this.mtomEnabled = mtomEnabled;
+ this.mtomThreshold = mtomThreshold;
+ this.respectBindingEnabled = respectBindingEnabled;
+ this.wsdlService = wsdlService;
+ this.protocolBinding = protocolBinding;
+ this.handlerChains = handlerChains;
}
public WebserviceDescriptionMetaData getWebserviceDescription()
{
return webserviceDescription;
}
+
+ protected void setWebserviceDescription(WebserviceDescriptionMetaData webserviceDescription)
+ {
+ this.webserviceDescription = webserviceDescription;
+ }
public String getPortComponentName()
{
return portComponentName;
}
- public void setPortComponentName(String portComponentName)
- {
- this.portComponentName = portComponentName;
- }
-
public QName getWsdlPort()
{
return wsdlPort;
}
- public void setWsdlPort(QName wsdlPort)
- {
- if (wsdlPort.getNamespaceURI().length() == 0)
- Loggers.METADATA_LOGGER.webservicesXmlElementNotNamespaceQualified(wsdlPort);
-
- this.wsdlPort = wsdlPort;
- }
-
public String getEjbLink()
{
return ejbLink;
}
- public void setEjbLink(String ejbLink)
- {
- this.ejbLink = ejbLink;
- }
-
public String getServletLink()
{
return servletLink;
}
- public void setServletLink(String servletLink)
- {
- this.servletLink = servletLink;
- }
-
public String getServiceEndpointInterface()
{
return serviceEndpointInterface;
}
- public void setServiceEndpointInterface(String serviceEndpointInterface)
- {
- this.serviceEndpointInterface = serviceEndpointInterface;
- }
-
public void addHandler(UnifiedHandlerMetaData handler)
{
handlers.add(handler);
@@ -170,60 +183,26 @@
return contextRoot;
}
- public void setContextRoot(String contextRoot)
- {
- this.contextRoot = contextRoot;
- }
-
- public void setAddressingEnabled(final boolean addressingEnabled) {
- this.addressingEnabled = addressingEnabled;
- }
-
public boolean isAddressingEnabled() {
return this.addressingEnabled;
}
- public void setAddressingRequired(final boolean addressingRequired) {
- this.addressingRequired = addressingRequired;
- }
-
public boolean isAddressingRequired() {
return this.addressingRequired;
}
- public void setAddressingResponses(final String responsesTypes)
- {
- if (!"ANONYMOUS".equals(responsesTypes) && !"NON_ANONYMOUS".equals(responsesTypes) && !"ALL".equals(responsesTypes))
- throw Messages.MESSAGES.unsupportedAddressingResponseType(responsesTypes);
-
- this.addressingResponses = responsesTypes;
- }
-
public String getAddressingResponses() {
return this.addressingResponses;
}
- public void setMtomEnabled(final boolean mtomEnabled) {
- this.mtomEnabled = mtomEnabled;
- }
-
public boolean isMtomEnabled() {
return this.mtomEnabled;
}
- public void setMtomThreshold(final int mtomThreshold)
- {
- this.mtomThreshold = mtomThreshold;
- }
-
public int getMtomThreshold() {
return this.mtomThreshold;
}
- public void setRespectBindingEnabled(final boolean respectBindingEnabled) {
- this.respectBindingEnabled = respectBindingEnabled;
- }
-
public boolean isRespectBindingEnabled() {
return this.respectBindingEnabled;
}
@@ -233,31 +212,16 @@
return wsdlService;
}
- public void setWsdlService(QName wsdlService)
- {
- this.wsdlService = wsdlService;
- }
-
public String getProtocolBinding()
{
return protocolBinding;
}
- public void setProtocolBinding(String protocolBinding)
- {
- this.protocolBinding = protocolBinding;
- }
-
public UnifiedHandlerChainsMetaData getHandlerChains()
{
return handlerChains;
}
- public void setHandlerChains(UnifiedHandlerChainsMetaData handlerChains)
- {
- this.handlerChains = handlerChains;
- }
-
public String serialize()
{
StringBuilder builder = new StringBuilder("<port-component>");
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java 2013-11-28 17:53:20 UTC (rev 18105)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java 2013-11-28 17:57:18 UTC (rev 18106)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, 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.
*
@@ -23,7 +23,9 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import javax.xml.namespace.QName;
@@ -34,35 +36,48 @@
* XML Binding element for <code>webservices/webservice-description</code>
*
* @author Thomas.Diesler(a)jboss.org
+ * @author alessio.soldano(a)jboss.com
* @since 15-April-2004
*/
public class WebserviceDescriptionMetaData
{
// The parent <webservices> element
- private WebservicesMetaData webservices;
+ private volatile WebservicesMetaData webservices;
// The required <webservice-description-name> element
- private String webserviceDescriptionName;
+ private final String webserviceDescriptionName;
// The required <wsdl-file> element
- private String wsdlFile;
+ private final String wsdlFile;
// The required <jaxrpc-mapping-file> element
- private String jaxrpcMappingFile;
+ private final String jaxrpcMappingFile;
// The required <port-component> elements
- private ArrayList<PortComponentMetaData> portComponents = new ArrayList<PortComponentMetaData>();
-
- public WebserviceDescriptionMetaData(WebservicesMetaData webservices)
+ private final List<PortComponentMetaData> portComponents; // = new ArrayList<PortComponentMetaData>();
+
+ public WebserviceDescriptionMetaData(String webserviceDescriptionName,
+ String wsdlFile, String jaxrpcMappingFile, List<PortComponentMetaData> portComponents)
{
this.webservices = webservices;
+ this.webserviceDescriptionName = webserviceDescriptionName;
+ this.wsdlFile = wsdlFile;
+ this.jaxrpcMappingFile = jaxrpcMappingFile;
+ if (portComponents != null && !portComponents.isEmpty()) {
+ this.portComponents = Collections.unmodifiableList(portComponents);
+ for (PortComponentMetaData pcm : portComponents) {
+ pcm.setWebserviceDescription(this);
+ }
+ } else {
+ this.portComponents = Collections.emptyList();
+ }
}
public WebservicesMetaData getWebservices()
{
return webservices;
}
-
- public void addPortComponent(PortComponentMetaData portComponent)
+
+ protected void setWebservices(WebservicesMetaData webservices)
{
- portComponents.add(portComponent);
+ this.webservices = webservices;
}
public PortComponentMetaData[] getPortComponents()
@@ -129,31 +144,16 @@
return webserviceDescriptionName;
}
- public void setWebserviceDescriptionName(String webserviceDescriptionName)
- {
- this.webserviceDescriptionName = webserviceDescriptionName;
- }
-
public String getWsdlFile()
{
return wsdlFile;
}
- public void setWsdlFile(String wsdlFile)
- {
- this.wsdlFile = wsdlFile;
- }
-
public String getJaxrpcMappingFile()
{
return jaxrpcMappingFile;
}
- public void setJaxrpcMappingFile(String jaxrpcMappingFile)
- {
- this.jaxrpcMappingFile = jaxrpcMappingFile;
- }
-
/**
* Serialize as a String
*
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java 2013-11-28 17:53:20 UTC (rev 18105)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java 2013-11-28 17:57:18 UTC (rev 18106)
@@ -59,7 +59,10 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
@@ -67,6 +70,8 @@
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.AbstractHandlerChainsMetaDataParser;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.wsf.spi.util.StAXUtils;
/**
@@ -197,7 +202,7 @@
private WebservicesMetaData parseWebservices(XMLStreamReader reader, String nsUri, URL descriptorURL) throws XMLStreamException
{
- WebservicesMetaData metadata = new WebservicesMetaData(descriptorURL);
+ List<WebserviceDescriptionMetaData> wsdmds = new ArrayList<WebserviceDescriptionMetaData>(2);
while (reader.hasNext())
{
switch (reader.nextTag())
@@ -205,7 +210,7 @@
case XMLStreamConstants.END_ELEMENT : {
if (match(reader, nsUri, WEBSERVICES))
{
- return metadata;
+ return new WebservicesMetaData(descriptorURL, wsdmds);
}
else
{
@@ -214,7 +219,7 @@
}
case XMLStreamConstants.START_ELEMENT : {
if (match(reader, nsUri, WEBSERVICE_DESCRIPTION)) {
- metadata.addWebserviceDescription(parseWebserviceDescription(reader, nsUri, metadata));
+ wsdmds.add(parseWebserviceDescription(reader, nsUri));
} else if (match(reader, nsUri, "description") || match(reader, nsUri, "display-name")) {
//skip to parse
getElementText(reader);
@@ -235,9 +240,12 @@
throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
- WebserviceDescriptionMetaData parseWebserviceDescription(XMLStreamReader reader, String nsUri, WebservicesMetaData wsMetaData) throws XMLStreamException
+ WebserviceDescriptionMetaData parseWebserviceDescription(XMLStreamReader reader, String nsUri) throws XMLStreamException
{
- WebserviceDescriptionMetaData description = new WebserviceDescriptionMetaData(wsMetaData);
+ String wsdlFile = null;
+ String descriptionName = null;
+ String jaxrpcMappingFile = null;
+ List<PortComponentMetaData> pcms = new ArrayList<PortComponentMetaData>();
while (reader.hasNext())
{
switch (reader.nextTag())
@@ -245,7 +253,7 @@
case XMLStreamConstants.END_ELEMENT : {
if (match(reader, nsUri, WEBSERVICE_DESCRIPTION))
{
- return description;
+ return new WebserviceDescriptionMetaData(descriptionName, wsdlFile, jaxrpcMappingFile, pcms);
}
else
{
@@ -254,16 +262,16 @@
}
case XMLStreamConstants.START_ELEMENT : {
if (match(reader, nsUri, WEBSERVICE_DESCRIPTION_NAME)) {
- description.setWebserviceDescriptionName(getElementText(reader));
+ descriptionName = getElementText(reader);
}
else if (match(reader, nsUri, WSDL_FILE)) {
- description.setWsdlFile(getElementText(reader));
+ wsdlFile = getElementText(reader);
}
else if (match(reader, nsUri, JAXRPC_MAPPING_FILE)) {
- description.setJaxrpcMappingFile(getElementText(reader));
+ jaxrpcMappingFile = getElementText(reader);
}
else if (match(reader, nsUri, PORT_COMPONENT)) {
- description.addPortComponent(parsePortComponent(reader, nsUri, description));
+ pcms.add(parsePortComponent(reader, nsUri));
}
else
{
@@ -275,9 +283,20 @@
throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
- private PortComponentMetaData parsePortComponent(XMLStreamReader reader, String nsUri, WebserviceDescriptionMetaData desc) throws XMLStreamException
+ private PortComponentMetaData parsePortComponent(XMLStreamReader reader, String nsUri) throws XMLStreamException
{
- PortComponentMetaData pc = new PortComponentMetaData(desc);
+ boolean respectBindingEnabled = false;
+ PortComponentAddressing addressing = new PortComponentAddressing();
+ PortComponentLinks links = new PortComponentLinks();
+ String name = null;
+ QName wsdlService = null;
+ QName wsdlPort = null;
+ boolean mtomEnabled = false;
+ int mtomThreshold = 0;
+ String protocolBinding = null;
+ String serviceEndpointInterface = null;
+ UnifiedHandlerChainsMetaData uhcs = null;
+ List<UnifiedHandlerMetaData> handlers = new ArrayList<UnifiedHandlerMetaData>(2);
while (reader.hasNext())
{
switch (reader.nextTag())
@@ -285,7 +304,8 @@
case XMLStreamConstants.END_ELEMENT : {
if (match(reader, nsUri, PORT_COMPONENT))
{
- return pc;
+ return new PortComponentMetaData(name, wsdlPort, serviceEndpointInterface, links.ejb, links.servlet, handlers, null, addressing.enabled,
+ addressing.required, addressing.responses, mtomEnabled, mtomThreshold, respectBindingEnabled, wsdlService, protocolBinding, uhcs);
}
else
{
@@ -294,7 +314,7 @@
}
case XMLStreamConstants.START_ELEMENT : {
if (match(reader, nsUri, PORT_COMPONENT_NAME)) {
- pc.setPortComponentName(getElementText(reader));
+ name = getElementText(reader);
}
else if (match(reader, nsUri, "description") || match(reader, nsUri, "display-name")) {
//skip to parse
@@ -306,37 +326,37 @@
}
}
else if (match(reader, nsUri, WSDL_SERVICE)) {
- pc.setWsdlService(elementAsQName(reader));
+ wsdlService = elementAsQName(reader);
}
else if (match(reader, nsUri, WSDL_PORT)) {
- pc.setWsdlPort(elementAsQName(reader));
+ wsdlPort = elementAsQName(reader);
}
else if (match(reader, nsUri, ENABLE_MTOM)) {
- pc.setMtomEnabled(elementAsBoolean(reader));
+ mtomEnabled = elementAsBoolean(reader);
}
else if (match(reader, nsUri, MTOM_THRESHOLD)) {
- pc.setMtomThreshold(elementAsInt(reader));
+ mtomThreshold = elementAsInt(reader);
}
else if (match(reader, nsUri, ADDRESSING)) {
- parseAddressing(reader, nsUri, pc);
+ parseAddressing(reader, nsUri, addressing);
}
else if (match(reader, nsUri, RESPECT_BINDING)) {
- parseRespectBinding(reader, nsUri, pc);
+ respectBindingEnabled = parseRespectBinding(reader, nsUri);
}
else if (match(reader, nsUri, PROTOCOL_BINDING)) {
- pc.setProtocolBinding(getElementText(reader));
+ protocolBinding = getElementText(reader);
}
else if (match(reader, nsUri, SERVICE_ENDPOINT_INTERFACE)) {
- pc.setServiceEndpointInterface(getElementText(reader));
+ serviceEndpointInterface = getElementText(reader);
}
else if (match(reader, nsUri, SERVICE_IMPL_BEAN)) {
- parseServiceImplBean(reader, nsUri, pc);
+ parseServiceImplBean(reader, nsUri, links);
}
else if (match(reader, nsUri, HANDLER_CHAINS)) {
- pc.setHandlerChains(parseHandlerChains(reader, nsUri));
+ uhcs = parseHandlerChains(reader, nsUri);
}
else if (match(reader, nsUri, HANDLER)) {
- pc.addHandler(parseHandler(reader, nsUri));
+ handlers.add(parseHandler(reader, nsUri));
}
else
{
@@ -352,7 +372,7 @@
return elementAsString(reader);
}
- private void parseAddressing(XMLStreamReader reader, String nsUri, PortComponentMetaData pc) throws XMLStreamException
+ private void parseAddressing(XMLStreamReader reader, String nsUri, PortComponentAddressing pca) throws XMLStreamException
{
while (reader.hasNext())
{
@@ -370,13 +390,13 @@
}
case XMLStreamConstants.START_ELEMENT : {
if (match(reader, nsUri, ENABLED)) {
- pc.setAddressingEnabled(elementAsBoolean(reader));
+ pca.enabled = elementAsBoolean(reader);
}
else if (match(reader, nsUri, REQUIRED)) {
- pc.setAddressingRequired(elementAsBoolean(reader));
+ pca.required = elementAsBoolean(reader);
}
else if (match(reader, nsUri, ADDRESSING_RESPONSES)) {
- pc.setAddressingResponses(getElementText(reader));
+ pca.responses = getElementText(reader);
}
else
{
@@ -388,8 +408,15 @@
throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
- private void parseRespectBinding(XMLStreamReader reader, String nsUri, PortComponentMetaData pc) throws XMLStreamException
+ private class PortComponentAddressing {
+ public boolean enabled = false;
+ public boolean required = false;
+ public String responses = "ALL";
+ }
+
+ private boolean parseRespectBinding(XMLStreamReader reader, String nsUri) throws XMLStreamException
{
+ boolean respectBindingEnabled = false;
while (reader.hasNext())
{
switch (reader.nextTag())
@@ -397,7 +424,7 @@
case XMLStreamConstants.END_ELEMENT : {
if (match(reader, nsUri, RESPECT_BINDING))
{
- return;
+ return respectBindingEnabled;
}
else
{
@@ -406,7 +433,7 @@
}
case XMLStreamConstants.START_ELEMENT : {
if (match(reader, nsUri, ENABLED)) {
- pc.setRespectBindingEnabled(elementAsBoolean(reader));
+ respectBindingEnabled = elementAsBoolean(reader);
}
else
{
@@ -418,7 +445,7 @@
throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
- private void parseServiceImplBean(XMLStreamReader reader, String nsUri, PortComponentMetaData pc) throws XMLStreamException
+ private void parseServiceImplBean(XMLStreamReader reader, String nsUri, PortComponentLinks pcl) throws XMLStreamException
{
while (reader.hasNext())
{
@@ -436,10 +463,10 @@
}
case XMLStreamConstants.START_ELEMENT : {
if (match(reader, nsUri, SERVLET_LINK)) {
- pc.setServletLink(getElementText(reader));
+ pcl.servlet = getElementText(reader);
}
else if (match(reader, nsUri, EJB_LINK)) {
- pc.setEjbLink(getElementText(reader));
+ pcl.ejb = getElementText(reader);
}
else
{
@@ -451,6 +478,11 @@
throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
+ private class PortComponentLinks {
+ public String servlet;
+ public String ejb;
+ }
+
@Override
protected String getDescriptorForLogs() {
return descriptorURL != null ? descriptorURL.toString() : "webservices.xml";
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesMetaData.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesMetaData.java 2013-11-28 17:53:20 UTC (rev 18105)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesMetaData.java 2013-11-28 17:57:18 UTC (rev 18106)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, 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.
*
@@ -22,28 +22,34 @@
package org.jboss.wsf.spi.metadata.webservices;
import java.net.URL;
-import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
/**
* XML Binding root element for <code>webservices.xml</code>
*
* @author Thomas.Diesler(a)jboss.org
+ * @autor alessio.soldano(a)jboss.com
* @since 15-April-2004
*/
public class WebservicesMetaData
{
// The required <webservice-description> elements
- private ArrayList<WebserviceDescriptionMetaData> webserviceDescriptions = new ArrayList<WebserviceDescriptionMetaData>(2);
+ private final List<WebserviceDescriptionMetaData> webserviceDescriptions;
// The URL to the webservices.xml descriptor
- private URL descriptorURL;
-
- public WebservicesMetaData()
+ private final URL descriptorURL;
+
+ public WebservicesMetaData(URL descriptorURL, List<WebserviceDescriptionMetaData> webserviceDescriptions)
{
- }
-
- public WebservicesMetaData(URL descriptorURL)
- {
+ if (webserviceDescriptions != null && !webserviceDescriptions.isEmpty()) {
+ this.webserviceDescriptions = Collections.unmodifiableList(webserviceDescriptions);
+ for (WebserviceDescriptionMetaData wsdmd : webserviceDescriptions) {
+ wsdmd.setWebservices(this);
+ }
+ } else {
+ this.webserviceDescriptions = Collections.emptyList();
+ }
this.descriptorURL = descriptorURL;
}
@@ -52,11 +58,6 @@
return descriptorURL;
}
- public void addWebserviceDescription(WebserviceDescriptionMetaData webserviceDescription)
- {
- webserviceDescriptions.add(webserviceDescription);
- }
-
public WebserviceDescriptionMetaData[] getWebserviceDescriptions()
{
WebserviceDescriptionMetaData[] array = new WebserviceDescriptionMetaData[webserviceDescriptions.size()];
11 years, 1 month
JBossWS SVN: r18105 - spi/branches.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-11-28 12:53:20 -0500 (Thu, 28 Nov 2013)
New Revision: 18105
Added:
spi/branches/JBWS-3739/
Log:
Branching for working on 3739 and 3708
11 years, 1 month
JBossWS SVN: r18104 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-11-26 10:34:13 -0500 (Tue, 26 Nov 2013)
New Revision: 18104
Modified:
stack/cxf/trunk/pom.xml
Log:
[JBWS-3734] Upgrade to Apache CXF 2.7.8
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2013-11-25 09:58:29 UTC (rev 18103)
+++ stack/cxf/trunk/pom.xml 2013-11-26 15:34:13 UTC (rev 18104)
@@ -72,7 +72,7 @@
<jboss720.version>7.2.0.Final</jboss720.version>
<wildfly800.version>8.0.0.Beta2-SNAPSHOT</wildfly800.version>
<ejb.api.version>1.0.2.Final</ejb.api.version>
- <cxf.version>2.7.8-SNAPSHOT</cxf.version>
+ <cxf.version>2.7.8</cxf.version>
<cxf.asm.version>3.3.1</cxf.asm.version>
<cxf.xjcplugins.version>2.6.1</cxf.xjcplugins.version>
<jboss.common.core.version>2.2.17.GA</jboss.common.core.version>
@@ -103,8 +103,8 @@
<jms.api.version>1.0.1.Final</jms.api.version>
<velocity.version>1.7</velocity.version>
<xerces.version>2.9.1</xerces.version>
- <xmlsec.version>1.5.5</xmlsec.version>
- <wss4j.version>1.6.13-SNAPSHOT</wss4j.version>
+ <xmlsec.version>1.5.6</xmlsec.version>
+ <wss4j.version>1.6.13</wss4j.version>
<wstx.version>4.2.0</wstx.version>
<spring.version>3.0.7.RELEASE</spring.version>
<shrinkwrap.version>1.1.3</shrinkwrap.version>
11 years, 1 month
JBossWS SVN: r18103 - in container/jboss72/branches/jbossws-jboss720: server-integration and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-11-25 04:58:29 -0500 (Mon, 25 Nov 2013)
New Revision: 18103
Modified:
container/jboss72/branches/jbossws-jboss720/pom.xml
container/jboss72/branches/jbossws-jboss720/server-integration/pom.xml
container/jboss72/branches/jbossws-jboss720/tests-integration/pom.xml
Log:
Preparing for next dev cycle
Modified: container/jboss72/branches/jbossws-jboss720/pom.xml
===================================================================
--- container/jboss72/branches/jbossws-jboss720/pom.xml 2013-11-22 10:11:13 UTC (rev 18102)
+++ container/jboss72/branches/jbossws-jboss720/pom.xml 2013-11-25 09:58:29 UTC (rev 18103)
@@ -35,7 +35,7 @@
<description>JBossWS JBoss AS 7.2.0.Final Integration Parent</description>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-jboss720-parent</artifactId>
- <version>4.2.2-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<packaging>pom</packaging>
<scm>
@@ -50,12 +50,12 @@
</modules>
<properties>
- <jbossws.api.version>1.0.2.Beta1</jbossws.api.version>
+ <jbossws.api.version>1.0.2.Final</jbossws.api.version>
<jbossws.spi.version>2.2.2.Final</jbossws.spi.version>
- <jbossws.common.version>2.2.2.Final</jbossws.common.version>
+ <jbossws.common.version>2.2.3.Final</jbossws.common.version>
<jboss.msc.version>1.0.4.GA</jboss.msc.version>
<jboss.version>7.2.0.Final</jboss.version>
- <jboss.jaxws.api.version>2.0.1.Final</jboss.jaxws.api.version>
+ <jboss.jaxws.api.version>2.0.2.Final</jboss.jaxws.api.version>
<marshalling.river.version>1.3.16.GA</marshalling.river.version>
<hornetq.version>2.3.0.CR1</hornetq.version>
<remoting3.version>3.2.14.GA</remoting3.version>
Modified: container/jboss72/branches/jbossws-jboss720/server-integration/pom.xml
===================================================================
--- container/jboss72/branches/jbossws-jboss720/server-integration/pom.xml 2013-11-22 10:11:13 UTC (rev 18102)
+++ container/jboss72/branches/jbossws-jboss720/server-integration/pom.xml 2013-11-25 09:58:29 UTC (rev 18103)
@@ -29,7 +29,7 @@
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-jboss720-parent</artifactId>
- <version>4.2.2-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: container/jboss72/branches/jbossws-jboss720/tests-integration/pom.xml
===================================================================
--- container/jboss72/branches/jbossws-jboss720/tests-integration/pom.xml 2013-11-22 10:11:13 UTC (rev 18102)
+++ container/jboss72/branches/jbossws-jboss720/tests-integration/pom.xml 2013-11-25 09:58:29 UTC (rev 18103)
@@ -29,7 +29,7 @@
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-jboss720-parent</artifactId>
- <version>4.2.2-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
11 years, 1 month
JBossWS SVN: r18102 - spi/branches/jaspi/src/main/java/org/jboss/wsf/spi/deployer.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2013-11-22 05:11:13 -0500 (Fri, 22 Nov 2013)
New Revision: 18102
Modified:
spi/branches/jaspi/src/main/java/org/jboss/wsf/spi/deployer/Deployer.java
Log:
add method to create jaspi security domain
Modified: spi/branches/jaspi/src/main/java/org/jboss/wsf/spi/deployer/Deployer.java
===================================================================
--- spi/branches/jaspi/src/main/java/org/jboss/wsf/spi/deployer/Deployer.java 2013-11-22 10:09:03 UTC (rev 18101)
+++ spi/branches/jaspi/src/main/java/org/jboss/wsf/spi/deployer/Deployer.java 2013-11-22 10:11:13 UTC (rev 18102)
@@ -51,6 +51,11 @@
*/
void addSecurityDomain(String name, Map<String,String> authenticationOptions) throws Exception;
+
+ public void addJaspiSecurityDomain(String name, String loginModuleStackName, Map<String, String> loginModuleOptions,
+ String authModuleName, Map<String, String> authModuleOptions) throws Exception;
+
+
/**
* Removes a security domain
*
11 years, 1 month
JBossWS SVN: r18101 - in stack/cxf/branches/jaspi/modules/testsuite: test-utils/src/main/java/org/jboss/wsf/test and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2013-11-22 05:09:03 -0500 (Fri, 22 Nov 2013)
New Revision: 18101
Modified:
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/JBWSJaspiTestCase.java
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/usernametoken-soapmessage.xml
stack/cxf/branches/jaspi/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
Log:
Add utility method to create jaspi security domain;improve test case
Modified: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/JBWSJaspiTestCase.java
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/JBWSJaspiTestCase.java 2013-11-22 08:24:57 UTC (rev 18100)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/JBWSJaspiTestCase.java 2013-11-22 10:09:03 UTC (rev 18101)
@@ -26,6 +26,8 @@
import java.io.IOException;
import java.net.URL;
import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
import javax.xml.namespace.QName;
import javax.xml.soap.MessageFactory;
@@ -33,52 +35,88 @@
import javax.xml.ws.Dispatch;
import javax.xml.ws.Service;
+import junit.extensions.TestSetup;
import junit.framework.Test;
import org.apache.ws.security.util.XmlSchemaDateFormat;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
public class JBWSJaspiTestCase extends JBossWSTest
{
private String address = "http://" + getServerHost() + ":8080/jaxws-cxf-jaspi/JaspiEndpoint";
private String wsdlURl = address + "?wsdl";
private String targetNS = "http://org.jboss.ws.jaxws.cxf/jaspi";
+
public static Test suite()
{
- return new JBossWSCXFTestSetup(JBWSJaspiTestCase.class, "jaxws-cxf-jaspi.war");
+ TestSetup testSetup = new JBossWSCXFTestSetup(JBWSJaspiTestCase.class, "jaxws-cxf-jaspi.war") {
+
+ public void setUp() throws Exception
+ {
+ Map<String, String> loginModuleOptions = new HashMap<String, String>();
+ String usersPropFile = System.getProperty("org.jboss.ws.testsuite.securityDomain.users.propfile");
+ String rolesPropFile = System.getProperty("org.jboss.ws.testsuite.securityDomain.roles.propfile");
+ if (usersPropFile != null)
+ {
+ loginModuleOptions.put("usersProperties", usersPropFile);
+ }
+ if (rolesPropFile != null)
+ {
+ loginModuleOptions.put("rolesProperties", rolesPropFile);
+ }
+
+ Map<String, String> authModuleOptions = new HashMap<String, String>();
+ authModuleOptions.put("action", "UsernameToken Timestamp");
+ JBossWSTestHelper.addJaspiSecurityDomain("jaspi", "jaas-lm-stack", loginModuleOptions, "org.jboss.wsf.stack.cxf.jaspi.module.SOAPServerAuthModule",
+ authModuleOptions);
+
+ super.setUp();
+ }
+
+ public void tearDown() throws Exception
+ {
+ JBossWSTestHelper.removeSecurityDomain("jaspi");
+ super.tearDown();
+
+ }
+ };
+ return testSetup;
}
-
+
public void testValidMessage() throws Exception
{
-
Service service = Service.create(new URL(wsdlURl), new QName(targetNS, "JaspiService"));
Dispatch<SOAPMessage> dispatch = service.createDispatch(new QName(targetNS, "JaspiEndpointPort"), SOAPMessage.class, Service.Mode.MESSAGE);
SOAPMessage response = dispatch.invoke(prepareSOAPMessage("org/jboss/test/ws/jaxws/cxf/jaspi/usernametoken-soapmessage.xml"));
- response.writeTo(System.out);
+ java.io.ByteArrayOutputStream bout = new java.io.ByteArrayOutputStream();
+ response.writeTo(bout);
+ assertTrue("Expected echoResponse replied", new String(bout.toByteArray()).indexOf("echoResponse") > -1);
}
-
- private SOAPMessage prepareSOAPMessage(String messageFile) throws Exception {
+
+ private SOAPMessage prepareSOAPMessage(String messageFile) throws Exception
+ {
MessageFactory factory = MessageFactory.newInstance();
- URL fileURl = Thread.currentThread().getContextClassLoader()
- .getResource(messageFile);
+ URL fileURl = Thread.currentThread().getContextClassLoader().getResource(messageFile);
FileInputStream fins = new FileInputStream(fileURl.getFile());
String content = readFile(fins);
XmlSchemaDateFormat formater = new XmlSchemaDateFormat();
- String replaced = content.replaceAll("\\$NOW", formater.format(new Date()));
+ String replaced = content.replaceAll("\\$NOW", formater.format(new Date()));
ByteArrayInputStream bin = new ByteArrayInputStream(replaced.getBytes());
return factory.createMessage(null, bin);
}
-
- private String readFile(FileInputStream in) throws IOException {
+
+ private String readFile(FileInputStream in) throws IOException
+ {
StringBuilder sb = new StringBuilder(1024);
- for (int i = in.read(); i != -1; i = in.read()) {
- sb.append((char) i);
+ for (int i = in.read(); i != -1; i = in.read())
+ {
+ sb.append((char)i);
}
in.close();
return sb.toString();
}
-
}
Modified: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/usernametoken-soapmessage.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/usernametoken-soapmessage.xml 2013-11-22 08:24:57 UTC (rev 18100)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/usernametoken-soapmessage.xml 2013-11-22 10:09:03 UTC (rev 18101)
@@ -11,9 +11,9 @@
</wsu:Timestamp>
<wsse:UsernameToken
wsu:Id="UsernameToken-4313b55e-cbcd-438f-8408-c19f1016b208">
- <wsse:Username>jbossws</wsse:Username>
+ <wsse:Username>kermit</wsse:Username>
<wsse:Password
- Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-pr...">jbossws</wsse:Password>
+ Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-pr...">thefrog</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
Modified: stack/cxf/branches/jaspi/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2013-11-22 08:24:57 UTC (rev 18100)
+++ stack/cxf/branches/jaspi/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2013-11-22 10:09:03 UTC (rev 18101)
@@ -403,6 +403,13 @@
getDeployer().addSecurityDomain(name, authenticationOptions);
}
+ public static void addJaspiSecurityDomain(String name, String loginModuleStackName, Map<String, String> loginModuleOptions, String authModuleName,
+ Map<String, String> authModuleOptions) throws Exception
+ {
+ getDeployer().addJaspiSecurityDomain(name, loginModuleStackName, loginModuleOptions, authModuleName, authModuleOptions);
+ }
+
+
public static void removeSecurityDomain(String name) throws Exception
{
getDeployer().removeSecurityDomain(name);
11 years, 1 month
JBossWS SVN: r18100 - spi/branches.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2013-11-22 03:24:57 -0500 (Fri, 22 Nov 2013)
New Revision: 18100
Added:
spi/branches/jaspi/
Log:
Create jaspi workspace
11 years, 1 month
JBossWS SVN: r18099 - in stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools: wsdl and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2013-11-21 12:24:09 -0500 (Thu, 21 Nov 2013)
New Revision: 18099
Added:
stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/ServerSideDocumentBuilder.java
Modified:
stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/wsdl/JBossWSDLReaderImpl.java
stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
Log:
BZ-966752: code is a preventive measure, making sure the serverside classloader is used.
Added: stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/ServerSideDocumentBuilder.java
===================================================================
--- stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/ServerSideDocumentBuilder.java (rev 0)
+++ stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/ServerSideDocumentBuilder.java 2013-11-21 17:24:09 UTC (rev 18099)
@@ -0,0 +1,23 @@
+package org.jboss.ws.tools;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+/**
+ * Require the TCCL to this framework's classloader.
+ *
+ * User: rsearls
+ * Date: 11/20/13
+ */
+public class ServerSideDocumentBuilder {
+ public static DocumentBuilderFactory createDocumentBuilderFactory() {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ DocumentBuilderFactory factory;
+ try {
+ Thread.currentThread().setContextClassLoader(ServerSideDocumentBuilder.class.getClassLoader());
+ factory = DocumentBuilderFactory.newInstance();
+ } finally {
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ return factory;
+ }
+}
Modified: stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/wsdl/JBossWSDLReaderImpl.java
===================================================================
--- stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/wsdl/JBossWSDLReaderImpl.java 2013-11-21 10:06:14 UTC (rev 18098)
+++ stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/wsdl/JBossWSDLReaderImpl.java 2013-11-21 17:24:09 UTC (rev 18099)
@@ -68,6 +68,7 @@
import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.utils.JBossWSEntityResolver;
+import org.jboss.ws.tools.ServerSideDocumentBuilder;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -2142,7 +2143,7 @@
private static Document getDocument(InputSource inputSource,
String desc) throws WSDLException
{
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilderFactory factory = ServerSideDocumentBuilder.createDocumentBuilderFactory();
factory.setNamespaceAware(true);
factory.setValidating(false);
Modified: stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
===================================================================
--- stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java 2013-11-21 10:06:14 UTC (rev 18098)
+++ stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java 2013-11-21 17:24:09 UTC (rev 18099)
@@ -43,6 +43,7 @@
import org.jboss.ws.common.utils.ResourceURL;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLException;
+import org.jboss.ws.tools.ServerSideDocumentBuilder;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -168,7 +169,7 @@
InputStream inputStream = new ResourceURL(wsdlLocation).openStream();
try
{
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilderFactory factory = ServerSideDocumentBuilder.createDocumentBuilderFactory();
factory.setNamespaceAware(true);
factory.setValidating(false);
11 years, 1 month
JBossWS SVN: r18098 - in stack/cxf/branches/jaspi/modules: resources/src/main/resources/modules/wildfly800/org/jboss/ws/cxf/jbossws-cxf-server/main and 12 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2013-11-21 05:06:14 -0500 (Thu, 21 Nov 2013)
New Revision: 18098
Added:
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/Endpoint.java
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/EndpointImpl.java
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/JBWSJaspiTestCase.java
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/usernametoken-soapmessage.xml
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/WEB-INF/
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/WEB-INF/web.xml
Modified:
stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
stack/cxf/branches/jaspi/modules/resources/src/main/resources/modules/wildfly800/org/jboss/ws/cxf/jbossws-cxf-server/main/module.xml
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/JaspiServerAuthenticator.java
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSAuthConfigProvider.java
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSServerAuthConfig.java
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/module/SOAPServerAuthModule.java
stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/validator/UsernameTokenValidator.java
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java
Log:
Clean up;add jaspi tests
Modified: stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
===================================================================
--- stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2013-11-20 10:11:39 UTC (rev 18097)
+++ stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2013-11-21 10:06:14 UTC (rev 18098)
@@ -82,9 +82,6 @@
import org.jboss.wsf.stack.cxf.client.jaspi.JaspiClientAuthenticator;
import org.jboss.wsf.stack.cxf.client.jaspi.JaspiClientInInterceptor;
import org.jboss.wsf.stack.cxf.client.jaspi.JaspiClientOutInterceptor;
-import org.jboss.wsf.stack.cxf.jaspi.JaspiServerAuthenticator;
-import org.jboss.wsf.stack.cxf.jaspi.config.JBossWSAuthConfigProvider;
-import org.jboss.wsf.stack.cxf.jaspi.config.JBossWSAuthConstants;
import org.w3c.dom.Element;
/**
Modified: stack/cxf/branches/jaspi/modules/resources/src/main/resources/modules/wildfly800/org/jboss/ws/cxf/jbossws-cxf-server/main/module.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/resources/src/main/resources/modules/wildfly800/org/jboss/ws/cxf/jbossws-cxf-server/main/module.xml 2013-11-20 10:11:39 UTC (rev 18097)
+++ stack/cxf/branches/jaspi/modules/resources/src/main/resources/modules/wildfly800/org/jboss/ws/cxf/jbossws-cxf-server/main/module.xml 2013-11-21 10:06:14 UTC (rev 18098)
@@ -34,6 +34,7 @@
<dependencies>
<module name="javax.api" />
+ <module name="javax.security.auth.message.api"/>
<module name="javax.servlet.api" />
<module name="javax.jws.api" />
<module name="javax.wsdl4j.api" />
Modified: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2013-11-20 10:11:39 UTC (rev 18097)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2013-11-21 10:06:14 UTC (rev 18098)
@@ -182,7 +182,7 @@
}
catch (Exception e)
{
- //ignore
+ e.printStackTrace();
}
return null;
Modified: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/JaspiServerAuthenticator.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/JaspiServerAuthenticator.java 2013-11-20 10:11:39 UTC (rev 18097)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/JaspiServerAuthenticator.java 2013-11-21 10:06:14 UTC (rev 18098)
@@ -75,6 +75,7 @@
try
{
ServerAuthContext sctx = serverConfig.getAuthContext(authContextID, clientSubject, serverContextProperties);
+
authStatus = sctx.validateRequest(messageInfo, clientSubject, null);
}
catch (AuthException e)
Modified: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSAuthConfigProvider.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSAuthConfigProvider.java 2013-11-20 10:11:39 UTC (rev 18097)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSAuthConfigProvider.java 2013-11-21 10:06:14 UTC (rev 18098)
@@ -39,7 +39,7 @@
public JBossWSAuthConfigProvider(Properties props, AuthConfigFactory factory) {
contextProperties = props;
if (factory != null) {
- factory.registerConfigProvider(this, "SOAP", null,"JBossWS AuthConfigProvider");
+ factory.registerConfigProvider(this, "soap", null,"JBossWS AuthConfigProvider");
}
}
Modified: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSServerAuthConfig.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSServerAuthConfig.java 2013-11-20 10:11:39 UTC (rev 18097)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/config/JBossWSServerAuthConfig.java 2013-11-21 10:06:14 UTC (rev 18098)
@@ -45,7 +45,7 @@
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
-import org.apache.commons.lang.StringUtils;
+import org.apache.cxf.common.util.StringUtils;
import org.jboss.security.auth.callback.JBossCallbackHandler;
import org.jboss.security.auth.container.config.AuthModuleEntry;
import org.jboss.security.auth.login.JASPIAuthenticationInfo;
@@ -180,7 +180,7 @@
if (soapActions != null && soapActions.length > 0)
{
authContext = soapActions[0];
- if (StringUtils.isNotEmpty(authContext))
+ if (!StringUtils.isEmpty(authContext))
{
return authContext;
}
Modified: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/module/SOAPServerAuthModule.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/module/SOAPServerAuthModule.java 2013-11-20 10:11:39 UTC (rev 18097)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/module/SOAPServerAuthModule.java 2013-11-21 10:06:14 UTC (rev 18098)
@@ -49,7 +49,8 @@
*/
public class SOAPServerAuthModule extends AbstractServerAuthModule {
private String securityDomainName = null;
-
+ private WSSConfig wssConfig = WSSConfig.getNewInstance();
+ private WSS4JInInterceptor wss4jInterceptor = new WSS4JInInterceptor();
public SOAPServerAuthModule() {
supportedTypes.add(Object.class);
supportedTypes.add(SOAPMessage.class);
@@ -63,8 +64,7 @@
@Override
public AuthStatus validateRequest(MessageInfo messageInfo,
- Subject clientSubject, Subject serviceSubject) throws AuthException {
- //TODO:look at what we need to do with options
+ Subject clientSubject, Subject serviceSubject) throws AuthException {
return validate(clientSubject, messageInfo) ? AuthStatus.SUCCESS : AuthStatus.FAILURE;
}
@@ -93,11 +93,12 @@
cxfSoapMessage.setContent(SOAPMessage.class, soapMessage);
cxfSoapMessage.put(Message.HTTP_REQUEST_METHOD, "POST");
-
- WSSConfig wssConfig = WSSConfig.getNewInstance();
- setJASPICValidator(wssConfig, clientSubject);
+ setJASPICValidator(wssConfig, clientSubject);
cxfSoapMessage.put(WSSConfig.class.getName(), wssConfig);
-
+
+ for (Object key : options.keySet()) {
+ cxfSoapMessage.put((String)key, options.get(key));
+ }
//set the wss4j config from messageinfo
if (messageInfo.getMap().get(JBossWSAuthConstants.WSS4J_CONFIG) != null) {
Properties props = (Properties)messageInfo.getMap().get(JBossWSAuthConstants.WSS4J_CONFIG);
@@ -105,8 +106,6 @@
cxfSoapMessage.put(e.getKey().toString(), e.getValue());
}
}
-
- WSS4JInInterceptor wss4jInterceptor = new WSS4JInInterceptor();
wss4jInterceptor.handleMessage(cxfSoapMessage);
return true;
@@ -119,7 +118,6 @@
}
protected void setJASPICValidator(WSSConfig wssconfig, Subject subject) {
- //TODO: add other validator
UsernameTokenValidator usernameTokenValidator = new UsernameTokenValidator(subject);
usernameTokenValidator.setContextName(getSecurityDomainName());
wssconfig.setValidator(WSSecurityEngine.USERNAME_TOKEN, usernameTokenValidator);
Modified: stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/validator/UsernameTokenValidator.java
===================================================================
--- stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/validator/UsernameTokenValidator.java 2013-11-20 10:11:39 UTC (rev 18097)
+++ stack/cxf/branches/jaspi/modules/server/src/main/java/org/jboss/wsf/stack/cxf/jaspi/validator/UsernameTokenValidator.java 2013-11-21 10:06:14 UTC (rev 18098)
@@ -45,8 +45,8 @@
//wss4j's JAASUsernameTokenValidator only supports plain text password
//TODO: support other type password
- private static org.apache.commons.logging.Log log =
- org.apache.commons.logging.LogFactory.getLog(UsernameTokenValidator.class);
+/* private static org.apache.commons.logging.Log log =
+ org.apache.commons.logging.LogFactory.getLog(UsernameTokenValidator.class);*/
public Credential validate(Credential credential, RequestData data) throws WSSecurityException {
if (credential == null || credential.getUsernametoken() == null) {
throw new WSSecurityException(WSSecurityException.FAILURE, "noCredential");
@@ -59,25 +59,18 @@
user = usernameToken.getName();
String pwType = usernameToken.getPasswordType();
- if (log.isDebugEnabled()) {
- log.debug("UsernameToken user " + usernameToken.getName());
- log.debug("UsernameToken password type " + pwType);
- }
if (usernameToken.isHashed()) {
- log.warn("Authentication failed as hashed username token not supported");
throw new WSSecurityException(WSSecurityException.FAILED_AUTHENTICATION);
}
password = usernameToken.getPassword();
if (!WSConstants.PASSWORD_TEXT.equals(pwType)) {
- log.warn("Password type " + pwType + " not supported");
throw new WSSecurityException(WSSecurityException.FAILED_AUTHENTICATION);
}
if (!(user != null && user.length() > 0 && password != null && password.length() > 0)) {
- log.warn("User or password empty");
throw new WSSecurityException(WSSecurityException.FAILED_AUTHENTICATION);
}
@@ -89,7 +82,6 @@
credential.setSubject(subject);
} catch (LoginException ex) {
- log.info("Authentication failed", ex);
throw new WSSecurityException(
WSSecurityException.FAILED_AUTHENTICATION, null, null, ex
);
Modified: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2013-11-20 10:11:39 UTC (rev 18097)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2013-11-21 10:06:14 UTC (rev 18098)
@@ -292,6 +292,16 @@
prefix="WEB-INF/"/>
</war>
+ <war warfile="${tests.output.dir}/test-libs/jaxws-cxf-jaspi.war" webxml="${tests.output.dir}/test-resources/jaxws/cxf/jaspi/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/cxf/jaspi/Endpoint*.class"/>
+ </classes>
+
+ <webinf dir="${tests.output.dir}/test-resources//jaxws/cxf/jaspi/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ </war>
+
<!-- jaxws-cxf-jaxbintros -->
<jar destfile="${tests.output.dir}/test-libs/jaxws-cxf-jaxbintros.jar">
<fileset dir="${tests.output.dir}/test-classes">
Added: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/Endpoint.java
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/Endpoint.java (rev 0)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/Endpoint.java 2013-11-21 10:06:14 UTC (rev 18098)
@@ -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.cxf.jaspi;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name = "JaspiEndpoint", targetNamespace = "http://org.jboss.ws.jaxws.cxf/jaspi", serviceName = "JaspiService")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface Endpoint
+{
+ String echo(String input);
+}
Property changes on: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/Endpoint.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/EndpointImpl.java
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/EndpointImpl.java (rev 0)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/EndpointImpl.java 2013-11-21 10:06:14 UTC (rev 18098)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.cxf.jaspi;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name = "JaspiEndpoint", targetNamespace = "http://org.jboss.ws.jaxws.cxf/jaspi", serviceName = "JaspiService")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public class EndpointImpl
+{
+ @WebMethod
+ public String echo(String input)
+ {
+ return input;
+ }
+}
Property changes on: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/EndpointImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/JBWSJaspiTestCase.java
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/JBWSJaspiTestCase.java (rev 0)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/JBWSJaspiTestCase.java 2013-11-21 10:06:14 UTC (rev 18098)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.cxf.jaspi;
+
+import java.io.ByteArrayInputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Date;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.apache.ws.security.util.XmlSchemaDateFormat;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+public class JBWSJaspiTestCase extends JBossWSTest
+{
+ private String address = "http://" + getServerHost() + ":8080/jaxws-cxf-jaspi/JaspiEndpoint";
+ private String wsdlURl = address + "?wsdl";
+ private String targetNS = "http://org.jboss.ws.jaxws.cxf/jaspi";
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(JBWSJaspiTestCase.class, "jaxws-cxf-jaspi.war");
+ }
+
+ public void testValidMessage() throws Exception
+ {
+
+ Service service = Service.create(new URL(wsdlURl), new QName(targetNS, "JaspiService"));
+ Dispatch<SOAPMessage> dispatch = service.createDispatch(new QName(targetNS, "JaspiEndpointPort"), SOAPMessage.class, Service.Mode.MESSAGE);
+ SOAPMessage response = dispatch.invoke(prepareSOAPMessage("org/jboss/test/ws/jaxws/cxf/jaspi/usernametoken-soapmessage.xml"));
+ response.writeTo(System.out);
+ }
+
+ private SOAPMessage prepareSOAPMessage(String messageFile) throws Exception {
+ MessageFactory factory = MessageFactory.newInstance();
+ URL fileURl = Thread.currentThread().getContextClassLoader()
+ .getResource(messageFile);
+ FileInputStream fins = new FileInputStream(fileURl.getFile());
+ String content = readFile(fins);
+ XmlSchemaDateFormat formater = new XmlSchemaDateFormat();
+
+ String replaced = content.replaceAll("\\$NOW", formater.format(new Date()));
+ ByteArrayInputStream bin = new ByteArrayInputStream(replaced.getBytes());
+ return factory.createMessage(null, bin);
+ }
+
+ private String readFile(FileInputStream in) throws IOException {
+ StringBuilder sb = new StringBuilder(1024);
+ for (int i = in.read(); i != -1; i = in.read()) {
+ sb.append((char) i);
+ }
+ in.close();
+ return sb.toString();
+ }
+
+
+}
Property changes on: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/JBWSJaspiTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/usernametoken-soapmessage.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/usernametoken-soapmessage.xml (rev 0)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/usernametoken-soapmessage.xml 2013-11-21 10:06:14 UTC (rev 18098)
@@ -0,0 +1,25 @@
+<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:jas="http://org.jboss.ws.jaxws.cxf/jaspi">
+ <soap:Header>
+ <wsse:Security
+ xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext..."
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ soap:mustUnderstand="0">
+ <wsu:Timestamp wsu:Id="TS-96d29305-8a68-42a9-84a7-3f30a2a04e11">
+ <wsu:Created>$NOW</wsu:Created>
+ <wsu:Expires>2113-10-16T08:58:19.763Z</wsu:Expires>
+ </wsu:Timestamp>
+ <wsse:UsernameToken
+ wsu:Id="UsernameToken-4313b55e-cbcd-438f-8408-c19f1016b208">
+ <wsse:Username>jbossws</wsse:Username>
+ <wsse:Password
+ Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-pr...">jbossws</wsse:Password>
+ </wsse:UsernameToken>
+ </wsse:Security>
+ </soap:Header>
+ <soap:Body>
+ <jas:echo>
+ <arg0>test</arg0>
+ </jas:echo>
+ </soap:Body>
+</soap:Envelope>
\ No newline at end of file
Property changes on: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaspi/usernametoken-soapmessage.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java 2013-11-20 10:11:39 UTC (rev 18097)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java 2013-11-21 10:06:14 UTC (rev 18098)
@@ -63,7 +63,7 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, null);
+ holder.configure(null, null, null, null, null);
holder.close();
assertEquals("preShutdown method on listener should be called exactly once; number of actual calls: "
+ listener.getCount(), 1, listener.getCount());
@@ -74,7 +74,7 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, null);
+ holder.configure(null, null, null, null, null);
bus.shutdown(true);
holder.close();
assertEquals("preShutdown method on listener should be called exactly once; number of actual calls: "
@@ -86,7 +86,7 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, null);
+ holder.configure(null, null, null, null, null);
assertEquals("preShutdown method on listener shouldn't be called before holder is closed: number of actual calls: "
+ listener.getCount(), 0, listener.getCount());
holder.close();
Added: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/WEB-INF/web.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/WEB-INF/web.xml (rev 0)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/WEB-INF/web.xml 2013-11-21 10:06:14 UTC (rev 18098)
@@ -0,0 +1,16 @@
+<?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/j2ee/web-app_2_5.xsd">
+
+ <servlet>
+ <servlet-name>EpServlet</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.cxf.jaspi.EndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>EpServlet</servlet-name>
+ <url-pattern>/JaspiEndpoint</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
Property changes on: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jaspi/WEB-INF/web.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
11 years, 1 month