Author: asoldano
Date: 2014-01-16 09:50:38 -0500 (Thu, 16 Jan 2014)
New Revision: 18248
Added:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/config/ServerConfigImpl.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigAdd.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerAdd.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainAdd.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/PackageUtils.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/PropertyAdd.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSExtension.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/PropertyService.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java
Log:
[JBWS-3739][JBWS-3708][JBWS-3707][JBWS-3689] svn merge -r 18119:18134
https://svn.jboss.org/repos/jbossws/container/jboss72/branches/jbossws-jb...
.
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/config/ServerConfigImpl.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/config/ServerConfigImpl.java 2014-01-16
14:47:41 UTC (rev 18247)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/config/ServerConfigImpl.java 2014-01-16
14:50:38 UTC (rev 18248)
@@ -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/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java 2014-01-16
14:47:41 UTC (rev 18247)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java 2014-01-16
14:50:38 UTC (rev 18248)
@@ -92,7 +92,7 @@
}
//extract SOAP-over-JMS 1.0 bindings
- final JMSEndpointsMetaData endpointsMetaData = new JMSEndpointsMetaData();
+ List<JMSEndpointMetaData> list = new
LinkedList<JMSEndpointMetaData>();
if (!map.isEmpty()) {
for (String wsdlLocation : map.keySet()) {
@@ -114,14 +114,7 @@
ClassInfo webServiceClassInfo = (ClassInfo) ai.target();
String beanClassName =
webServiceClassInfo.name().toString();
//service name ?
- JMSEndpointMetaData endpointMetaData = new
JMSEndpointMetaData(endpointsMetaData);
- endpointMetaData.setEndpointName(port);
- endpointMetaData.setName(beanClassName);
- endpointMetaData.setImplementor(beanClassName);
- //endpointMetaData.setName(name);
- endpointMetaData.setSoapAddress(soapAddress);
- endpointMetaData.setWsdlLocation(wsdlLocation);
- endpointsMetaData.addEndpointMetaData(endpointMetaData);
+ list.add(new JMSEndpointMetaData(beanClassName, port,
beanClassName, wsdlLocation, soapAddress));
}
}
} catch (Exception ignore) {
@@ -130,7 +123,7 @@
}
}
- unit.putAttachment(JMS_ENDPOINT_METADATA_KEY, endpointsMetaData);
+ unit.putAttachment(JMS_ENDPOINT_METADATA_KEY, new JMSEndpointsMetaData(list));
}
@Override
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java 2014-01-16
14:47:41 UTC (rev 18247)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java 2014-01-16
14:50:38 UTC (rev 18248)
@@ -32,15 +32,17 @@
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;
+import org.jboss.msc.inject.Injector;
import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceTarget;
import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.metadata.config.ClientConfig;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
/**
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
@@ -78,7 +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.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,
UnifiedHandlerChainMetaData.class, serviceName, address, Constants.POST_HANDLER_CHAIN);
ServiceController<?> controller =
clientServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
newControllers.add(controller);
@@ -87,4 +92,11 @@
context.reloadRequired();
}
}
+
+ 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, injectedClass, injector);
+ }
+ }
}
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigAdd.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigAdd.java 2014-01-16
14:47:41 UTC (rev 18247)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigAdd.java 2014-01-16
14:50:38 UTC (rev 18248)
@@ -35,11 +35,13 @@
import org.jboss.as.webservices.util.ASHelper;
import org.jboss.as.webservices.util.WSServices;
import org.jboss.dmr.ModelNode;
+import org.jboss.msc.inject.Injector;
import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceTarget;
import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
/**
* @author <a href="ema(a)redhat.com">Jim Ma</a>
@@ -81,6 +83,8 @@
final ServiceTarget target = context.getServiceTarget();
final ServiceBuilder<?> clientServiceBuilder =
target.addService(serviceName, endpointConfigService);
+ setDependency(context, clientServiceBuilder,
endpointConfigService.getPreHandlerChainsInjector(), serviceName, address,
Constants.PRE_HANDLER_CHAIN);
+ setDependency(context, clientServiceBuilder,
endpointConfigService.getPostHandlerChainsInjector(), serviceName, address,
Constants.POST_HANDLER_CHAIN);
ServiceController<?> controller =
clientServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
newControllers.add(controller);
@@ -89,4 +93,11 @@
context.reloadRequired();
}
}
+
+ private void setDependency(final OperationContext context, final
ServiceBuilder<?> builder, final Injector<UnifiedHandlerChainMetaData>
injector,
+ final ServiceName serviceName, final PathAddress address, final String
handlerChainType) {
+ for (ServiceName sn : PackageUtils.getServiceNameDependencies(context,
serviceName, address, handlerChainType)) {
+ builder.addDependency(sn, UnifiedHandlerChainMetaData.class, injector);
+ }
+ }
}
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerAdd.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerAdd.java 2014-01-16
14:47:41 UTC (rev 18247)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerAdd.java 2014-01-16
14:50:38 UTC (rev 18248)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2012, 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.
*
@@ -43,7 +43,6 @@
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceRegistry;
import org.jboss.msc.service.ServiceTarget;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
/**
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
@@ -73,6 +72,7 @@
final PathElement confElem = address.getElement(address.size() - 3);
final String configType = confElem.getKey();
final String configName = confElem.getValue();
+ final String handlerChainType = address.getElement(address.size() -
2).getKey();
final String handlerChainId = address.getElement(address.size() -
2).getValue();
final String handlerName = address.getElement(address.size() -
1).getValue();
final String handlerClass = operation.require(CLASS).asString();
@@ -84,15 +84,13 @@
if (registry.getService(configServiceName) == null) {
throw MESSAGES.missingConfig(configName);
}
- final ServiceName handlerChainServiceName =
getHandlerChainServiceName(configServiceName, handlerChainId);
+ final ServiceName handlerChainServiceName =
getHandlerChainServiceName(configServiceName, handlerChainType, handlerChainId);
if (registry.getService(handlerChainServiceName) == null) {
- String handlerChainType = address.getElement(address.size() -
2).getKey();
throw MESSAGES.missingHandlerChain(configName, handlerChainType,
handlerChainId);
}
final ServiceName handlerServiceName =
getHandlerServiceName(handlerChainServiceName, handlerName);
final ServiceBuilder<?> handlerServiceBuilder =
target.addService(handlerServiceName, service);
- handlerServiceBuilder.addDependency(handlerChainServiceName,
UnifiedHandlerChainMetaData.class, service.getHandlerChain());
ServiceController<?> controller =
handlerServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
newControllers.add(controller);
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainAdd.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainAdd.java 2014-01-16
14:47:41 UTC (rev 18247)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainAdd.java 2014-01-16
14:50:38 UTC (rev 18248)
@@ -23,6 +23,7 @@
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
import static org.jboss.as.webservices.WSMessages.MESSAGES;
+import static org.jboss.as.webservices.dmr.Constants.HANDLER;
import static org.jboss.as.webservices.dmr.Constants.PROTOCOL_BINDINGS;
import static org.jboss.as.webservices.dmr.PackageUtils.getConfigServiceName;
import static org.jboss.as.webservices.dmr.PackageUtils.getHandlerChainServiceName;
@@ -37,11 +38,12 @@
import org.jboss.as.controller.ServiceVerificationHandler;
import org.jboss.as.webservices.service.HandlerChainService;
import org.jboss.dmr.ModelNode;
+import org.jboss.msc.inject.Injector;
import org.jboss.msc.service.ServiceBuilder;
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;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
/**
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
@@ -80,11 +82,14 @@
throw MESSAGES.missingConfig(configName);
}
- final ServiceName handlerChainServiceName =
getHandlerChainServiceName(configServiceName, handlerChainId);
- final HandlerChainService<AbstractCommonConfig> service = new
HandlerChainService<AbstractCommonConfig>(handlerChainType, handlerChainId,
protocolBindings);
+ final ServiceName handlerChainServiceName =
getHandlerChainServiceName(configServiceName, handlerChainType, handlerChainId);
+ final HandlerChainService service = new HandlerChainService(handlerChainType,
handlerChainId, protocolBindings);
final ServiceTarget target = context.getServiceTarget();
final ServiceBuilder<?> handlerChainServiceBuilder =
target.addService(handlerChainServiceName, service);
- handlerChainServiceBuilder.addDependency(configServiceName,
AbstractCommonConfig.class, service.getAbstractCommonConfig());
+ final Injector<UnifiedHandlerMetaData> injector =
service.getHandlersInjector();
+ for (ServiceName sn : PackageUtils.getServiceNameDependencies(context,
handlerChainServiceName, address, HANDLER)) {
+ handlerChainServiceBuilder.addDependency(sn,
UnifiedHandlerMetaData.class, injector);
+ }
ServiceController<?> controller =
handlerChainServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
newControllers.add(controller);
Copied:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java
(from rev 18134,
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java)
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java
(rev 0)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java 2014-01-16
14:50:38 UTC (rev 18248)
@@ -0,0 +1,38 @@
+package org.jboss.as.webservices.dmr;
+
+import java.util.List;
+
+import org.jboss.msc.inject.InjectionException;
+import org.jboss.msc.inject.Injector;
+import org.jboss.msc.inject.RetainingInjector;
+import org.jboss.msc.value.Value;
+
+public final class ListInjector<T> extends RetainingInjector<T> implements
Injector<T> {
+ private final List<T> list;
+
+ public ListInjector(final List<T> list) {
+ this.list = list;
+ }
+
+ /** {@inheritDoc} */
+ public void inject(final T value) throws InjectionException {
+ synchronized (list) {
+ if (value != null) {
+ list.add(value);
+ }
+ super.inject(value);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void uninject() {
+ synchronized (list) {
+ try {
+ final Value<T> storedValue = getStoredValue();
+ if (storedValue != null) list.remove(storedValue.getValue());
+ } finally {
+ super.uninject();
+ }
+ }
+ }
+}
\ No newline at end of file
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/PackageUtils.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/PackageUtils.java 2014-01-16
14:47:41 UTC (rev 18247)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/PackageUtils.java 2014-01-16
14:50:38 UTC (rev 18248)
@@ -24,9 +24,15 @@
import static org.jboss.as.webservices.dmr.Constants.ENDPOINT_CONFIG;
import static org.jboss.as.webservices.dmr.Constants.HANDLER;
-import static org.jboss.as.webservices.dmr.Constants.HANDLER_CHAIN;
import static org.jboss.as.webservices.dmr.Constants.PROPERTY;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.jboss.as.controller.OperationContext;
+import org.jboss.as.controller.PathAddress;
+import org.jboss.as.controller.registry.Resource;
+import org.jboss.as.controller.registry.Resource.ResourceEntry;
import org.jboss.as.webservices.util.WSServices;
import org.jboss.msc.service.ServiceName;
@@ -52,14 +58,10 @@
return (ENDPOINT_CONFIG.equals(configType) ?
getEndpointConfigServiceName(configName) : getClientConfigServiceName(configName));
}
- static ServiceName getHandlerChainServiceName(final String configType, final String
configName, final String handlerChainId) {
- return getHandlerChainServiceName(getConfigServiceName(configType, configName),
handlerChainId);
+ static ServiceName getHandlerChainServiceName(final ServiceName configServiceName,
final String handlerChainType, final String handlerChainId) {
+ return configServiceName.append(handlerChainType).append(handlerChainId);
}
- static ServiceName getHandlerChainServiceName(final ServiceName configServiceName,
final String handlerChainId) {
- return configServiceName.append(HANDLER_CHAIN).append(handlerChainId);
- }
-
static ServiceName getHandlerServiceName(final ServiceName handlerChainServiceName,
final String handlerName) {
return handlerChainServiceName.append(HANDLER).append(handlerName);
}
@@ -68,4 +70,13 @@
return configServiceName.append(PROPERTY).append(propertyName);
}
+ static List<ServiceName> getServiceNameDependencies(final OperationContext
context, final ServiceName baseServiceName, final PathAddress address, final String
childType) {
+ final List<ServiceName> childrenServiceNames = new
LinkedList<ServiceName>();
+ final Resource resource = context.readResourceFromRoot(address);
+ final ServiceName sn = baseServiceName.append(childType);
+ for (ResourceEntry re : resource.getChildren(childType)) {
+ childrenServiceNames.add(sn.append(re.getName()));
+ }
+ return childrenServiceNames;
+ }
}
\ No newline at end of file
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/PropertyAdd.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/PropertyAdd.java 2014-01-16
14:47:41 UTC (rev 18247)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/PropertyAdd.java 2014-01-16
14:50:38 UTC (rev 18248)
@@ -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/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSExtension.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSExtension.java 2014-01-16
14:47:41 UTC (rev 18247)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSExtension.java 2014-01-16
14:50:38 UTC (rev 18248)
@@ -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/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java 2014-01-16
14:47:41 UTC (rev 18247)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java 2014-01-16
14:50:38 UTC (rev 18248)
@@ -130,22 +130,7 @@
ServiceName configServiceName = Constants.CLIENT_CONFIG.equals(configType) ?
PackageUtils
.getClientConfigServiceName(re.getName()) :
PackageUtils.getEndpointConfigServiceName(re.getName());
serviceNames.add(configServiceName);
- readHandlerChainServiceNames(serviceNames, re, Constants.PRE_HANDLER_CHAIN,
configServiceName);
- readHandlerChainServiceNames(serviceNames, re, Constants.POST_HANDLER_CHAIN,
configServiceName);
- for (String propertyName : re.getChildrenNames(Constants.PROPERTY)) {
- serviceNames.add(PackageUtils.getPropertyServiceName(configServiceName,
propertyName));
- }
}
}
- private static void readHandlerChainServiceNames(List<ServiceName>
serviceNames, Resource configResource, String chainType, ServiceName configServiceName) {
- for (ResourceEntry re : configResource.getChildren(chainType)) {
- ServiceName handlerChainServiceName =
PackageUtils.getHandlerChainServiceName(configServiceName, re.getName());
- serviceNames.add(handlerChainServiceName);
- for (String handlerName : re.getChildrenNames(Constants.HANDLER)) {
-
serviceNames.add(PackageUtils.getHandlerServiceName(handlerChainServiceName,
handlerName));
- }
- }
- }
-
}
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java 2014-01-16
14:47:41 UTC (rev 18247)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java 2014-01-16
14:50:38 UTC (rev 18248)
@@ -21,6 +21,13 @@
*/
package org.jboss.as.webservices.service;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.as.webservices.dmr.ListInjector;
+import org.jboss.msc.inject.Injector;
import org.jboss.msc.service.Service;
import org.jboss.msc.service.StartContext;
import org.jboss.msc.service.StartException;
@@ -29,6 +36,7 @@
import org.jboss.wsf.spi.metadata.config.AbstractCommonConfig;
import org.jboss.wsf.spi.metadata.config.ClientConfig;
import org.jboss.wsf.spi.metadata.config.EndpointConfig;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
/**
* A service for setting a ws client / endpoint config.
@@ -41,6 +49,9 @@
private final ServerConfig serverConfig;
private final String configName;
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) {
@@ -56,15 +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);
- 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);
- serverConfig.addEndpointConfig(endpointConfig);
+ EndpointConfig endpointConfig = new EndpointConfig(configName, preHandlerChains,
postHandlerChains, props, null);
+ serverConfig.registerEndpointConfig(endpointConfig);
config = endpointConfig;
}
}
@@ -72,9 +88,22 @@
@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);
}
}
+
+ public Injector<UnifiedHandlerChainMetaData> getPreHandlerChainsInjector() {
+ return new ListInjector<UnifiedHandlerChainMetaData>(preHandlerChains);
+ }
+
+ public Injector<UnifiedHandlerChainMetaData> getPostHandlerChainsInjector() {
+ return new ListInjector<UnifiedHandlerChainMetaData>(postHandlerChains);
+ }
+
+ public Injector<PropertyService> getPropertiesInjector() {
+ return new ListInjector<PropertyService>(properties);
+ }
+
}
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java 2014-01-16
14:47:41 UTC (rev 18247)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java 2014-01-16
14:50:38 UTC (rev 18248)
@@ -23,32 +23,35 @@
import static org.jboss.as.webservices.WSMessages.MESSAGES;
+import java.util.ArrayList;
import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
+import org.jboss.as.webservices.dmr.ListInjector;
+import org.jboss.msc.inject.Injector;
import org.jboss.msc.service.Service;
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;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
/**
- * A service for setting a handler chain into an endpoint / client config.
+ * A service for creating handler chain metadata.
*
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
*/
-public final class HandlerChainService<T extends AbstractCommonConfig> implements
Service<UnifiedHandlerChainMetaData> {
+public final class HandlerChainService implements
Service<UnifiedHandlerChainMetaData> {
- private InjectedValue<T> abstractCommonConfig = new InjectedValue<T>();
- private final String handlerChainType;
+ private final List<UnifiedHandlerMetaData> handlers = new
ArrayList<UnifiedHandlerMetaData>(2);
private final String handlerChainId;
private final String protocolBindings;
private volatile UnifiedHandlerChainMetaData handlerChain;
public HandlerChainService(String handlerChainType, String handlerChainId, String
protocolBindings) {
- this.handlerChainType = handlerChainType;
+ if (!handlerChainType.equalsIgnoreCase("pre-handler-chain") &&
!handlerChainType.equals("post-handler-chain")) {
+ throw new RuntimeException(
+ MESSAGES.wrongHandlerChainType(handlerChainType,
"pre-handler-chain", "post-handler-chain"));
+ }
this.handlerChainId = handlerChainId;
this.protocolBindings = protocolBindings;
}
@@ -60,63 +63,15 @@
@Override
public void start(final StartContext context) throws StartException {
- final AbstractCommonConfig commonConfig = abstractCommonConfig.getValue();
- List<UnifiedHandlerChainMetaData> handlerChains;
- if ("pre-handler-chain".equals(handlerChainType)) {
- synchronized (commonConfig) { //JBWS-3707
- handlerChains = commonConfig.getPreHandlerChains();
- if (handlerChains == null) {
- handlerChains = new
CopyOnWriteArrayList<UnifiedHandlerChainMetaData>();
- commonConfig.setPreHandlerChains(handlerChains);
- }
- }
- } else if ("post-handler-chain".equals(handlerChainType)) {
- synchronized (commonConfig) { //JBWS-3707
- handlerChains = commonConfig.getPostHandlerChains();
- if (handlerChains == null) {
- handlerChains = new
CopyOnWriteArrayList<UnifiedHandlerChainMetaData>();
- commonConfig.setPostHandlerChains(handlerChains);
- }
- }
- } else {
- throw new StartException(
- MESSAGES.wrongHandlerChainType(handlerChainType,
"pre-handler-chain", "post-handler-chain"));
- }
- handlerChain = getChain(handlerChains, handlerChainId);
- if (handlerChain != null) {
- throw new
StartException(MESSAGES.multipleHandlerChainsWithSameId(handlerChainType, handlerChainId,
- commonConfig.getConfigName()));
- }
- handlerChain = new UnifiedHandlerChainMetaData();
- handlerChain.setId(handlerChainId);
- handlerChain.setProtocolBindings(protocolBindings);
- handlerChains.add(handlerChain);
+ handlerChain = new UnifiedHandlerChainMetaData(null, null, protocolBindings,
handlers, false, handlerChainId);
}
- private static UnifiedHandlerChainMetaData getChain(final
List<UnifiedHandlerChainMetaData> handlerChains,
- final String handlerChainId) {
- for (final UnifiedHandlerChainMetaData handlerChain : handlerChains) {
- if (handlerChainId.equals(handlerChain.getId())) {
- return handlerChain;
- }
- }
- return null;
- }
-
@Override
public void stop(final StopContext context) {
- final AbstractCommonConfig commonConfig = abstractCommonConfig.getValue();
-
- final List<UnifiedHandlerChainMetaData> handlerChains;
- if ("pre-handler-chain".equals(handlerChainType)) {
- handlerChains = commonConfig.getPreHandlerChains();
- } else {
- handlerChains = commonConfig.getPostHandlerChains();
- }
- handlerChains.remove(handlerChain);
+ handlerChain = null;
}
- public InjectedValue<T> getAbstractCommonConfig() {
- return abstractCommonConfig;
+ public Injector<UnifiedHandlerMetaData> getHandlersInjector() {
+ return new ListInjector<UnifiedHandlerMetaData>(handlers);
}
}
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java 2014-01-16
14:47:41 UTC (rev 18247)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java 2014-01-16
14:50:38 UTC (rev 18248)
@@ -25,18 +25,15 @@
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.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
/**
- * A service for setting a handler into the handler-chain of an endpoint / client
config.
+ * A service for creating handler metadata.
*
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
*/
public final class HandlerService implements Service<UnifiedHandlerMetaData> {
- private InjectedValue<UnifiedHandlerChainMetaData> handlerChain = new
InjectedValue<UnifiedHandlerChainMetaData>();
private final String handlerName;
private final String handlerClass;
private volatile UnifiedHandlerMetaData handler;
@@ -53,24 +50,11 @@
@Override
public void start(final StartContext context) throws StartException {
- final UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData();
- handler.setHandlerName(handlerName);
- handler.setHandlerClass(handlerClass);
- final UnifiedHandlerChainMetaData chain = handlerChain.getValue();
- synchronized (chain) { //JBWS-3707
- chain.addHandler(handler);
- }
+ handler = new UnifiedHandlerMetaData(handlerClass, handlerName, null, null, null,
null);
}
@Override
public void stop(final StopContext context) {
- final UnifiedHandlerChainMetaData chain = handlerChain.getValue();
- synchronized (chain) { //JBWS-3707
- chain.getHandlers().remove(handler);
- }
+ handler = null;
}
-
- public InjectedValue<UnifiedHandlerChainMetaData> getHandlerChain() {
- return handlerChain;
- }
}
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/PropertyService.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/PropertyService.java 2014-01-16
14:47:41 UTC (rev 18247)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/PropertyService.java 2014-01-16
14:50:38 UTC (rev 18248)
@@ -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;
- }
}
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java 2014-01-16
14:47:41 UTC (rev 18247)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java 2014-01-16
14:50:38 UTC (rev 18248)
@@ -32,7 +32,10 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
import java.util.List;
+import java.util.Set;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
@@ -177,66 +180,41 @@
final List<StubPropertyMetaData> stubPropertiesMD =
jbossPortComponentMD.getStubProperties();
if (stubPropertiesMD != null) {
for (final StubPropertyMetaData stubPropertyMD : stubPropertiesMD) {
- final UnifiedStubPropertyMetaData stubPropertyUMDM = new
UnifiedStubPropertyMetaData();
- stubPropertyUMDM.setPropName(stubPropertyMD.getPropName());
- stubPropertyUMDM.setPropValue(stubPropertyMD.getPropValue());
- portComponentUMDM.addStubProperty(stubPropertyUMDM);
+ portComponentUMDM.addStubProperty(new
UnifiedStubPropertyMetaData(stubPropertyMD.getPropName(),
stubPropertyMD.getPropValue()));
}
}
}
private static UnifiedHandlerMetaData
getUnifiedHandlerMetaData(ServiceReferenceHandlerMetaData srhmd) {
- UnifiedHandlerMetaData handlerUMDM = new UnifiedHandlerMetaData();
- handlerUMDM.setHandlerName(srhmd.getHandlerName());
- handlerUMDM.setHandlerClass(srhmd.getHandlerClass());
+ List<UnifiedInitParamMetaData> unifiedInitParamMDs = new
LinkedList<UnifiedInitParamMetaData>();
List<ParamValueMetaData> initParams = srhmd.getInitParam();
if (initParams != null) {
for (ParamValueMetaData initParam : initParams) {
- UnifiedInitParamMetaData param = new UnifiedInitParamMetaData();
- param.setParamName(initParam.getParamName());
- param.setParamValue(initParam.getParamValue());
- handlerUMDM.addInitParam(param);
+ unifiedInitParamMDs.add(new
UnifiedInitParamMetaData(initParam.getParamName(), initParam.getParamValue()));
}
}
List<QName> soapHeaders = srhmd.getSoapHeader();
- if (soapHeaders != null) {
- for (QName soapHeader : soapHeaders) {
- handlerUMDM.addSoapHeader(soapHeader);
- }
- }
+ Set<QName> soapHeaderList = soapHeaders != null ? new
HashSet<QName>(soapHeaders) : null;
List<String> soapRoles = srhmd.getSoapRole();
- if (soapRoles != null) {
- for (String soapRole : soapRoles) {
- handlerUMDM.addSoapRole(soapRole);
- }
- }
+ Set<String> soapRolesList = soapRoles != null ? new
HashSet<String>(soapRoles) : null;
List<String> portNames = srhmd.getPortName();
- if (portNames != null) {
- for (String portName : portNames) {
- handlerUMDM.addPortName(portName);
- }
- }
- return handlerUMDM;
+ Set<String> portNameList = portNames != null ? new
HashSet<String>(portNames) : null;
+ return new UnifiedHandlerMetaData(srhmd.getHandlerClass(),
srhmd.getHandlerName(), unifiedInitParamMDs, soapHeaderList, soapRolesList,
portNameList);
}
private static UnifiedHandlerChainsMetaData getUnifiedHandlerChainsMetaData(final
ServiceReferenceHandlerChainsMetaData handlerChainsMD) {
- final UnifiedHandlerChainsMetaData handlerChainsUMDM = new
UnifiedHandlerChainsMetaData();
-
+ List<UnifiedHandlerChainMetaData> uhcmds = new
LinkedList<UnifiedHandlerChainMetaData>();
for (final ServiceReferenceHandlerChainMetaData handlerChainMD :
handlerChainsMD.getHandlers()) {
- final UnifiedHandlerChainMetaData handlerChainUMDM = new
UnifiedHandlerChainMetaData();
-
handlerChainUMDM.setServiceNamePattern(handlerChainMD.getServiceNamePattern());
- handlerChainUMDM.setPortNamePattern(handlerChainMD.getPortNamePattern());
- handlerChainUMDM.setProtocolBindings(handlerChainMD.getProtocolBindings());
-
+ List<UnifiedHandlerMetaData> uhmds = new
LinkedList<UnifiedHandlerMetaData>();
for (final ServiceReferenceHandlerMetaData handlerMD :
handlerChainMD.getHandler()) {
final UnifiedHandlerMetaData handlerUMDM =
getUnifiedHandlerMetaData(handlerMD);
- handlerChainUMDM.addHandler(handlerUMDM);
+ uhmds.add(handlerUMDM);
}
-
- handlerChainsUMDM.addHandlerChain(handlerChainUMDM);
+ uhcmds.add(new
UnifiedHandlerChainMetaData(handlerChainMD.getServiceNamePattern(),
handlerChainMD.getPortNamePattern(),
+ handlerChainMD.getProtocolBindings(), uhmds, false, null));
}
- return handlerChainsUMDM;
+ return new UnifiedHandlerChainsMetaData(uhcmds);
}
static void processType(final UnifiedServiceRefMetaData serviceRefUMDM) {