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()];