JBossWS SVN: r18136 - common/trunk/src/main/java/org/jboss/ws/common/monitoring.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-05 03:50:22 -0500 (Thu, 05 Dec 2013)
New Revision: 18136
Modified:
common/trunk/src/main/java/org/jboss/ws/common/monitoring/HostFilter.java
Log:
Fixing previous commit
Modified: common/trunk/src/main/java/org/jboss/ws/common/monitoring/HostFilter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/monitoring/HostFilter.java 2013-12-05 00:19:30 UTC (rev 18135)
+++ common/trunk/src/main/java/org/jboss/ws/common/monitoring/HostFilter.java 2013-12-05 08:50:22 UTC (rev 18136)
@@ -57,7 +57,6 @@
final List<String> l = new LinkedList<String>(hosts);
this.hosts = Collections.unmodifiableList(l);
}
- this.hosts.addAll(hosts);
this.source = source;
}
11 years, 1 month
JBossWS SVN: r18135 - in common/trunk/src/main/java/org/jboss/ws/common: management and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-04 19:19:30 -0500 (Wed, 04 Dec 2013)
New Revision: 18135
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
common/trunk/src/main/java/org/jboss/ws/common/monitoring/AbstractRecordProcessor.java
common/trunk/src/main/java/org/jboss/ws/common/monitoring/HostFilter.java
common/trunk/src/main/java/org/jboss/ws/common/monitoring/LogRecorder.java
common/trunk/src/main/java/org/jboss/ws/common/monitoring/MemoryBufferRecorder.java
common/trunk/src/main/java/org/jboss/ws/common/monitoring/RecordFactory.java
Log:
Misc concurrency issue prevention from ThreadSafe analysis
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java 2013-12-04 21:33:50 UTC (rev 18134)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java 2013-12-05 00:19:30 UTC (rev 18135)
@@ -23,7 +23,7 @@
import java.util.Iterator;
import java.util.List;
-import java.util.Vector;
+import java.util.concurrent.CopyOnWriteArrayList;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
@@ -67,7 +67,7 @@
protected LifecycleHandler lifecycleHandler;
protected EndpointMetrics metrics;
protected String address;
- protected List<RecordProcessor> recordProcessors = new Vector<RecordProcessor>(2);
+ protected List<RecordProcessor> recordProcessors = new CopyOnWriteArrayList<RecordProcessor>();
protected SecurityDomainContext securityDomainContext;
protected InstanceProvider instanceProvider;
@@ -262,7 +262,7 @@
public void setRecordProcessors(List<RecordProcessor> recordProcessors)
{
- this.recordProcessors = new Vector<RecordProcessor>(recordProcessors);
+ this.recordProcessors = new CopyOnWriteArrayList<RecordProcessor>(recordProcessors);
}
public void processRecord(Record record)
Modified: common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2013-12-04 21:33:50 UTC (rev 18134)
+++ common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2013-12-05 00:19:30 UTC (rev 18135)
@@ -88,7 +88,7 @@
private final Object modifySOAPAddressLock = new Object();
//The stack config
- protected StackConfig stackConfig;
+ protected volatile StackConfig stackConfig;
// The default endpoint configs, if any
private final List<ClientConfig> clientConfigs = new CopyOnWriteArrayList<ClientConfig>();
// The default endpoint configs, if any
Modified: common/trunk/src/main/java/org/jboss/ws/common/monitoring/AbstractRecordProcessor.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/monitoring/AbstractRecordProcessor.java 2013-12-04 21:33:50 UTC (rev 18134)
+++ common/trunk/src/main/java/org/jboss/ws/common/monitoring/AbstractRecordProcessor.java 2013-12-05 00:19:30 UTC (rev 18135)
@@ -22,7 +22,7 @@
package org.jboss.ws.common.monitoring;
import java.util.List;
-import java.util.Vector;
+import java.util.concurrent.CopyOnWriteArrayList;
import org.jboss.ws.api.monitoring.Record;
import org.jboss.ws.api.monitoring.RecordFilter;
@@ -37,7 +37,9 @@
*/
public abstract class AbstractRecordProcessor implements RecordProcessor
{
- protected List<RecordFilter> filters = new Vector<RecordFilter>(1);
+ private static final long serialVersionUID = -1825185742740851152L;
+
+ protected List<RecordFilter> filters = new CopyOnWriteArrayList<RecordFilter>();
protected boolean processDestinationHost = true;
protected boolean processSourceHost = true;
protected boolean processHeaders = true;
@@ -72,7 +74,7 @@
public void setFilters(List<RecordFilter> filters)
{
- this.filters = new Vector<RecordFilter>(filters);
+ this.filters = new CopyOnWriteArrayList<RecordFilter>(filters);
}
public boolean isProcessDestinationHost()
@@ -159,7 +161,7 @@
public Object clone() throws CloneNotSupportedException
{
AbstractRecordProcessor retObj = (AbstractRecordProcessor)super.clone();
- retObj.filters = new Vector<RecordFilter>();
+ retObj.filters = new CopyOnWriteArrayList<RecordFilter>();
for (RecordFilter fil : this.filters)
{
RecordFilter clFil = (RecordFilter)fil.clone();
Modified: common/trunk/src/main/java/org/jboss/ws/common/monitoring/HostFilter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/monitoring/HostFilter.java 2013-12-04 21:33:50 UTC (rev 18134)
+++ common/trunk/src/main/java/org/jboss/ws/common/monitoring/HostFilter.java 2013-12-05 00:19:30 UTC (rev 18135)
@@ -22,6 +22,7 @@
package org.jboss.ws.common.monitoring;
import java.util.Collection;
+import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@@ -39,17 +40,23 @@
{
private static final long serialVersionUID = -5935962601380315102L;
- private List<String> hosts = new LinkedList<String>();
- private boolean source;
+ private final List<String> hosts;
+ private final boolean source;
public HostFilter(String host, boolean source)
{
- this.hosts.add(host);
+ this.hosts = Collections.singletonList(host);
this.source = source;
}
public HostFilter(Collection<String> hosts, boolean source)
{
+ if (hosts instanceof List) {
+ this.hosts = Collections.unmodifiableList((List<String>)hosts);
+ } else {
+ final List<String> l = new LinkedList<String>(hosts);
+ this.hosts = Collections.unmodifiableList(l);
+ }
this.hosts.addAll(hosts);
this.source = source;
}
@@ -79,9 +86,6 @@
@Override
public Object clone() throws CloneNotSupportedException
{
- HostFilter retObj = (HostFilter)super.clone();
- retObj.hosts = new LinkedList<String>(this.hosts);
- retObj.source = this.source;
- return retObj;
+ return new HostFilter(this.hosts, this.source);
}
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/monitoring/LogRecorder.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/monitoring/LogRecorder.java 2013-12-04 21:33:50 UTC (rev 18134)
+++ common/trunk/src/main/java/org/jboss/ws/common/monitoring/LogRecorder.java 2013-12-05 00:19:30 UTC (rev 18135)
@@ -48,6 +48,9 @@
@Override
public void processRecord(Record record)
{
+ if (!Loggers.MONITORING_LOGGER.isDebugEnabled()) {
+ return;
+ }
StringBuilder sb = new StringBuilder();
if (this.isProcessMessageType())
{
Modified: common/trunk/src/main/java/org/jboss/ws/common/monitoring/MemoryBufferRecorder.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/monitoring/MemoryBufferRecorder.java 2013-12-04 21:33:50 UTC (rev 18134)
+++ common/trunk/src/main/java/org/jboss/ws/common/monitoring/MemoryBufferRecorder.java 2013-12-05 00:19:30 UTC (rev 18135)
@@ -51,7 +51,7 @@
private Map<String, List<Record>> recentRecords = Collections.synchronizedMap(new HashMap<String, List<Record>>());
private ConcurrentLinkedQueue<String> recentRecordGroups = new ConcurrentLinkedQueue<String>();
- private int size = 0;
+ private volatile int size = 0;
private volatile int maxSize = 50;
public MemoryBufferRecorder()
@@ -273,20 +273,23 @@
{
MemoryBufferRecorder cl = (MemoryBufferRecorder)super.clone();
cl.recentRecords = Collections.synchronizedMap(new HashMap<String, List<Record>>());
- for (String key : this.recentRecords.keySet())
+ synchronized (this.recentRecords)
{
- List<Record> list = new LinkedList<Record>();
- for (Record record : this.recentRecords.get(key))
+ for (String key : this.recentRecords.keySet())
{
- list.add(record);
+ List<Record> list = new LinkedList<Record>();
+ for (Record record : this.recentRecords.get(key))
+ {
+ list.add(record);
+ }
+ cl.recentRecords.put(key, list);
}
- cl.recentRecords.put(key, list);
+ cl.recentRecordGroups = new ConcurrentLinkedQueue<String>();
+ for (String id : this.recentRecordGroups)
+ {
+ cl.recentRecordGroups.add(id);
+ }
}
- cl.recentRecordGroups = new ConcurrentLinkedQueue<String>();
- for (String id : this.recentRecordGroups)
- {
- cl.recentRecordGroups.add(id);
- }
cl.maxSize = this.maxSize;
cl.size = this.size;
return cl;
Modified: common/trunk/src/main/java/org/jboss/ws/common/monitoring/RecordFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/monitoring/RecordFactory.java 2013-12-04 21:33:50 UTC (rev 18134)
+++ common/trunk/src/main/java/org/jboss/ws/common/monitoring/RecordFactory.java 2013-12-05 00:19:30 UTC (rev 18135)
@@ -40,8 +40,8 @@
synchronized (RecordFactory.class)
{
count++;
+ sb.append(count);
}
- sb.append(count);
sb.append("-");
sb.append(time);
return sb.toString();
11 years, 1 month
JBossWS SVN: r18134 - in container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices: dmr and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-04 16:33:50 -0500 (Wed, 04 Dec 2013)
New Revision: 18134
Modified:
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/config/ServerConfigImpl.java
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/PropertyAdd.java
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSExtension.java
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/PropertyService.java
Log:
[JBWS-3708] Enforce client/endpoint config immutability at runtime; use new CommonConfigStore concept for updating client config
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/config/ServerConfigImpl.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/config/ServerConfigImpl.java 2013-12-04 21:32:22 UTC (rev 18133)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/config/ServerConfigImpl.java 2013-12-04 21:33:50 UTC (rev 18134)
@@ -29,6 +29,7 @@
import org.jboss.msc.value.InjectedValue;
import org.jboss.ws.common.management.AbstractServerConfig;
import org.jboss.ws.common.management.AbstractServerConfigMBean;
+import org.jboss.wsf.spi.metadata.config.ClientConfig;
/**
* AS specific ServerConfig.
@@ -84,4 +85,7 @@
return new ServerConfigImpl();
}
+ public void setClientConfigWrapper(ClientConfig config, boolean reload) {
+ clientConfigStore.setWrapperConfig(config, reload);
+ }
}
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java 2013-12-04 21:32:22 UTC (rev 18133)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java 2013-12-04 21:33:50 UTC (rev 18134)
@@ -32,6 +32,7 @@
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.ServiceVerificationHandler;
import org.jboss.as.webservices.service.ConfigService;
+import org.jboss.as.webservices.service.PropertyService;
import org.jboss.as.webservices.util.ASHelper;
import org.jboss.as.webservices.util.WSServices;
import org.jboss.dmr.ModelNode;
@@ -79,9 +80,10 @@
final ConfigService clientConfigService = new ConfigService(serverConfig, name, true);
final ServiceTarget target = context.getServiceTarget();
final ServiceBuilder<?> clientServiceBuilder = target.addService(serviceName, clientConfigService);
- setDependency(context, clientServiceBuilder, clientConfigService.getPreHandlerChainsInjector(), serviceName, address, Constants.PRE_HANDLER_CHAIN);
+ setDependency(context, clientServiceBuilder, clientConfigService.getPropertiesInjector(), PropertyService.class, serviceName, address, Constants.PROPERTY);
+ setDependency(context, clientServiceBuilder, clientConfigService.getPreHandlerChainsInjector(), UnifiedHandlerChainMetaData.class, serviceName, address, Constants.PRE_HANDLER_CHAIN);
final Injector<UnifiedHandlerChainMetaData> postInjector = clientConfigService.getPostHandlerChainsInjector();
- setDependency(context, clientServiceBuilder, postInjector, serviceName, address, Constants.POST_HANDLER_CHAIN);
+ setDependency(context, clientServiceBuilder, postInjector, UnifiedHandlerChainMetaData.class, serviceName, address, Constants.POST_HANDLER_CHAIN);
ServiceController<?> controller = clientServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
newControllers.add(controller);
@@ -91,10 +93,10 @@
}
}
- private void setDependency(final OperationContext context, final ServiceBuilder<?> builder, final Injector<UnifiedHandlerChainMetaData> injector,
- final ServiceName serviceName, final PathAddress address, final String handlerChainType) {
+ private <T> void setDependency(final OperationContext context, final ServiceBuilder<?> builder, final Injector<T> injector,
+ final Class<T> injectedClass, final ServiceName serviceName, final PathAddress address, final String handlerChainType) {
for (ServiceName sn : PackageUtils.getServiceNameDependencies(context, serviceName, address, handlerChainType)) {
- builder.addDependency(sn, UnifiedHandlerChainMetaData.class, injector);
+ builder.addDependency(sn, injectedClass, injector);
}
}
}
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java 2013-12-04 21:32:22 UTC (rev 18133)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java 2013-12-04 21:33:50 UTC (rev 18134)
@@ -17,7 +17,9 @@
/** {@inheritDoc} */
public void inject(final T value) throws InjectionException {
synchronized (list) {
- list.add(value);
+ if (value != null) {
+ list.add(value);
+ }
super.inject(value);
}
}
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/PropertyAdd.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/PropertyAdd.java 2013-12-04 21:32:22 UTC (rev 18133)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/PropertyAdd.java 2013-12-04 21:33:50 UTC (rev 18134)
@@ -41,7 +41,6 @@
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceTarget;
-import org.jboss.wsf.spi.metadata.config.AbstractCommonConfig;
/**
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
@@ -74,7 +73,7 @@
final String configName = confElem.getValue();
final String propertyValue = operation.has(VALUE) ? Attributes.VALUE.resolveModelAttribute(context,operation).asString() : null;
- final PropertyService<AbstractCommonConfig> service = new PropertyService<AbstractCommonConfig>(propertyName, propertyValue);
+ final PropertyService service = new PropertyService(propertyName, propertyValue);
final ServiceTarget target = context.getServiceTarget();
final ServiceName configServiceName = getConfigServiceName(configType, configName);
if (context.getServiceRegistry(false).getService(configServiceName) == null) {
@@ -83,7 +82,6 @@
final ServiceName propertyServiceName = getPropertyServiceName(configServiceName, propertyName);
final ServiceBuilder<?> propertyServiceBuilder = target.addService(propertyServiceName, service);
- propertyServiceBuilder.addDependency(configServiceName, AbstractCommonConfig.class, service.getAbstractCommonConfig());
ServiceController<?> controller = propertyServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
newControllers.add(controller);
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSExtension.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSExtension.java 2013-12-04 21:32:22 UTC (rev 18133)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSExtension.java 2013-12-04 21:33:50 UTC (rev 18134)
@@ -39,7 +39,6 @@
import org.jboss.as.controller.ResourceBuilder;
import org.jboss.as.controller.ResourceDefinition;
import org.jboss.as.controller.SubsystemRegistration;
-import org.jboss.as.controller.descriptions.ModelDescriptionConstants;
import org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver;
import org.jboss.as.controller.parsing.ExtensionParsingContext;
import org.jboss.as.controller.registry.ManagementResourceRegistration;
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java 2013-12-04 21:32:22 UTC (rev 18133)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java 2013-12-04 21:33:50 UTC (rev 18134)
@@ -22,8 +22,9 @@
package org.jboss.as.webservices.service;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.Map;
import org.jboss.as.webservices.dmr.ListInjector;
import org.jboss.msc.inject.Injector;
@@ -50,6 +51,7 @@
private final boolean client;
private final List<UnifiedHandlerChainMetaData> preHandlerChains = new ArrayList<UnifiedHandlerChainMetaData>(1);
private final List<UnifiedHandlerChainMetaData> postHandlerChains = new ArrayList<UnifiedHandlerChainMetaData>(1);
+ private final List<PropertyService> properties = new ArrayList<PropertyService>(1);
private volatile AbstractCommonConfig config;
public ConfigService(ServerConfig serverConfig, String configName, boolean client) {
@@ -65,19 +67,20 @@
@Override
public void start(final StartContext context) throws StartException {
+ Map<String, String> props = null;
+ if (!properties.isEmpty()) {
+ props = new HashMap<String, String>(properties.size(), 1);
+ for (PropertyService ps : properties) {
+ props.put(ps.getPropName(), ps.getPropValue());
+ }
+ }
if (client) {
- ClientConfig clientConfig = new ClientConfig();
- clientConfig.setConfigName(configName);
- clientConfig.setPreHandlerChains(new CopyOnWriteArrayList<UnifiedHandlerChainMetaData>(preHandlerChains));
- clientConfig.setPostHandlerChains(new CopyOnWriteArrayList<UnifiedHandlerChainMetaData>(postHandlerChains));
- serverConfig.addClientConfig(clientConfig);
+ ClientConfig clientConfig = new ClientConfig(configName, preHandlerChains, postHandlerChains, props, null);
+ serverConfig.registerClientConfig(clientConfig);
config = clientConfig;
} else {
- EndpointConfig endpointConfig = new EndpointConfig();
- endpointConfig.setConfigName(configName);
- endpointConfig.setPreHandlerChains(new CopyOnWriteArrayList<UnifiedHandlerChainMetaData>(preHandlerChains));
- endpointConfig.setPostHandlerChains(new CopyOnWriteArrayList<UnifiedHandlerChainMetaData>(postHandlerChains));
- serverConfig.addEndpointConfig(endpointConfig);
+ EndpointConfig endpointConfig = new EndpointConfig(configName, preHandlerChains, postHandlerChains, props, null);
+ serverConfig.registerEndpointConfig(endpointConfig);
config = endpointConfig;
}
}
@@ -85,9 +88,9 @@
@Override
public void stop(final StopContext context) {
if (client) {
- serverConfig.getClientConfigs().remove(config);
+ serverConfig.unregisterClientConfig((ClientConfig)config);
} else {
- serverConfig.getEndpointConfigs().remove(config);
+ serverConfig.unregisterEndpointConfig((EndpointConfig)config);
}
}
@@ -99,4 +102,8 @@
return new ListInjector<UnifiedHandlerChainMetaData>(postHandlerChains);
}
+ public Injector<PropertyService> getPropertiesInjector() {
+ return new ListInjector<PropertyService>(properties);
+ }
+
}
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/PropertyService.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/PropertyService.java 2013-12-04 21:32:22 UTC (rev 18133)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/PropertyService.java 2013-12-04 21:33:50 UTC (rev 18134)
@@ -25,19 +25,16 @@
import org.jboss.msc.service.StartContext;
import org.jboss.msc.service.StartException;
import org.jboss.msc.service.StopContext;
-import org.jboss.msc.value.InjectedValue;
-import org.jboss.wsf.spi.metadata.config.AbstractCommonConfig;
/**
- * A service for setting a property into an endpoint / client config.
+ * A service for getting a property to be stored in endpoint / client config.
*
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
*/
-public final class PropertyService<T extends AbstractCommonConfig> implements Service<String> {
+public final class PropertyService implements Service<PropertyService> {
- private InjectedValue<T> abstractCommonConfig = new InjectedValue<T>();
- private final String propValue;
private final String propName;
+ private final String propValue;
public PropertyService(String propName, String propValue) {
this.propValue = propValue;
@@ -45,29 +42,25 @@
}
@Override
- public String getValue() {
+ public PropertyService getValue() {
+ return this;
+ }
+
+ public String getPropName() {
+ return propName;
+ }
+
+ public String getPropValue() {
return propValue;
}
@Override
public void start(final StartContext context) throws StartException {
- final AbstractCommonConfig commonConfig = abstractCommonConfig.getValue();
- synchronized (commonConfig) { //JBWS-3707
- commonConfig.setProperty(propName, propValue);
- }
+ //NOOP
}
@Override
public void stop(final StopContext context) {
- final AbstractCommonConfig commonConfig = abstractCommonConfig.getValue();
- synchronized (commonConfig) { //JBWS-3707
- if (commonConfig.getProperties().containsKey(propName)) {
- commonConfig.getProperties().remove(propName);
- }
- }
+ //NOOP
}
-
- public InjectedValue<T> getAbstractCommonConfig() {
- return abstractCommonConfig;
- }
}
11 years, 1 month
JBossWS SVN: r18133 - container/jboss72/branches/jbossws-jboss720-JBWS-3739.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-04 16:32:22 -0500 (Wed, 04 Dec 2013)
New Revision: 18133
Modified:
container/jboss72/branches/jbossws-jboss720-JBWS-3739/pom.xml
Log:
Updating common version
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/pom.xml
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/pom.xml 2013-12-04 14:57:16 UTC (rev 18132)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/pom.xml 2013-12-04 21:32:22 UTC (rev 18133)
@@ -52,7 +52,7 @@
<properties>
<jbossws.api.version>1.0.2.Final</jbossws.api.version>
<jbossws.spi.version>2.3.0.Alpha1-SNAPSHOT</jbossws.spi.version>
- <jbossws.common.version>2.2.3.Final</jbossws.common.version>
+ <jbossws.common.version>2.3.0.Alpha1-SNAPSHOT</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.2.Final</jboss.jaxws.api.version>
11 years, 1 month
JBossWS SVN: r18132 - in stack/cxf/branches/JBWS-3739/modules/testsuite: cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-04 09:57:16 -0500 (Wed, 04 Dec 2013)
New Revision: 18132
Modified:
stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/TestUtils.java
stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/Helper.java
stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/TestUtils.java
Log:
[JBWS-3708] Fixing testsuite too
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/TestUtils.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/TestUtils.java 2013-12-04 14:56:33 UTC (rev 18131)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/TestUtils.java 2013-12-04 14:57:16 UTC (rev 18132)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2012, 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,7 +22,6 @@
package org.jboss.test.ws.jaxws.cxf.clientConfig;
import java.util.Collections;
-import java.util.Iterator;
import java.util.Map;
import org.jboss.wsf.spi.SPIProvider;
@@ -42,12 +41,7 @@
{
public static ClientConfig getAndVerifyDefaultClientConfiguration() throws Exception {
ServerConfig sc = getServerConfig();
- ClientConfig defaultConfig = null;
- for (ClientConfig c : sc.getClientConfigs()) {
- if (ClientConfig.STANDARD_CLIENT_CONFIG.equals(c.getConfigName())) {
- defaultConfig = c;
- }
- }
+ ClientConfig defaultConfig = sc.getClientConfig(ClientConfig.STANDARD_CLIENT_CONFIG);
if (defaultConfig == null) {
throw new Exception("Missing AS client config '" + ClientConfig.STANDARD_CLIENT_CONFIG + "'!");
}
@@ -60,12 +54,7 @@
public static void cleanupClientConfig() throws Exception {
ServerConfig sc = getServerConfig();
- ClientConfig defaultConfig = null;
- for (ClientConfig c : sc.getClientConfigs()) {
- if (ClientConfig.STANDARD_CLIENT_CONFIG.equals(c.getConfigName())) {
- defaultConfig = c;
- }
- }
+ ClientConfig defaultConfig = sc.getClientConfig(ClientConfig.STANDARD_CLIENT_CONFIG);
if (defaultConfig == null) {
throw new Exception("Missing AS client config '" + ClientConfig.STANDARD_CLIENT_CONFIG + "'!");
}
@@ -78,23 +67,15 @@
public static void addTestCaseClientConfiguration(String testConfigName) {
ClientConfig config = new ClientConfig(testConfigName, null, null, Collections.singletonMap("propT", "valueT"), null);
- getServerConfig().addClientConfig(config);
+ ServerConfig sc = getServerConfig();
+ sc.registerClientConfig(config);
+ sc.reloadClientConfigs();
}
public static void removeTestCaseClientConfiguration(String testConfigName) {
ServerConfig sc = getServerConfig();
- Iterator<ClientConfig> it = sc.getClientConfigs().iterator();
- ClientConfig toBeRemoved = null;
- while (it.hasNext()) {
- ClientConfig c = it.next();
- if (testConfigName.equals(c.getConfigName())) {
- toBeRemoved = c;
- break;
- }
- }
- if (toBeRemoved != null) {
- sc.getClientConfigs().remove(toBeRemoved);
- }
+ sc.unregisterClientConfig(new ClientConfig(testConfigName, null, null, null, null));
+ sc.reloadClientConfigs();
}
private static ServerConfig getServerConfig()
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/Helper.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/Helper.java 2013-12-04 14:56:33 UTC (rev 18131)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/Helper.java 2013-12-04 14:57:16 UTC (rev 18132)
@@ -22,7 +22,6 @@
package org.jboss.test.ws.jaxws.samples.schemavalidation;
import java.net.URL;
-import java.util.List;
import java.util.Map;
import javax.xml.namespace.QName;
@@ -118,14 +117,8 @@
protected static AbstractCommonConfig getAndVerifyDefaultConfiguration(boolean client) throws Exception {
ServerConfig sc = getServerConfig();
- AbstractCommonConfig defaultConfig = null;
- final List<? extends AbstractCommonConfig> cfgs = client ? sc.getClientConfigs() : sc.getEndpointConfigs();
final String DEFCFG = client ? ClientConfig.STANDARD_CLIENT_CONFIG : EndpointConfig.STANDARD_ENDPOINT_CONFIG;
- for (AbstractCommonConfig c : cfgs) {
- if (DEFCFG.equals(c.getConfigName())) {
- defaultConfig = c;
- }
- }
+ final AbstractCommonConfig defaultConfig = client ? sc.getClientConfig(DEFCFG) : sc.getEndpointConfig(DEFCFG);
if (defaultConfig == null) {
throw new Exception("Missing AS config '" + DEFCFG + "'!");
}
@@ -143,14 +136,8 @@
protected static void cleanupConfig(boolean client) throws Exception {
ServerConfig sc = getServerConfig();
- AbstractCommonConfig defaultConfig = null;
- final List<? extends AbstractCommonConfig> cfgs = client ? sc.getClientConfigs() : sc.getEndpointConfigs();
final String DEFCFG = client ? ClientConfig.STANDARD_CLIENT_CONFIG : EndpointConfig.STANDARD_ENDPOINT_CONFIG;
- for (AbstractCommonConfig c : cfgs) {
- if (DEFCFG.equals(c.getConfigName())) {
- defaultConfig = c;
- }
- }
+ final AbstractCommonConfig defaultConfig = client ? sc.getClientConfig(DEFCFG) : sc.getEndpointConfig(DEFCFG);
if (defaultConfig == null) {
throw new Exception("Missing AS config '" + DEFCFG + "'!");
}
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/TestUtils.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/TestUtils.java 2013-12-04 14:56:33 UTC (rev 18131)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/TestUtils.java 2013-12-04 14:57:16 UTC (rev 18132)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2012, 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,7 +22,6 @@
package org.jboss.test.ws.jaxws.clientConfig;
import java.util.Collections;
-import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
@@ -47,12 +46,7 @@
{
public static ClientConfig getAndVerifyDefaultClientConfiguration() throws Exception {
ServerConfig sc = getServerConfig();
- ClientConfig defaultConfig = null;
- for (ClientConfig c : sc.getClientConfigs()) {
- if (ClientConfig.STANDARD_CLIENT_CONFIG.equals(c.getConfigName())) {
- defaultConfig = c;
- }
- }
+ ClientConfig defaultConfig = sc.getClientConfig(ClientConfig.STANDARD_CLIENT_CONFIG);
if (defaultConfig == null) {
throw new Exception("Missing AS client config '" + ClientConfig.STANDARD_CLIENT_CONFIG + "'!");
}
@@ -97,23 +91,15 @@
UnifiedHandlerChainMetaData uhcmd = new UnifiedHandlerChainMetaData(null, null, null, Collections.singletonList(handler), false, null);
List<UnifiedHandlerChainMetaData> preHC = new LinkedList<UnifiedHandlerChainMetaData>();
preHC.add(uhcmd);
- getServerConfig().addClientConfig(new ClientConfig(testConfigName, preHC, null, null, null));
+ ServerConfig sc = getServerConfig();
+ sc.registerClientConfig(new ClientConfig(testConfigName, preHC, null, null, null));
+ sc.reloadClientConfigs();
}
public static void removeTestCaseClientConfiguration(String testConfigName) {
ServerConfig sc = getServerConfig();
- Iterator<ClientConfig> it = sc.getClientConfigs().iterator();
- ClientConfig toBeRemoved = null;
- while (it.hasNext()) {
- ClientConfig c = it.next();
- if (testConfigName.equals(c.getConfigName())) {
- toBeRemoved = c;
- break;
- }
- }
- if (toBeRemoved != null) {
- sc.getClientConfigs().remove(toBeRemoved);
- }
+ sc.unregisterClientConfig(new ClientConfig(testConfigName, null, null, null, null));
+ sc.reloadClientConfigs();
}
private static ServerConfig getServerConfig()
11 years, 1 month
JBossWS SVN: r18131 - in stack/cxf/branches/JBWS-3739/modules: server/src/main/java/org/jboss/wsf/stack/cxf/configuration and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-04 09:56:33 -0500 (Wed, 04 Dec 2013)
New Revision: 18131
Modified:
stack/cxf/branches/JBWS-3739/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
stack/cxf/branches/JBWS-3739/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
Log:
[JBWS-3708] Update to latest spi
Modified: stack/cxf/branches/JBWS-3739/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2013-12-04 14:53:48 UTC (rev 18130)
+++ stack/cxf/branches/JBWS-3739/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2013-12-04 14:56:33 UTC (rev 18131)
@@ -589,12 +589,11 @@
if (jbossModulesEnv) { //optimization for avoiding checking for a server config when we know for sure we're out-of-container
ServerConfig sc = getServerConfig();
if (sc != null) {
- for (ClientConfig config : sc.getClientConfigs()) {
- if (config.getConfigName().equals(ClientConfig.STANDARD_CLIENT_CONFIG)) {
- CXFClientConfigurer helper = new CXFClientConfigurer();
- helper.setupConfigHandlers(binding, config);
- helper.setConfigProperties(client, config.getProperties());
- }
+ ClientConfig config = sc.getClientConfig(ClientConfig.STANDARD_CLIENT_CONFIG);
+ if (config != null) {
+ CXFClientConfigurer helper = new CXFClientConfigurer();
+ helper.setupConfigHandlers(binding, config);
+ helper.setConfigProperties(client, config.getProperties());
}
}
}
Modified: stack/cxf/branches/JBWS-3739/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2013-12-04 14:53:48 UTC (rev 18130)
+++ stack/cxf/branches/JBWS-3739/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2013-12-04 14:56:33 UTC (rev 18131)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, 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.
*
@@ -135,13 +135,9 @@
{
//use endpoint configs from AS domain
ServerConfig sc = AbstractServerConfig.getServerIntegrationServerConfig();
- for (org.jboss.wsf.spi.metadata.config.EndpointConfig config : sc.getEndpointConfigs())
- {
- if (config.getConfigName().equals(configName))
- {
- endpoint.setEndpointConfig(config);
- break;
- }
+ org.jboss.wsf.spi.metadata.config.EndpointConfig config = sc.getEndpointConfig(configName);
+ if (config != null) {
+ endpoint.setEndpointConfig(config);
}
}
else
11 years, 1 month
JBossWS SVN: r18130 - in stack/cxf/branches/JBWS-3739: modules/addons and 12 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-04 09:53:48 -0500 (Wed, 04 Dec 2013)
New Revision: 18130
Modified:
stack/cxf/branches/JBWS-3739/modules/addons/pom.xml
stack/cxf/branches/JBWS-3739/modules/addons/transports/http/httpserver/pom.xml
stack/cxf/branches/JBWS-3739/modules/addons/transports/udp/pom.xml
stack/cxf/branches/JBWS-3739/modules/client/pom.xml
stack/cxf/branches/JBWS-3739/modules/dist/pom.xml
stack/cxf/branches/JBWS-3739/modules/endorsed/pom.xml
stack/cxf/branches/JBWS-3739/modules/resources/pom.xml
stack/cxf/branches/JBWS-3739/modules/server/pom.xml
stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-spring-tests/pom.xml
stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/pom.xml
stack/cxf/branches/JBWS-3739/modules/testsuite/pom.xml
stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/pom.xml
stack/cxf/branches/JBWS-3739/modules/testsuite/test-utils/pom.xml
stack/cxf/branches/JBWS-3739/pom.xml
Log:
Updating poms for building to a different version
Modified: stack/cxf/branches/JBWS-3739/modules/addons/pom.xml
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/addons/pom.xml 2013-12-04 14:52:49 UTC (rev 18129)
+++ stack/cxf/branches/JBWS-3739/modules/addons/pom.xml 2013-12-04 14:53:48 UTC (rev 18130)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.0.Alpha1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: stack/cxf/branches/JBWS-3739/modules/addons/transports/http/httpserver/pom.xml
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/addons/transports/http/httpserver/pom.xml 2013-12-04 14:52:49 UTC (rev 18129)
+++ stack/cxf/branches/JBWS-3739/modules/addons/transports/http/httpserver/pom.xml 2013-12-04 14:53:48 UTC (rev 18130)
@@ -8,7 +8,7 @@
<parent>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-addons</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.0.Alpha1-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
Modified: stack/cxf/branches/JBWS-3739/modules/addons/transports/udp/pom.xml
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/addons/transports/udp/pom.xml 2013-12-04 14:52:49 UTC (rev 18129)
+++ stack/cxf/branches/JBWS-3739/modules/addons/transports/udp/pom.xml 2013-12-04 14:53:48 UTC (rev 18130)
@@ -8,7 +8,7 @@
<parent>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-addons</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.0.Alpha1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: stack/cxf/branches/JBWS-3739/modules/client/pom.xml
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/client/pom.xml 2013-12-04 14:52:49 UTC (rev 18129)
+++ stack/cxf/branches/JBWS-3739/modules/client/pom.xml 2013-12-04 14:53:48 UTC (rev 18130)
@@ -8,7 +8,7 @@
<parent>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.0.Alpha1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: stack/cxf/branches/JBWS-3739/modules/dist/pom.xml
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/dist/pom.xml 2013-12-04 14:52:49 UTC (rev 18129)
+++ stack/cxf/branches/JBWS-3739/modules/dist/pom.xml 2013-12-04 14:53:48 UTC (rev 18130)
@@ -8,7 +8,7 @@
<parent>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.0.Alpha1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: stack/cxf/branches/JBWS-3739/modules/endorsed/pom.xml
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/endorsed/pom.xml 2013-12-04 14:52:49 UTC (rev 18129)
+++ stack/cxf/branches/JBWS-3739/modules/endorsed/pom.xml 2013-12-04 14:53:48 UTC (rev 18130)
@@ -9,7 +9,7 @@
<parent>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.0.Alpha1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: stack/cxf/branches/JBWS-3739/modules/resources/pom.xml
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/resources/pom.xml 2013-12-04 14:52:49 UTC (rev 18129)
+++ stack/cxf/branches/JBWS-3739/modules/resources/pom.xml 2013-12-04 14:53:48 UTC (rev 18130)
@@ -9,7 +9,7 @@
<parent>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.0.Alpha1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: stack/cxf/branches/JBWS-3739/modules/server/pom.xml
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/server/pom.xml 2013-12-04 14:52:49 UTC (rev 18129)
+++ stack/cxf/branches/JBWS-3739/modules/server/pom.xml 2013-12-04 14:53:48 UTC (rev 18130)
@@ -9,7 +9,7 @@
<parent>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.0.Alpha1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-spring-tests/pom.xml
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-spring-tests/pom.xml 2013-12-04 14:52:49 UTC (rev 18129)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-spring-tests/pom.xml 2013-12-04 14:53:48 UTC (rev 18130)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-testsuite</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.0.Alpha1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/pom.xml
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/pom.xml 2013-12-04 14:52:49 UTC (rev 18129)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/pom.xml 2013-12-04 14:53:48 UTC (rev 18130)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-testsuite</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.0.Alpha1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/pom.xml 2013-12-04 14:52:49 UTC (rev 18129)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/pom.xml 2013-12-04 14:53:48 UTC (rev 18130)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.0.Alpha1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/pom.xml
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/pom.xml 2013-12-04 14:52:49 UTC (rev 18129)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/pom.xml 2013-12-04 14:53:48 UTC (rev 18130)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-testsuite</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.0.Alpha1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/test-utils/pom.xml
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/test-utils/pom.xml 2013-12-04 14:52:49 UTC (rev 18129)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/test-utils/pom.xml 2013-12-04 14:53:48 UTC (rev 18130)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-testsuite</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.0.Alpha1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: stack/cxf/branches/JBWS-3739/pom.xml
===================================================================
--- stack/cxf/branches/JBWS-3739/pom.xml 2013-12-04 14:52:49 UTC (rev 18129)
+++ stack/cxf/branches/JBWS-3739/pom.xml 2013-12-04 14:53:48 UTC (rev 18130)
@@ -32,7 +32,7 @@
<description>JBossWS CXF stack</description>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.0.Alpha1-SNAPSHOT</version>
<!-- Parent -->
<parent>
@@ -61,7 +61,7 @@
<properties>
<jbossws.api.version>1.0.2.Final</jbossws.api.version>
<jbossws.spi.version>2.3.0.Alpha1-SNAPSHOT</jbossws.spi.version>
- <jbossws.common.version>2.3.0-SNAPSHOT</jbossws.common.version>
+ <jbossws.common.version>2.3.0.Alpha1-SNAPSHOT</jbossws.common.version>
<jbossws.common.tools.version>1.2.0.Final</jbossws.common.tools.version>
<jbossws.jboss712.version>4.2.1.Final</jbossws.jboss712.version>
<jbossws.jboss713.version>4.2.1.Final</jbossws.jboss713.version>
11 years, 1 month
JBossWS SVN: r18129 - in common/branches/JBWS-3739/src/main/java/org/jboss/ws/common: management and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-04 09:52:49 -0500 (Wed, 04 Dec 2013)
New Revision: 18129
Added:
common/branches/JBWS-3739/src/main/java/org/jboss/ws/common/management/CommonConfigStoreImpl.java
Modified:
common/branches/JBWS-3739/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java
common/branches/JBWS-3739/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
Log:
[JBWS-3708] Adding implementation of CommonConfigStore and updating AbstractServerConfig to use it
Modified: common/branches/JBWS-3739/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java
===================================================================
--- common/branches/JBWS-3739/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java 2013-12-04 14:51:38 UTC (rev 18128)
+++ common/branches/JBWS-3739/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java 2013-12-04 14:52:49 UTC (rev 18129)
@@ -113,11 +113,9 @@
} else {
ServerConfig sc = getServerConfig();
if (sc != null) {
- for (ClientConfig config : sc.getClientConfigs()) {
- if (config.getConfigName().equals(configName))
- {
- return config;
- }
+ ClientConfig cf = sc.getClientConfig(configName);
+ if (cf != null) {
+ return cf;
}
}
}
Modified: common/branches/JBWS-3739/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
===================================================================
--- common/branches/JBWS-3739/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2013-12-04 14:51:38 UTC (rev 18128)
+++ common/branches/JBWS-3739/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2013-12-04 14:52:49 UTC (rev 18129)
@@ -26,8 +26,6 @@
import java.net.InetAddress;
import java.net.UnknownHostException;
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
import javax.management.MBeanServer;
import javax.management.ObjectName;
@@ -37,6 +35,7 @@
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.WSFException;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
+import org.jboss.wsf.spi.management.CommonConfigStore;
import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.spi.management.ServerConfigFactory;
import org.jboss.wsf.spi.management.StackConfig;
@@ -89,11 +88,10 @@
//The stack config
protected StackConfig stackConfig;
- // The default endpoint configs, if any
- private final List<ClientConfig> clientConfigs = new CopyOnWriteArrayList<ClientConfig>();
- // The default endpoint configs, if any
- private final List<EndpointConfig> endpointConfigs = new CopyOnWriteArrayList<EndpointConfig>();
+ protected final CommonConfigStore<ClientConfig> clientConfigStore = new CommonConfigStoreImpl<ClientConfig>();
+ protected final CommonConfigStore<EndpointConfig> endpointConfigStore = new CommonConfigStoreImpl<EndpointConfig>();
+
// The server integration classloader' ServerConfig instance reference
private static ServerConfig serverConfig;
@@ -277,6 +275,9 @@
mbeanServer.registerMBean(this, AbstractServerConfigMBean.OBJECT_NAME);
}
+ clientConfigStore.reload();
+ endpointConfigStore.reload();
+
//cleanup the server integration classloader' service config reference as
//a new server config can be created due to a server reload.
synchronized (AbstractServerConfig.class) //synchronization to ensure visibility
@@ -291,6 +292,9 @@
if (mbeanServer != null) {
mbeanServer.unregisterMBean(AbstractServerConfigMBean.OBJECT_NAME);
}
+
+ clientConfigStore.unload();
+ endpointConfigStore.unload();
}
public static ServerConfig getServerIntegrationServerConfig()
@@ -315,27 +319,47 @@
{
return stackConfig.getImplementationVersion();
}
-
- public void addEndpointConfig(EndpointConfig config)
+
+ public void registerClientConfig(ClientConfig config)
{
- this.endpointConfigs.add(config);
+ clientConfigStore.register(config);
}
-
- public void addClientConfig(ClientConfig config)
+
+ public void unregisterClientConfig(ClientConfig config)
{
- this.clientConfigs.add(config);
+ clientConfigStore.unregister(config);
}
-
- public List<EndpointConfig> getEndpointConfigs()
+
+ public void reloadClientConfigs()
{
- return this.endpointConfigs;
+ clientConfigStore.reload();
}
-
- public List<ClientConfig> getClientConfigs()
+
+ public ClientConfig getClientConfig(String name)
{
- return this.clientConfigs;
+ return clientConfigStore.getConfig(name);
}
+ public void registerEndpointConfig(EndpointConfig config)
+ {
+ endpointConfigStore.register(config);
+ }
+
+ public void unregisterEndpointConfig(EndpointConfig config)
+ {
+ endpointConfigStore.unregister(config);
+ }
+
+ public void reloadEndpointConfigs()
+ {
+ endpointConfigStore.reload();
+ }
+
+ public EndpointConfig getEndpointConfig(String name)
+ {
+ return endpointConfigStore.getConfig(name);
+ }
+
public interface UpdateCallbackHandler {
public void onBeforeUpdate();
}
Added: common/branches/JBWS-3739/src/main/java/org/jboss/ws/common/management/CommonConfigStoreImpl.java
===================================================================
--- common/branches/JBWS-3739/src/main/java/org/jboss/ws/common/management/CommonConfigStoreImpl.java (rev 0)
+++ common/branches/JBWS-3739/src/main/java/org/jboss/ws/common/management/CommonConfigStoreImpl.java 2013-12-04 14:52:49 UTC (rev 18129)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.management;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.jboss.wsf.spi.management.CommonConfigStore;
+import org.jboss.wsf.spi.metadata.config.AbstractCommonConfig;
+
+
+/**
+ * A implementation of the CommonConfigStore based on HashMap;
+ * configs are stored using their name as key.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 04-Dec-2013
+ */
+public class CommonConfigStoreImpl<T extends AbstractCommonConfig> implements CommonConfigStore<T>
+{
+ private final Map<String, T> configs = new HashMap<String, T>(4);
+ private volatile T wrapper;
+ private volatile Map<String, T> loadedConfigs = Collections.emptyMap();
+
+ @Override
+ public synchronized void register(T config)
+ {
+ configs.put(config.getConfigName(), config);
+ }
+
+ @Override
+ public synchronized void unregister(T config)
+ {
+ configs.remove(config.getConfigName());
+ }
+
+ @SuppressWarnings("unchecked")
+ private T newInstance(T obj, T wrapper) {
+ Class<?> clazz = obj.getClass();
+ try {
+ return (T)clazz.getConstructor(clazz, wrapper.getClass()).newInstance(obj, wrapper);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public synchronized void reload()
+ {
+ Map<String, T> map = new HashMap<String, T>(configs.size(), 1);
+ if (wrapper != null) {
+ for (Entry<String, T> e : configs.entrySet()) {
+ map.put(e.getKey(), newInstance(e.getValue(), wrapper));
+ }
+ } else {
+ for (Entry<String, T> e : configs.entrySet()) {
+ map.put(e.getKey(), e.getValue());
+ }
+ }
+ this.loadedConfigs = Collections.unmodifiableMap(map);
+ }
+
+ @Override
+ public synchronized void unload()
+ {
+ this.loadedConfigs = Collections.emptyMap();
+ }
+
+ @Override
+ public synchronized void setWrapperConfig(T config, boolean reload)
+ {
+ this.wrapper = config;
+ if (reload) {
+ reload();
+ }
+ }
+
+ @Override
+ public synchronized T getWrapperConfig()
+ {
+ return this.wrapper;
+ }
+
+ @Override
+ public T getConfig(String name)
+ {
+ return this.loadedConfigs.get(name);
+ }
+
+ @Override
+ public Collection<T> getConfigs()
+ {
+ return this.loadedConfigs.values();
+ }
+
+}
Property changes on: common/branches/JBWS-3739/src/main/java/org/jboss/ws/common/management/CommonConfigStoreImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
11 years, 1 month
JBossWS SVN: r18128 - common/branches/JBWS-3739.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-04 09:51:38 -0500 (Wed, 04 Dec 2013)
New Revision: 18128
Modified:
common/branches/JBWS-3739/pom.xml
Log:
Updating pom
Modified: common/branches/JBWS-3739/pom.xml
===================================================================
--- common/branches/JBWS-3739/pom.xml 2013-12-04 14:51:10 UTC (rev 18127)
+++ common/branches/JBWS-3739/pom.xml 2013-12-04 14:51:38 UTC (rev 18128)
@@ -9,7 +9,7 @@
<packaging>jar</packaging>
<description>JBossWS Common</description>
- <version>2.3.0-SNAPSHOT</version>
+ <version>2.3.0.Alpha1-SNAPSHOT</version>
<!-- Parent -->
<parent>
@@ -27,7 +27,7 @@
<!-- Properties -->
<properties>
- <jbossws.spi.version>2.2.1.Final</jbossws.spi.version>
+ <jbossws.spi.version>2.3.0.Alpha1-SNAPSHOT</jbossws.spi.version>
<jboss.jaxbintros.version>1.0.2.GA</jboss.jaxbintros.version>
<jboss.common.core.version>2.2.17.GA</jboss.common.core.version>
<jboss-logging.version>3.1.2.GA</jboss-logging.version>
11 years, 1 month
JBossWS SVN: r18127 - in spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi: metadata/config and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-04 09:51:10 -0500 (Wed, 04 Dec 2013)
New Revision: 18127
Added:
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/management/CommonConfigStore.java
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/config/AbstractCommonConfig.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/ClientConfig.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/EndpointConfig.java
Log:
[JBWS-3708] Adding CommonConfigStore facility for dealing with collections of client/endpoint configs and their modifications
Added: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/management/CommonConfigStore.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/management/CommonConfigStore.java (rev 0)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/management/CommonConfigStore.java 2013-12-04 14:51:10 UTC (rev 18127)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * 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.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.management;
+
+import java.util.Collection;
+
+import org.jboss.wsf.spi.metadata.config.AbstractCommonConfig;
+
+
+/**
+ * A store of client/endpoint config
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 04-Dec-2013
+ */
+public interface CommonConfigStore<T extends AbstractCommonConfig>
+{
+ /**
+ * Registers a config in the store; the new config will affect runtime the first time the store is reloaded.
+ *
+ * @param config
+ */
+ void register(T config);
+
+ /**
+ * Unregisters a config in the store; the runtime will be affected the first time the store is reloaded.
+ *
+ * @param config
+ */
+ void unregister(T config);
+
+ /**
+ * Reloads the store, which involves iterating over the registered configs and creating a collection that is
+ * returned when calling getConfig(..) / getConfigs().
+ */
+ void reload();
+
+ /**
+ * Unloads the store, cleaning up the loaded collection.
+ */
+ void unload();
+
+ /**
+ * Sets a wrapper config, to be merged with any registered config.
+ *
+ * @param config
+ * @param reload Whether to reload the store after having set the wrapper or not
+ */
+ void setWrapperConfig(T config, boolean reload);
+
+ /**
+ * Returns current wrapper config
+ *
+ * @return
+ */
+ T getWrapperConfig();
+
+ /**
+ * Retrieves a config by name from the loaded collection
+ *
+ * @param name
+ * @return
+ */
+ T getConfig(String name);
+
+ /**
+ * Returns the loaded config collection
+ *
+ * @return
+ */
+ Collection<T> getConfigs();
+}
Property changes on: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/management/CommonConfigStore.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
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-12-04 13:12:24 UTC (rev 18126)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/management/ServerConfig.java 2013-12-04 14:51:10 UTC (rev 18127)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2012, 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,6 @@
import java.io.File;
import java.net.UnknownHostException;
-import java.util.List;
import org.jboss.wsf.spi.metadata.config.ClientConfig;
import org.jboss.wsf.spi.metadata.config.EndpointConfig;
@@ -67,16 +66,58 @@
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.
+ * Register a client config in the server configuration; the new config will apply to runtime when the server config is started
+ * or after a client config store reload.
*
* @param config
*/
- void addEndpointConfig(EndpointConfig config);
+ void registerClientConfig(ClientConfig config);
- List<EndpointConfig> getEndpointConfigs();
+ /**
+ * Unregister a client config from the server configuration; the new config will be removed from
+ * the collection returned to callers after next endpoint store reload.
+ *
+ * @param config
+ */
+ void unregisterClientConfig(ClientConfig config);
- void addClientConfig(ClientConfig config);
+ /**
+ * Reloads the client config store
+ */
+ void reloadClientConfigs();
- List<ClientConfig> getClientConfigs();
+ /**
+ * Get a client config by name
+ *
+ * @return
+ */
+ ClientConfig getClientConfig(String name);
+
+ /**
+ * Register an endpoint config in the server configuration; the new config will apply to runtime when the server config is started
+ * or after an endpoint config store reload.
+ *
+ * @param config
+ */
+ void registerEndpointConfig(EndpointConfig config);
+
+ /**
+ * Unregister an endpoint config from the server configuration; the new config will be removed from
+ * the collection returned to callers after next endpoint store reload.
+ *
+ * @param config
+ */
+ void unregisterEndpointConfig(EndpointConfig config);
+
+ /**
+ * Reloads the endpoint config store
+ */
+ void reloadEndpointConfigs();
+
+ /**
+ * Get an endpoint config by name
+ *
+ * @return
+ */
+ EndpointConfig getEndpointConfig(String name);
}
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java 2013-12-04 13:12:24 UTC (rev 18126)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java 2013-12-04 14:51:10 UTC (rev 18127)
@@ -21,7 +21,9 @@
*/
package org.jboss.wsf.spi.metadata.config;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -72,6 +74,84 @@
this.postHandlerChains = Collections.emptyList();
}
}
+
+ protected AbstractCommonConfig(AbstractCommonConfig base, AbstractCommonConfig conf)
+ {
+ super();
+ this.configName = base.getConfigName();
+ if (conf.features != null && !conf.features.isEmpty())
+ {
+ Map<String, Feature> map;
+ if (base.features.isEmpty())
+ {
+ map = conf.features;
+ }
+ else
+ {
+ map = new HashMap<String, Feature>(base.features);
+ map.putAll(conf.features);
+ }
+ this.features = Collections.unmodifiableMap(map);
+ }
+ else
+ {
+ this.features = Collections.emptyMap();
+ }
+ if (conf.properties != null && !conf.properties.isEmpty())
+ {
+ Map<String, String> map;
+ if (base.properties.isEmpty())
+ {
+ map = conf.properties;
+ }
+ else
+ {
+ map = new HashMap<String, String>(base.properties);
+ map.putAll(conf.properties);
+ }
+ this.properties = Collections.unmodifiableMap(map);
+ }
+ else
+ {
+ this.properties = Collections.emptyMap();
+ }
+ if (conf.preHandlerChains != null && !conf.preHandlerChains.isEmpty())
+ {
+ List<UnifiedHandlerChainMetaData> list;
+ if (base.preHandlerChains.isEmpty())
+ {
+ list = conf.preHandlerChains;
+ }
+ else
+ {
+ list = new ArrayList<UnifiedHandlerChainMetaData>(base.preHandlerChains);
+ list.addAll(conf.preHandlerChains);
+ }
+ this.preHandlerChains = Collections.unmodifiableList(list);
+ }
+ else
+ {
+ this.preHandlerChains = Collections.emptyList();
+ }
+ if (conf.postHandlerChains != null && !conf.postHandlerChains.isEmpty())
+ {
+ List<UnifiedHandlerChainMetaData> list;
+ if (base.postHandlerChains.isEmpty())
+ {
+ list = conf.postHandlerChains;
+ }
+ else
+ {
+ list = new ArrayList<UnifiedHandlerChainMetaData>(base.postHandlerChains);
+ list.addAll(preHandlerChains);
+ }
+ this.postHandlerChains = Collections.unmodifiableList(list);
+ }
+ else
+ {
+ this.postHandlerChains = Collections.emptyList();
+ }
+ }
public List<UnifiedHandlerChainMetaData> getPostHandlerChains()
{
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/ClientConfig.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/ClientConfig.java 2013-12-04 13:12:24 UTC (rev 18126)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/ClientConfig.java 2013-12-04 14:51:10 UTC (rev 18127)
@@ -42,4 +42,8 @@
{
super(configName, preHandlerChains, postHandlerChains, properties, features);
}
+
+ public ClientConfig(ClientConfig base, ClientConfig conf) {
+ super(base, conf);
+ }
}
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/EndpointConfig.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/EndpointConfig.java 2013-12-04 13:12:24 UTC (rev 18126)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/EndpointConfig.java 2013-12-04 14:51:10 UTC (rev 18127)
@@ -42,4 +42,8 @@
{
super(configName, preHandlerChains, postHandlerChains, properties, features);
}
+
+ public EndpointConfig(EndpointConfig base, EndpointConfig conf) {
+ super(base, conf);
+ }
}
11 years, 1 month