Author: asoldano
Date: 2013-12-03 06:55:51 -0500 (Tue, 03 Dec 2013)
New Revision: 18116
Added:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSServiceDependenciesProcessor.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
Removed:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigRemove.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigRemove.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainRemove.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerRemove.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/PropertyRemove.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAttributeChangeHandler.java
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/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/WSDeploymentActivator.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/EndpointService.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/ServerConfigService.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/ServiceContainerEndpointRegistry.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/WSAttachmentKeys.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/WSServices.java
Log:
Backport [WFLY-1759] to 7.2.0 ASIL
Added:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSServiceDependenciesProcessor.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSServiceDependenciesProcessor.java
(rev 0)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSServiceDependenciesProcessor.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.as.webservices.deployers;
+
+import org.jboss.as.server.deployment.DeploymentPhaseContext;
+import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
+import org.jboss.as.server.deployment.DeploymentUnitProcessor;
+import org.jboss.as.webservices.util.WSAttachmentKeys;
+import org.jboss.as.webservices.util.WSServices;
+
+/**
+ * A DUP that sets the service dependencies to be satisfied before installing any WS
deployments
+ *
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
+ */
+public final class WSServiceDependenciesProcessor implements DeploymentUnitProcessor {
+
+ public void deploy(DeploymentPhaseContext phaseContext) throws
DeploymentUnitProcessingException {
+ phaseContext.addDependency(WSServices.CONFIG_SERVICE,
WSAttachmentKeys.SERVER_CONFIG_KEY);
+ }
+
+ public void undeploy(final DeploymentUnit context) {
+ }
+
+}
Property changes on:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSServiceDependenciesProcessor.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
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 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -22,7 +22,7 @@
package org.jboss.as.webservices.dmr;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
-import static org.jboss.as.webservices.dmr.PackageUtils.getServerConfig;
+import static org.jboss.as.webservices.dmr.PackageUtils.getClientConfigServiceName;
import java.util.List;
@@ -31,8 +31,14 @@
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.ServiceVerificationHandler;
+import org.jboss.as.webservices.service.ConfigService;
+import org.jboss.as.webservices.util.ASHelper;
+import org.jboss.as.webservices.util.WSServices;
import org.jboss.dmr.ModelNode;
+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;
@@ -62,18 +68,23 @@
@Override
protected void performRuntime(final OperationContext context, final ModelNode
operation, final ModelNode model, final ServiceVerificationHandler verificationHandler,
final List<ServiceController<?>> newControllers) throws
OperationFailedException {
- final ServerConfig config = getServerConfig(context);
- if (config != null) {
- final PathAddress address =
PathAddress.pathAddress(operation.require(OP_ADDR));
- final String name = address.getLastElement().getValue();
+ //modify the runtime if we're booting, otherwise set reload required and leave
the runtime unchanged
+ if (context.isBooting()) {
+ final PathAddress address =
PathAddress.pathAddress(operation.require(OP_ADDR));
+ final String name = address.getLastElement().getValue();
+ //get the server config object from the ServerConfigService (service installed
and not started yet, but the object is fine for our needs here)
+ final ServerConfig serverConfig =
ASHelper.getMSCService(WSServices.CONFIG_SERVICE, ServerConfig.class, context);
+ final ServiceName serviceName = getClientConfigServiceName(name);
+ final ConfigService clientConfigService = new ConfigService(serverConfig, name,
true);
+ final ServiceTarget target = context.getServiceTarget();
+ final ServiceBuilder<?> clientServiceBuilder =
target.addService(serviceName, clientConfigService);
- ClientConfig clientConfig = new ClientConfig();
- clientConfig.setConfigName(name);
- config.addClientConfig(clientConfig);
- if (!context.isBooting()) {
- context.reloadRequired();
- }
- }
+ ServiceController<?> controller =
clientServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
+ if (newControllers != null) {
+ newControllers.add(controller);
+ }
+ } else {
+ context.reloadRequired();
+ }
}
-
}
Deleted:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigRemove.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigRemove.java 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigRemove.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2012, 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.
- *
- * 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.as.webservices.dmr;
-
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
-import static org.jboss.as.webservices.dmr.PackageUtils.getServerConfig;
-
-import org.jboss.as.controller.AbstractRemoveStepHandler;
-import org.jboss.as.controller.OperationContext;
-import org.jboss.as.controller.OperationFailedException;
-import org.jboss.as.controller.PathAddress;
-import org.jboss.dmr.ModelNode;
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.metadata.config.ClientConfig;
-
-/**
- * OperationHandler to remove the client configuration
- *
- * @author <a href="alessio.soldano(a)jboss.com">Alessio Soldano</a>
- */
-final class ClientConfigRemove extends AbstractRemoveStepHandler {
-
- static final ClientConfigRemove INSTANCE = new ClientConfigRemove();
-
- private ClientConfigRemove() {
- // forbidden instantiation
- }
-
- @Override
- protected void performRuntime(OperationContext context, ModelNode operation,
ModelNode model) throws OperationFailedException {
- final ServerConfig config = getServerConfig(context);
- if (config != null) {
- final PathAddress address =
PathAddress.pathAddress(operation.require(OP_ADDR));
- final String name = address.getLastElement().getValue();
-
- ClientConfig target = null;
- for (ClientConfig clConfig : config.getClientConfigs()) {
- if (clConfig.getConfigName().equals(name)) {
- target = clConfig;
- }
- }
- if (target != null) {
- config.getClientConfigs().remove(target);
- context.reloadRequired();
- }
- }
- }
-
- @Override
- protected void recoverServices(OperationContext context, ModelNode operation,
ModelNode model) throws OperationFailedException {
- ClientConfigAdd.INSTANCE.performRuntime(context, operation, model, null, null);
- }
-}
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 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigAdd.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -22,7 +22,7 @@
package org.jboss.as.webservices.dmr;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
-import static org.jboss.as.webservices.dmr.PackageUtils.getServerConfig;
+import static org.jboss.as.webservices.dmr.PackageUtils.getEndpointConfigServiceName;
import java.util.List;
@@ -31,14 +31,20 @@
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.ServiceVerificationHandler;
+import org.jboss.as.webservices.service.ConfigService;
+import org.jboss.as.webservices.util.ASHelper;
+import org.jboss.as.webservices.util.WSServices;
import org.jboss.dmr.ModelNode;
+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.EndpointConfig;
/**
* @author <a href="ema(a)redhat.com">Jim Ma</a>
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
*/
final class EndpointConfigAdd extends AbstractAddStepHandler {
@@ -57,24 +63,30 @@
protected void rollbackRuntime(final OperationContext context, final ModelNode
operation, final ModelNode model, final List<ServiceController<?>>
controllers) {
super.rollbackRuntime(context, operation, model, controllers);
if (!context.isBooting()) {
- context.revertReloadRequired();
+ context.revertReloadRequired();
}
}
@Override
protected void performRuntime(final OperationContext context, final ModelNode
operation, final ModelNode model, final ServiceVerificationHandler verificationHandler,
final List<ServiceController<?>> newControllers) throws
OperationFailedException {
- final ServerConfig config = getServerConfig(context);
- if (config != null) {
- final PathAddress address =
PathAddress.pathAddress(operation.require(OP_ADDR));
- final String name = address.getLastElement().getValue();
+ //modify the runtime if we're booting, otherwise set reload required and
leave the runtime unchanged
+ if (context.isBooting()) {
+ final PathAddress address =
PathAddress.pathAddress(operation.require(OP_ADDR));
+ final String name = address.getLastElement().getValue();
- EndpointConfig endpointConfig = new EndpointConfig();
- endpointConfig.setConfigName(name);
- config.addEndpointConfig(endpointConfig);
- if (!context.isBooting()) {
- context.reloadRequired();
- }
+ //get the server config object from the ServerConfigService (service installed
but not started yet, but the object is fine for our needs here)
+ final ServerConfig serverConfig =
ASHelper.getMSCService(WSServices.CONFIG_SERVICE, ServerConfig.class, context);
+ final ServiceName serviceName = getEndpointConfigServiceName(name);
+ final ConfigService endpointConfigService = new ConfigService(serverConfig,
name, false);
+
+ final ServiceTarget target = context.getServiceTarget();
+ final ServiceBuilder<?> clientServiceBuilder =
target.addService(serviceName, endpointConfigService);
+ ServiceController<?> controller =
clientServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
+ if (newControllers != null) {
+ newControllers.add(controller);
+ }
+ } else {
+ context.reloadRequired();
}
}
-
}
Deleted:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigRemove.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigRemove.java 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigRemove.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, 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.
- *
- * 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.as.webservices.dmr;
-
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
-import static org.jboss.as.webservices.dmr.PackageUtils.getServerConfig;
-
-import org.jboss.as.controller.AbstractRemoveStepHandler;
-import org.jboss.as.controller.OperationContext;
-import org.jboss.as.controller.OperationFailedException;
-import org.jboss.as.controller.PathAddress;
-import org.jboss.dmr.ModelNode;
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.metadata.config.EndpointConfig;
-
-/**
- * OperationHandler to remove the endpoint configuration
- *
- * @author <a href="ema(a)redhat.com">Jim Ma</a>
- */
-final class EndpointConfigRemove extends AbstractRemoveStepHandler {
-
- static final EndpointConfigRemove INSTANCE = new EndpointConfigRemove();
-
- private EndpointConfigRemove() {
- // forbidden instantiation
- }
-
- @Override
- protected void performRuntime(OperationContext context, ModelNode operation,
ModelNode model) throws OperationFailedException {
- final ServerConfig config = getServerConfig(context);
- if (config != null) {
- final PathAddress address =
PathAddress.pathAddress(operation.require(OP_ADDR));
- final String name = address.getLastElement().getValue();
-
- EndpointConfig target = null;
- for (EndpointConfig epConfig : config.getEndpointConfigs()) {
- if (epConfig.getConfigName().equals(name)) {
- target = epConfig;
- }
- }
- if (target != null) {
- config.getEndpointConfigs().remove(target);
- context.reloadRequired();
- }
- }
- }
-
- @Override
- protected void recoverServices(OperationContext context, ModelNode operation,
ModelNode model) throws OperationFailedException {
- EndpointConfigAdd.INSTANCE.performRuntime(context, operation, model, null,
null);
- }
-}
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 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerAdd.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -24,10 +24,9 @@
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.CLASS;
-import static org.jboss.as.webservices.dmr.Constants.POST_HANDLER_CHAIN;
-import static org.jboss.as.webservices.dmr.Constants.PRE_HANDLER_CHAIN;
-import static org.jboss.as.webservices.dmr.PackageUtils.getConfigs;
-import static org.jboss.as.webservices.dmr.PackageUtils.getServerConfig;
+import static org.jboss.as.webservices.dmr.PackageUtils.getConfigServiceName;
+import static org.jboss.as.webservices.dmr.PackageUtils.getHandlerChainServiceName;
+import static org.jboss.as.webservices.dmr.PackageUtils.getHandlerServiceName;
import java.util.List;
@@ -37,16 +36,18 @@
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.as.controller.ServiceVerificationHandler;
+import org.jboss.as.webservices.service.HandlerService;
import org.jboss.dmr.ModelNode;
+import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.ServiceController;
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.metadata.config.CommonConfig;
+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;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
/**
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
final class HandlerAdd extends AbstractAddStepHandler {
@@ -66,56 +67,43 @@
@Override
protected void performRuntime(final OperationContext context, final ModelNode
operation, final ModelNode model, final ServiceVerificationHandler verificationHandler,
final List<ServiceController<?>> newControllers) throws
OperationFailedException {
- final ServerConfig config = getServerConfig(context);
- if (config != null) {
+ // modify the runtime if we're booting, otherwise set reload required and
leave the runtime unchanged
+ if (context.isBooting()) {
final PathAddress address =
PathAddress.pathAddress(operation.require(OP_ADDR));
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();
- for (final CommonConfig commonConfig : getConfigs(config, configType)) {
- if (configName.equals(commonConfig.getConfigName())) {
- final List<UnifiedHandlerChainMetaData> handlerChains;
- if (PRE_HANDLER_CHAIN.equals(handlerChainType)) {
- handlerChains = commonConfig.getPreHandlerChains();
- } else if (POST_HANDLER_CHAIN.equals(handlerChainType)) {
- handlerChains = commonConfig.getPostHandlerChains();
- } else {
- throw MESSAGES.wrongHandlerChainType(handlerChainType,
PRE_HANDLER_CHAIN, POST_HANDLER_CHAIN);
- }
- final UnifiedHandlerChainMetaData handlerChain =
getChain(handlerChains, handlerChainId);
- if (handlerChain == null) {
- throw MESSAGES.multipleHandlerChainsWithSameId(handlerChainType,
handlerChainId, configName);
- }
- final UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData();
- handler.setHandlerName(handlerName);
- handler.setHandlerClass(handlerClass);
- handlerChain.addHandler(handler);
- if (!context.isBooting()) {
- context.reloadRequired();
- }
- return;
- }
+
+ final HandlerService service = new HandlerService(handlerName,
handlerClass);
+ final ServiceTarget target = context.getServiceTarget();
+ final ServiceName configServiceName = getConfigServiceName(configType,
configName);
+ final ServiceRegistry registry = context.getServiceRegistry(false);
+ if (registry.getService(configServiceName) == null) {
+ throw MESSAGES.missingConfig(configName);
}
- throw MESSAGES.missingConfig(configName);
- }
- }
+ final ServiceName handlerChainServiceName =
getHandlerChainServiceName(configServiceName, 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);
- private static UnifiedHandlerChainMetaData getChain(final
List<UnifiedHandlerChainMetaData> handlerChains, final String handlerChainId) {
- if (handlerChains != null) {
- for (final UnifiedHandlerChainMetaData handlerChain : handlerChains) {
- if (handlerChainId.equals(handlerChain.getId())) { return handlerChain;
}
+ 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);
}
+ } else {
+ context.reloadRequired();
}
- return null;
}
@Override
protected void populateModel(final ModelNode operation, final ModelNode model) throws
OperationFailedException {
Attributes.CLASS.validateAndSet(operation, model);
}
-
}
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 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainAdd.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -23,13 +23,10 @@
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.POST_HANDLER_CHAIN;
-import static org.jboss.as.webservices.dmr.Constants.PRE_HANDLER_CHAIN;
import static org.jboss.as.webservices.dmr.Constants.PROTOCOL_BINDINGS;
-import static org.jboss.as.webservices.dmr.PackageUtils.getConfigs;
-import static org.jboss.as.webservices.dmr.PackageUtils.getServerConfig;
+import static org.jboss.as.webservices.dmr.PackageUtils.getConfigServiceName;
+import static org.jboss.as.webservices.dmr.PackageUtils.getHandlerChainServiceName;
-import java.util.LinkedList;
import java.util.List;
import org.jboss.as.controller.AbstractAddStepHandler;
@@ -38,11 +35,13 @@
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.as.controller.ServiceVerificationHandler;
+import org.jboss.as.webservices.service.HandlerChainService;
import org.jboss.dmr.ModelNode;
+import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.ServiceController;
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.metadata.config.CommonConfig;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+import org.jboss.msc.service.ServiceName;
+import org.jboss.msc.service.ServiceTarget;
+import org.jboss.wsf.spi.metadata.config.AbstractCommonConfig;
/**
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
@@ -66,8 +65,8 @@
@Override
protected void performRuntime(final OperationContext context, final ModelNode
operation, final ModelNode model, final ServiceVerificationHandler verificationHandler,
final List<ServiceController<?>> newControllers) throws
OperationFailedException {
- final ServerConfig config = getServerConfig(context);
- if (config != null) {
+ //modify the runtime if we're booting, otherwise set reload required and
leave the runtime unchanged
+ if (context.isBooting()) {
final String protocolBindings = getAttributeValue(operation,
PROTOCOL_BINDINGS);
final PathAddress address =
PathAddress.pathAddress(operation.require(OP_ADDR));
final PathElement confElem = address.getElement(address.size() - 2);
@@ -75,47 +74,24 @@
final String configName = confElem.getValue();
final String handlerChainType = address.getElement(address.size() -
1).getKey();
final String handlerChainId = address.getElement(address.size() -
1).getValue();
- for (final CommonConfig commonConfig : getConfigs(config, configType)) {
- if (configName.equals(commonConfig.getConfigName())) {
- List<UnifiedHandlerChainMetaData> handlerChains;
- if (PRE_HANDLER_CHAIN.equals(handlerChainType)) {
- handlerChains = commonConfig.getPreHandlerChains();
- if (handlerChains == null) {
- handlerChains = new
LinkedList<UnifiedHandlerChainMetaData>();
- commonConfig.setPreHandlerChains(handlerChains);
- }
- } else if (POST_HANDLER_CHAIN.equals(handlerChainType)) {
- handlerChains = commonConfig.getPostHandlerChains();
- if (handlerChains == null) {
- handlerChains = new
LinkedList<UnifiedHandlerChainMetaData>();
- commonConfig.setPostHandlerChains(handlerChains);
- }
- } else {
- throw MESSAGES.wrongHandlerChainType(handlerChainType,
PRE_HANDLER_CHAIN, POST_HANDLER_CHAIN);
- }
- UnifiedHandlerChainMetaData handlerChain = getChain(handlerChains,
handlerChainId);
- if (handlerChain != null) {
- throw MESSAGES.multipleHandlerChainsWithSameId(handlerChainType,
handlerChainId, configName);
- }
- handlerChain = new UnifiedHandlerChainMetaData();
- handlerChain.setId(handlerChainId);
- handlerChain.setProtocolBindings(protocolBindings);
- handlerChains.add(handlerChain);
- if (!context.isBooting()) {
- context.reloadRequired();
- }
- return;
- }
+
+ final ServiceName configServiceName = getConfigServiceName(configType,
configName);
+ if (context.getServiceRegistry(false).getService(configServiceName) == null)
{
+ throw MESSAGES.missingConfig(configName);
}
- throw MESSAGES.missingConfig(configName);
- }
- }
- private static UnifiedHandlerChainMetaData getChain(final
List<UnifiedHandlerChainMetaData> handlerChains, final String handlerChainId) {
- for (final UnifiedHandlerChainMetaData handlerChain : handlerChains) {
- if (handlerChainId.equals(handlerChain.getId())) { return handlerChain; }
+ final ServiceName handlerChainServiceName =
getHandlerChainServiceName(configServiceName, handlerChainId);
+ final HandlerChainService<AbstractCommonConfig> service = new
HandlerChainService<AbstractCommonConfig>(handlerChainType, handlerChainId,
protocolBindings);
+ final ServiceTarget target = context.getServiceTarget();
+ final ServiceBuilder<?> handlerChainServiceBuilder =
target.addService(handlerChainServiceName, service);
+ handlerChainServiceBuilder.addDependency(configServiceName,
AbstractCommonConfig.class, service.getAbstractCommonConfig());
+ ServiceController<?> controller =
handlerChainServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
+ if (newControllers != null) {
+ newControllers.add(controller);
+ }
+ } else {
+ context.reloadRequired();
}
- return null;
}
private static String getAttributeValue(final ModelNode node, final String
propertyName) {
@@ -126,5 +102,4 @@
protected void populateModel(final ModelNode operation, final ModelNode model) throws
OperationFailedException {
Attributes.PROTOCOL_BINDINGS.validateAndSet(operation, model);
}
-
}
Deleted:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainRemove.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainRemove.java 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainRemove.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -1,97 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2012, 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.
- *
- * 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.as.webservices.dmr;
-
-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.POST_HANDLER_CHAIN;
-import static org.jboss.as.webservices.dmr.Constants.PRE_HANDLER_CHAIN;
-import static org.jboss.as.webservices.dmr.PackageUtils.getConfigs;
-import static org.jboss.as.webservices.dmr.PackageUtils.getServerConfig;
-
-import java.util.List;
-
-import org.jboss.as.controller.AbstractRemoveStepHandler;
-import org.jboss.as.controller.OperationContext;
-import org.jboss.as.controller.OperationFailedException;
-import org.jboss.as.controller.PathAddress;
-import org.jboss.as.controller.PathElement;
-import org.jboss.dmr.ModelNode;
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.metadata.config.CommonConfig;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
-
-/**
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
- */
-final class HandlerChainRemove extends AbstractRemoveStepHandler {
-
- static final HandlerChainRemove INSTANCE = new HandlerChainRemove();
-
- private HandlerChainRemove() {
- // forbidden instantiation
- }
-
- @Override
- protected void performRuntime(final OperationContext context, final ModelNode
operation, final ModelNode model) throws OperationFailedException {
- final ServerConfig config = getServerConfig(context);
- if (config != null) {
- final PathAddress address =
PathAddress.pathAddress(operation.require(OP_ADDR));
- final PathElement confElem = address.getElement(address.size() - 2);
- final String configType = confElem.getKey();
- final String configName = confElem.getValue();
- final String handlerChainType = address.getElement(address.size() -
1).getKey();
- final String handlerChainId = address.getElement(address.size() -
1).getValue();
- for (final CommonConfig commonConfig : getConfigs(config, configType)) {
- if (configName.equals(commonConfig.getConfigName())) {
- final List<UnifiedHandlerChainMetaData> handlerChains;
- if (PRE_HANDLER_CHAIN.equals(handlerChainType)) {
- handlerChains = commonConfig.getPreHandlerChains();
- } else if (POST_HANDLER_CHAIN.equals(handlerChainType)) {
- handlerChains = commonConfig.getPostHandlerChains();
- } else {
- throw MESSAGES.wrongHandlerChainType(handlerChainType,
PRE_HANDLER_CHAIN, POST_HANDLER_CHAIN);
- }
- final UnifiedHandlerChainMetaData handlerChain =
getChain(handlerChains, handlerChainId);
- if (handlerChain == null) {
- throw MESSAGES.missingHandlerChain(configName, handlerChainType,
handlerChainId);
- }
- handlerChains.remove(handlerChain);
- context.reloadRequired();
- return;
- }
- }
- throw MESSAGES.missingConfig(configName);
- }
- }
-
- private static UnifiedHandlerChainMetaData getChain(final
List<UnifiedHandlerChainMetaData> handlerChains, final String handlerChainId) {
- if (handlerChains != null) {
- for (final UnifiedHandlerChainMetaData handlerChain : handlerChains) {
- if (handlerChainId.equals(handlerChain.getId())) return handlerChain;
- }
- }
- return null;
- }
-
-}
Deleted:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerRemove.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerRemove.java 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerRemove.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -1,112 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2012, 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.
- *
- * 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.as.webservices.dmr;
-
-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.POST_HANDLER_CHAIN;
-import static org.jboss.as.webservices.dmr.Constants.PRE_HANDLER_CHAIN;
-import static org.jboss.as.webservices.dmr.PackageUtils.getConfigs;
-import static org.jboss.as.webservices.dmr.PackageUtils.getServerConfig;
-
-import java.util.List;
-
-import org.jboss.as.controller.AbstractRemoveStepHandler;
-import org.jboss.as.controller.OperationContext;
-import org.jboss.as.controller.OperationFailedException;
-import org.jboss.as.controller.PathAddress;
-import org.jboss.as.controller.PathElement;
-import org.jboss.dmr.ModelNode;
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.metadata.config.CommonConfig;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
-
-/**
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
- */
-final class HandlerRemove extends AbstractRemoveStepHandler {
-
- static final HandlerRemove INSTANCE = new HandlerRemove();
-
- private HandlerRemove() {
- // forbidden instantiation
- }
-
- @Override
- protected void performRuntime(final OperationContext context, final ModelNode
operation, final ModelNode model) throws OperationFailedException {
- final ServerConfig config = getServerConfig(context);
- if (config != null) {
- final PathAddress address =
PathAddress.pathAddress(operation.require(OP_ADDR));
- 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();
- for (final CommonConfig commonConfig : getConfigs(config, configType)) {
- if (configName.equals(commonConfig.getConfigName())) {
- final List<UnifiedHandlerChainMetaData> handlerChains;
- if (PRE_HANDLER_CHAIN.equals(handlerChainType)) {
- handlerChains = commonConfig.getPreHandlerChains();
- } else if (POST_HANDLER_CHAIN.equals(handlerChainType)) {
- handlerChains = commonConfig.getPostHandlerChains();
- } else {
- throw MESSAGES.wrongHandlerChainType(handlerChainType,
PRE_HANDLER_CHAIN, POST_HANDLER_CHAIN);
- }
- final UnifiedHandlerChainMetaData handlerChain =
getChain(handlerChains, handlerChainId);
- if (handlerChain == null) {
- throw MESSAGES.missingHandlerChain(configName, handlerChainType,
handlerChainId);
- }
- final UnifiedHandlerMetaData handler = getHandler(handlerChain,
handlerName);
- if (handler == null) {
- throw MESSAGES.missingHandler(configName, handlerChainType,
handlerChainId, handlerName);
- }
- handlerChain.getHandlers().remove(handler);
- context.reloadRequired();
- return;
- }
- }
- throw MESSAGES.missingConfig(configName);
- }
- }
-
- private static UnifiedHandlerChainMetaData getChain(final
List<UnifiedHandlerChainMetaData> handlerChains, final String handlerChainId) {
- if (handlerChains != null) {
- for (final UnifiedHandlerChainMetaData handlerChain : handlerChains) {
- if (handlerChainId.equals(handlerChain.getId())) return handlerChain;
- }
- }
- return null;
- }
-
- private static UnifiedHandlerMetaData getHandler(final UnifiedHandlerChainMetaData
handlerChain, final String handlerName) {
- if (handlerChain.getHandlers() != null) {
- for (final UnifiedHandlerMetaData handler : handlerChain.getHandlers()) {
- if (handlerName.equals(handler.getHandlerName())) return handler;
- }
- }
- return null;
- }
-
-}
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 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/PackageUtils.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -22,17 +22,17 @@
package org.jboss.as.webservices.dmr;
-import java.util.Collection;
-import java.util.Collections;
+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 org.jboss.as.controller.OperationContext;
import org.jboss.as.webservices.util.WSServices;
-import org.jboss.msc.service.ServiceController;
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.metadata.config.CommonConfig;
+import org.jboss.msc.service.ServiceName;
/**
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
*/
final class PackageUtils {
@@ -40,19 +40,32 @@
// forbidden instantiation
}
- static ServerConfig getServerConfig(final OperationContext context) {
- final ServiceController<?> configService =
context.getServiceRegistry(true).getService(WSServices.CONFIG_SERVICE);
- return configService != null ? (ServerConfig)configService.getValue() : null;
+ static ServiceName getEndpointConfigServiceName(String configName) {
+ return WSServices.ENDPOINT_CONFIG_SERVICE.append(configName);
}
- static Collection<? extends CommonConfig> getConfigs(ServerConfig serverConfig,
String confType) {
- if (Constants.ENDPOINT_CONFIG.equals(confType)) {
- return serverConfig.getEndpointConfigs();
- } else if (Constants.CLIENT_CONFIG.equals(confType)) {
- return serverConfig.getClientConfigs();
- } else {
- return Collections.emptyList();
- }
+ static ServiceName getClientConfigServiceName(String configName) {
+ return WSServices.CLIENT_CONFIG_SERVICE.append(configName);
}
-}
+ static ServiceName getConfigServiceName(final String configType, final String
configName) {
+ 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 handlerChainId) {
+ return configServiceName.append(HANDLER_CHAIN).append(handlerChainId);
+ }
+
+ static ServiceName getHandlerServiceName(final ServiceName handlerChainServiceName,
final String handlerName) {
+ return handlerChainServiceName.append(HANDLER).append(handlerName);
+ }
+
+ static ServiceName getPropertyServiceName(final ServiceName configServiceName, final
String propertyName) {
+ return configServiceName.append(PROPERTY).append(propertyName);
+ }
+
+}
\ 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 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/PropertyAdd.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -24,8 +24,8 @@
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.VALUE;
import static org.jboss.as.webservices.WSMessages.MESSAGES;
-import static org.jboss.as.webservices.dmr.PackageUtils.getConfigs;
-import static org.jboss.as.webservices.dmr.PackageUtils.getServerConfig;
+import static org.jboss.as.webservices.dmr.PackageUtils.getConfigServiceName;
+import static org.jboss.as.webservices.dmr.PackageUtils.getPropertyServiceName;
import java.util.List;
@@ -35,14 +35,17 @@
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.as.controller.ServiceVerificationHandler;
+import org.jboss.as.webservices.service.PropertyService;
import org.jboss.dmr.ModelNode;
+import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.ServiceController;
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.metadata.config.CommonConfig;
+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>
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
*/
final class PropertyAdd extends AbstractAddStepHandler {
@@ -62,24 +65,31 @@
@Override
protected void performRuntime(final OperationContext context, final ModelNode
operation, final ModelNode model, final ServiceVerificationHandler verificationHandler,
final List<ServiceController<?>> newControllers) throws
OperationFailedException {
- final ServerConfig config = getServerConfig(context);
- if (config != null) {
+ //modify the runtime if we're booting, otherwise set reload required and
leave the runtime unchanged
+ if (context.isBooting()) {
final PathAddress address =
PathAddress.pathAddress(operation.require(OP_ADDR));
final String propertyName = address.getElement(address.size() -
1).getValue();
final PathElement confElem = address.getElement(address.size() - 2);
final String configType = confElem.getKey();
final String configName = confElem.getValue();
final String propertyValue = operation.has(VALUE) ?
Attributes.VALUE.resolveModelAttribute(context,operation).asString() : null;
- for (final CommonConfig cfg : getConfigs(config, configType)) {
- if (configName.equals(cfg.getConfigName())) {
- cfg.setProperty(propertyName, propertyValue);
- if (!context.isBooting()) {
- context.reloadRequired();
- }
- return;
- }
+
+ final PropertyService<AbstractCommonConfig> service = new
PropertyService<AbstractCommonConfig>(propertyName, propertyValue);
+ final ServiceTarget target = context.getServiceTarget();
+ final ServiceName configServiceName = getConfigServiceName(configType,
configName);
+ if (context.getServiceRegistry(false).getService(configServiceName) == null)
{
+ throw MESSAGES.missingConfig(configName);
}
- throw MESSAGES.missingConfig(configName);
+
+ 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);
+ }
+ } else {
+ context.reloadRequired();
}
}
Deleted:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/PropertyRemove.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/PropertyRemove.java 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/PropertyRemove.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2012, 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.
- *
- * 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.as.webservices.dmr;
-
-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.PackageUtils.getConfigs;
-import static org.jboss.as.webservices.dmr.PackageUtils.getServerConfig;
-
-import org.jboss.as.controller.AbstractRemoveStepHandler;
-import org.jboss.as.controller.OperationContext;
-import org.jboss.as.controller.OperationFailedException;
-import org.jboss.as.controller.PathAddress;
-import org.jboss.as.controller.PathElement;
-import org.jboss.dmr.ModelNode;
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.metadata.config.CommonConfig;
-
-/**
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
- */
-final class PropertyRemove extends AbstractRemoveStepHandler {
-
- static final PropertyRemove INSTANCE = new PropertyRemove();
-
- private PropertyRemove() {
- // forbidden instantiation
- }
-
- @Override
- protected void performRuntime(final OperationContext context, final ModelNode
operation, final ModelNode model) throws OperationFailedException {
- final ServerConfig config = getServerConfig(context);
- if (config != null) {
- final PathAddress address =
PathAddress.pathAddress(operation.require(OP_ADDR));
- final String propertyName = address.getElement(address.size() -
1).getValue();
- PathElement confElem = address.getElement(address.size() - 2);
- final String configType = confElem.getKey();
- final String configName = confElem.getValue();
- for (final CommonConfig commonConfig : getConfigs(config, configType)) {
- if (configName.equals(commonConfig.getConfigName())) {
- if (commonConfig.getProperties().containsKey(propertyName)) {
- commonConfig.getProperties().remove(propertyName);
- context.reloadRequired();
- }
- return;
- }
- }
- throw MESSAGES.missingConfig(configName);
- }
- }
-
- @Override
- protected void recoverServices(final OperationContext context, final ModelNode
operation, final ModelNode model) throws OperationFailedException {
- PropertyAdd.INSTANCE.performRuntime(context, operation, model, null, null);
- }
-
-}
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSDeploymentActivator.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSDeploymentActivator.java 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSDeploymentActivator.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -38,6 +38,7 @@
import org.jboss.as.webservices.deployers.WSIntegrationProcessorJAXWS_JMS;
import org.jboss.as.webservices.deployers.WSIntegrationProcessorJAXWS_POJO;
import org.jboss.as.webservices.deployers.WSModelDeploymentProcessor;
+import org.jboss.as.webservices.deployers.WSServiceDependenciesProcessor;
import org.jboss.as.webservices.deployers.WebServicesContextJndiSetupProcessor;
import org.jboss.as.webservices.deployers.WebservicesDescriptorDeploymentProcessor;
import org.jboss.as.webservices.deployers.deployment.DeploymentAspectsProvider;
@@ -67,6 +68,7 @@
processorTarget.addDeploymentProcessor(WSExtension.SUBSYSTEM_NAME,
Phase.PARSE, Phase.PARSE_JAXWS_ENDPOINT_CREATE_COMPONENT_DESCRIPTIONS, new
WSIntegrationProcessorJAXWS_POJO());
processorTarget.addDeploymentProcessor(WSExtension.SUBSYSTEM_NAME,
Phase.PARSE, Phase.PARSE_JAXWS_HANDLER_CREATE_COMPONENT_DESCRIPTIONS, new
WSIntegrationProcessorJAXWS_HANDLER());
processorTarget.addDeploymentProcessor(WSExtension.SUBSYSTEM_NAME,
Phase.DEPENDENCIES, Phase.DEPENDENCIES_WS, new WSDependenciesProcessor());
+ processorTarget.addDeploymentProcessor(WSExtension.SUBSYSTEM_NAME,
Phase.POST_MODULE, 0x3000, new WSServiceDependenciesProcessor());
processorTarget.addDeploymentProcessor(WSExtension.SUBSYSTEM_NAME,
Phase.INSTALL, Phase.INSTALL_WS_UNIVERSAL_META_DATA_MODEL, new
WSModelDeploymentProcessor());
addDeploymentProcessors(processorTarget, Phase.INSTALL,
Phase.INSTALL_WS_DEPLOYMENT_ASPECTS);
}
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 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSExtension.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -34,6 +34,7 @@
import org.jboss.as.controller.ExtensionContext;
import org.jboss.as.controller.ModelVersion;
import org.jboss.as.controller.PathElement;
+import org.jboss.as.controller.ReloadRequiredRemoveStepHandler;
import org.jboss.as.controller.ReloadRequiredWriteAttributeHandler;
import org.jboss.as.controller.ResourceBuilder;
import org.jboss.as.controller.ResourceDefinition;
@@ -41,8 +42,7 @@
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.transform.RejectExpressionValuesTransformer;
-import org.jboss.as.controller.transform.TransformersSubRegistration;
+import org.jboss.as.controller.registry.ManagementResourceRegistration;
import org.jboss.as.controller.transform.description.RejectAttributeChecker;
import
org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder;
import org.jboss.as.controller.transform.description.TransformationDescription;
@@ -90,45 +90,53 @@
// ws subsystem
ResourceBuilder propertyResource = ResourceBuilder.Factory.create(PROPERTY_PATH,
getResourceDescriptionResolver(Constants.PROPERTY))
.setAddOperation(PropertyAdd.INSTANCE)
- .setRemoveOperation(PropertyRemove.INSTANCE)
+ .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
.addReadWriteAttribute(Attributes.VALUE, null, new
ReloadRequiredWriteAttributeHandler(Attributes.VALUE));
- ResourceBuilder handlerBuilder = ResourceBuilder.Factory.create(HANDLER_PATH,
getResourceDescriptionResolver("handler"))
+ ResourceBuilder handlerBuilder = ResourceBuilder.Factory.create(HANDLER_PATH,
getResourceDescriptionResolver(HANDLER))
.setAddOperation(HandlerAdd.INSTANCE)
- .setRemoveOperation(HandlerRemove.INSTANCE)
+ .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
.addReadWriteAttribute(Attributes.CLASS, null, new
ReloadRequiredWriteAttributeHandler(Attributes.CLASS));
ResourceBuilder preHandler =
ResourceBuilder.Factory.create(PRE_HANDLER_CHAIN_PATH,
getResourceDescriptionResolver(Constants.PRE_HANDLER_CHAIN))
.setAddOperation(HandlerChainAdd.INSTANCE)
- .setRemoveOperation(HandlerChainRemove.INSTANCE)
+ .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
.addReadWriteAttribute(Attributes.PROTOCOL_BINDINGS, null, new
ReloadRequiredWriteAttributeHandler(Attributes.PROTOCOL_BINDINGS))
.pushChild(handlerBuilder).pop();
ResourceBuilder postHandler =
ResourceBuilder.Factory.create(POST_HANDLER_CHAIN_PATH,
getResourceDescriptionResolver(Constants.POST_HANDLER_CHAIN))
.setAddOperation(HandlerChainAdd.INSTANCE)
- .setRemoveOperation(HandlerChainRemove.INSTANCE)
+ .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
.addReadWriteAttribute(Attributes.PROTOCOL_BINDINGS, null, new
ReloadRequiredWriteAttributeHandler(Attributes.PROTOCOL_BINDINGS))
.pushChild(handlerBuilder).pop();
- ResourceDefinition subsystemResource =
ResourceBuilder.Factory.createSubsystemRoot(SUBSYSTEM_PATH,
getResourceDescriptionResolver(), WSSubsystemAdd.INSTANCE, WSSubsystemRemove.INSTANCE)
- .addReadWriteAttribute(Attributes.WSDL_HOST, null, new
WSSubsystemAttributeChangeHandler(Attributes.WSDL_HOST))
- .addReadWriteAttribute(Attributes.WSDL_PORT, null, new
WSSubsystemAttributeChangeHandler(Attributes.WSDL_PORT))
- .addReadWriteAttribute(Attributes.WSDL_SECURE_PORT, null, new
WSSubsystemAttributeChangeHandler(Attributes.WSDL_SECURE_PORT))
- .addReadWriteAttribute(Attributes.MODIFY_WSDL_ADDRESS, null, new
WSSubsystemAttributeChangeHandler(Attributes.MODIFY_WSDL_ADDRESS))
- .pushChild(ENDPOINT_CONFIG_PATH, EndpointConfigAdd.INSTANCE,
EndpointConfigRemove.INSTANCE)
+ ResourceDefinition epConfigsDef =
ResourceBuilder.Factory.create(ENDPOINT_CONFIG_PATH,
getResourceDescriptionResolver(ENDPOINT_CONFIG))
+ .setAddOperation(EndpointConfigAdd.INSTANCE)
+ .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
.pushChild(propertyResource).pop()
.pushChild(preHandler).pop()
.pushChild(postHandler).pop()
- .pop()
- .pushChild(CLIENT_CONFIG_PATH, ClientConfigAdd.INSTANCE,
ClientConfigRemove.INSTANCE)
- .pushChild(propertyResource).pop()
- .pushChild(preHandler).pop()
- .pushChild(postHandler).pop()
- .pop()
.build();
- subsystem.registerSubsystemModel(subsystemResource);
+ ResourceDefinition clConfigsDef =
ResourceBuilder.Factory.create(CLIENT_CONFIG_PATH,
getResourceDescriptionResolver(CLIENT_CONFIG))
+ .setAddOperation(ClientConfigAdd.INSTANCE)
+ .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
+ .pushChild(propertyResource).pop()
+ .pushChild(preHandler).pop()
+ .pushChild(postHandler).pop()
+ .build();
+
+ ResourceDefinition subsystemResource =
ResourceBuilder.Factory.createSubsystemRoot(SUBSYSTEM_PATH,
getResourceDescriptionResolver(), WSSubsystemAdd.INSTANCE, WSSubsystemRemove.INSTANCE)
+ .addReadWriteAttribute(Attributes.WSDL_HOST, null, new
ReloadRequiredWriteAttributeHandler(Attributes.WSDL_HOST))
+ .addReadWriteAttribute(Attributes.WSDL_PORT, null, new
ReloadRequiredWriteAttributeHandler(Attributes.WSDL_PORT))
+ .addReadWriteAttribute(Attributes.WSDL_SECURE_PORT, null, new
ReloadRequiredWriteAttributeHandler(Attributes.WSDL_SECURE_PORT))
+ .addReadWriteAttribute(Attributes.MODIFY_WSDL_ADDRESS, null, new
ReloadRequiredWriteAttributeHandler(Attributes.MODIFY_WSDL_ADDRESS))
+ .build();
+ ManagementResourceRegistration subsystemRegistration =
subsystem.registerSubsystemModel(subsystemResource);
+ subsystemRegistration.registerSubModel(epConfigsDef);
+ subsystemRegistration.registerSubModel(clConfigsDef);
+
if (registerRuntimeOnly) {
subsystem.registerDeploymentModel(ResourceBuilder.Factory.create(SUBSYSTEM_PATH,
getResourceDescriptionResolver("deployment"))
.pushChild(ENDPOINT_PATH)
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 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -27,6 +27,7 @@
import static org.jboss.as.webservices.dmr.Constants.WSDL_SECURE_PORT;
import java.net.UnknownHostException;
+import java.util.ArrayList;
import java.util.List;
import org.jboss.as.controller.AbstractBoottimeAddStepHandler;
@@ -38,6 +39,7 @@
import org.jboss.as.controller.ProcessType;
import org.jboss.as.controller.ServiceVerificationHandler;
import org.jboss.as.controller.registry.Resource;
+import org.jboss.as.controller.registry.Resource.ResourceEntry;
import org.jboss.as.server.AbstractDeploymentChainStep;
import org.jboss.as.server.DeploymentProcessorTarget;
import org.jboss.as.webservices.config.ServerConfigImpl;
@@ -46,6 +48,7 @@
import org.jboss.as.webservices.util.ModuleClassLoaderProvider;
import org.jboss.dmr.ModelNode;
import org.jboss.msc.service.ServiceController;
+import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceTarget;
/**
@@ -79,11 +82,11 @@
ServiceTarget serviceTarget = context.getServiceTarget();
if (appclient && model.hasDefined(WSDL_HOST)) {
ServerConfigImpl serverConfig = createServerConfig(model, true, context);
- newControllers.add(ServerConfigService.install(serviceTarget, serverConfig,
verificationHandler));
+ newControllers.add(ServerConfigService.install(serviceTarget, serverConfig,
verificationHandler, getServerConfigDependencies(context)));
}
if (!appclient) {
ServerConfigImpl serverConfig = createServerConfig(model, false, context);
- newControllers.add(ServerConfigService.install(serviceTarget, serverConfig,
verificationHandler));
+ newControllers.add(ServerConfigService.install(serviceTarget, serverConfig,
verificationHandler, getServerConfigDependencies(context)));
final Resource webSubsystem =
context.readResourceFromRoot(PathAddress.pathAddress(PathElement.pathElement("subsystem",
"web")));
String defaultHost =
webSubsystem.getModel().get("default-virtual-server").asString();
newControllers.add(PortComponentLinkService.install(serviceTarget,
defaultHost, verificationHandler));
@@ -110,4 +113,39 @@
return config;
}
+ /**
+ * Process the model to figure out the name of the services the server config
services has to depend on
+ *
+ */
+ private static List<ServiceName> getServerConfigDependencies(OperationContext
context) {
+ final List<ServiceName> serviceNames = new ArrayList<ServiceName>();
+ final Resource subsystemResource =
context.readResourceFromRoot(PathAddress.pathAddress(WSExtension.SUBSYSTEM_PATH));
+ readConfigServiceNames(serviceNames, subsystemResource,
Constants.CLIENT_CONFIG);
+ readConfigServiceNames(serviceNames, subsystemResource,
Constants.ENDPOINT_CONFIG);
+ return serviceNames;
+ }
+
+ private static void readConfigServiceNames(List<ServiceName> serviceNames,
Resource subsystemResource, String configType) {
+ for (ResourceEntry re : subsystemResource.getChildren(configType)) {
+ 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));
+ }
+ }
+ }
+
}
Deleted:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAttributeChangeHandler.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAttributeChangeHandler.java 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAttributeChangeHandler.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2012, 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.
- *
- * 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.as.webservices.dmr;
-
-import static org.jboss.as.webservices.dmr.Constants.MODIFY_WSDL_ADDRESS;
-import static org.jboss.as.webservices.dmr.Constants.WSDL_HOST;
-import static org.jboss.as.webservices.dmr.Constants.WSDL_PORT;
-import static org.jboss.as.webservices.dmr.Constants.WSDL_SECURE_PORT;
-
-import org.jboss.as.controller.AbstractWriteAttributeHandler;
-import org.jboss.as.controller.AttributeDefinition;
-import org.jboss.as.controller.OperationContext;
-import org.jboss.as.controller.OperationFailedException;
-import org.jboss.as.webservices.util.WSServices;
-import org.jboss.dmr.ModelNode;
-import org.jboss.msc.service.ServiceController;
-import org.jboss.wsf.spi.management.ServerConfig;
-
-/**
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-final class WSSubsystemAttributeChangeHandler extends
AbstractWriteAttributeHandler<Void> {
-
- WSSubsystemAttributeChangeHandler(AttributeDefinition... definitions) {
- super(definitions);
- }
-
- @Override
- protected boolean applyUpdateToRuntime(final OperationContext context, final
ModelNode operation, final String attributeName, final ModelNode resolvedValue, final
ModelNode currentValue, final
org.jboss.as.controller.AbstractWriteAttributeHandler.HandbackHolder<Void>
voidHandback) throws OperationFailedException {
- final ServiceController<?> configService =
context.getServiceRegistry(true).getService(WSServices.CONFIG_SERVICE);
- if (configService != null) {
- final ServerConfig config = (ServerConfig) configService.getValue();
- final String value = resolvedValue.isDefined() ? resolvedValue.asString() :
null;
-
- if (MODIFY_WSDL_ADDRESS.equals(attributeName)) {
- final boolean modifyWSDLAddress = value != null &&
Boolean.parseBoolean(value);
- config.setModifySOAPAddress(modifyWSDLAddress);
- } else if (WSDL_HOST.equals(attributeName)) {
- final String host = value != null ? value : null;
- try {
- config.setWebServiceHost(host);
- } catch (final Exception e) {
- throw new OperationFailedException(e.getMessage(), e);
- }
- } else if (WSDL_PORT.equals(attributeName)) {
- final int port = value != null ? Integer.parseInt(value) : -1;
- config.setWebServicePort(port);
- } else if (WSDL_SECURE_PORT.equals(attributeName)) {
- final int securePort = value != null ? Integer.parseInt(value) : -1;
- config.setWebServiceSecurePort(securePort);
- }
- }
-
- return true;
- }
-
- @Override
- protected void revertUpdateToRuntime(final OperationContext context, final ModelNode
operation, final String attributeName, final ModelNode valueToRestore, final ModelNode
valueToRevert, final Void handback) throws OperationFailedException {
- // does nothing
- }
-
-}
Added:
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
(rev 0)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * 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.
+ *
+ * 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.as.webservices.service;
+
+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.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.metadata.config.AbstractCommonConfig;
+import org.jboss.wsf.spi.metadata.config.ClientConfig;
+import org.jboss.wsf.spi.metadata.config.EndpointConfig;
+
+/**
+ * A service for setting a ws client / endpoint config.
+ *
+ * @author paul.robinson(a)jboss.com
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
+ */
+public final class ConfigService implements Service<AbstractCommonConfig> {
+
+ private final ServerConfig serverConfig;
+ private final String configName;
+ private final boolean client;
+ private volatile AbstractCommonConfig config;
+
+ public ConfigService(ServerConfig serverConfig, String configName, boolean client) {
+ this.configName = configName;
+ this.client = client;
+ this.serverConfig = serverConfig;
+ }
+
+ @Override
+ public AbstractCommonConfig getValue() {
+ return config;
+ }
+
+ @Override
+ public void start(final StartContext context) throws StartException {
+ if (client) {
+ ClientConfig clientConfig = new ClientConfig();
+ clientConfig.setConfigName(configName);
+ serverConfig.addClientConfig(clientConfig);
+ config = clientConfig;
+ } else {
+ EndpointConfig endpointConfig = new EndpointConfig();
+ endpointConfig.setConfigName(configName);
+ serverConfig.addEndpointConfig(endpointConfig);
+ config = endpointConfig;
+ }
+ }
+
+ @Override
+ public void stop(final StopContext context) {
+ if (client) {
+ serverConfig.getClientConfigs().remove(config);
+ } else {
+ serverConfig.getEndpointConfigs().remove(config);
+ }
+ }
+}
Property changes on:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -227,6 +227,7 @@
builder.addDependency(DependencyType.OPTIONAL, MBEAN_SERVER_NAME,
MBeanServer.class,
service.getMBeanServerInjector());
+ builder.addDependency(DependencyType.REQUIRED, WSServices.CONFIG_SERVICE);
builder.setInitialMode(Mode.ACTIVE);
builder.install();
}
Added:
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
(rev 0)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -0,0 +1,122 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * 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.
+ *
+ * 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.as.webservices.service;
+
+import static org.jboss.as.webservices.WSMessages.MESSAGES;
+
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+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;
+
+/**
+ * A service for setting a handler chain into an endpoint / client config.
+ *
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
+ */
+public final class HandlerChainService<T extends AbstractCommonConfig> implements
Service<UnifiedHandlerChainMetaData> {
+
+ private InjectedValue<T> abstractCommonConfig = new InjectedValue<T>();
+ private final String handlerChainType;
+ private final String handlerChainId;
+ private final String protocolBindings;
+ private volatile UnifiedHandlerChainMetaData handlerChain;
+
+ public HandlerChainService(String handlerChainType, String handlerChainId, String
protocolBindings) {
+ this.handlerChainType = handlerChainType;
+ this.handlerChainId = handlerChainId;
+ this.protocolBindings = protocolBindings;
+ }
+
+ @Override
+ public UnifiedHandlerChainMetaData getValue() {
+ return handlerChain;
+ }
+
+ @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);
+ }
+
+ 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);
+ }
+
+ public InjectedValue<T> getAbstractCommonConfig() {
+ return abstractCommonConfig;
+ }
+}
Property changes on:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
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
(rev 0)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * 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.
+ *
+ * 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.as.webservices.service;
+
+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.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.
+ *
+ * @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;
+
+ public HandlerService(String handlerName, String handlerClass) {
+ this.handlerName = handlerName;
+ this.handlerClass = handlerClass;
+ }
+
+ @Override
+ public UnifiedHandlerMetaData getValue() {
+ return handler;
+ }
+
+ @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);
+ }
+ }
+
+ @Override
+ public void stop(final StopContext context) {
+ final UnifiedHandlerChainMetaData chain = handlerChain.getValue();
+ synchronized (chain) { //JBWS-3707
+ chain.getHandlers().remove(handler);
+ }
+ }
+
+ public InjectedValue<UnifiedHandlerChainMetaData> getHandlerChain() {
+ return handlerChain;
+ }
+}
Property changes on:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
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
(rev 0)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/PropertyService.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * 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.
+ *
+ * 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.as.webservices.service;
+
+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;
+
+/**
+ * A service for setting a property into an endpoint / client config.
+ *
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
+ */
+public final class PropertyService<T extends AbstractCommonConfig> implements
Service<String> {
+
+ private InjectedValue<T> abstractCommonConfig = new InjectedValue<T>();
+ private final String propValue;
+ private final String propName;
+
+ public PropertyService(String propName, String propValue) {
+ this.propValue = propValue;
+ this.propName = propName;
+ }
+
+ @Override
+ public String getValue() {
+ return propValue;
+ }
+
+ @Override
+ public void start(final StartContext context) throws StartException {
+ final AbstractCommonConfig commonConfig = abstractCommonConfig.getValue();
+ synchronized (commonConfig) { //JBWS-3707
+ commonConfig.setProperty(propName, propValue);
+ }
+ }
+
+ @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);
+ }
+ }
+ }
+
+ public InjectedValue<T> getAbstractCommonConfig() {
+ return abstractCommonConfig;
+ }
+}
Property changes on:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/PropertyService.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/ServerConfigService.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/ServerConfigService.java 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/service/ServerConfigService.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -23,6 +23,8 @@
import static org.jboss.as.webservices.WSLogger.ROOT_LOGGER;
+import java.util.List;
+
import javax.management.MBeanServer;
import org.jboss.as.server.ServerEnvironment;
@@ -46,7 +48,7 @@
/**
* WS server config service.
*
- * @author alessio.soldano(a)jboss.com
+ * @author <a href="alessio.soldano(a)jboss.com">Alessio Soldano</a>
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public final class ServerConfigService implements Service<ServerConfig> {
@@ -83,10 +85,14 @@
}
}
- public static ServiceController<?> install(final ServiceTarget serviceTarget,
final ServerConfigImpl serverConfig, final ServiceListener<Object> listener) {
+ public static ServiceController<?> install(final ServiceTarget serviceTarget,
final ServerConfigImpl serverConfig,
+ final ServiceListener<Object> listener, final List<ServiceName>
dependencies) {
final ServiceBuilder<ServerConfig> builder =
serviceTarget.addService(WSServices.CONFIG_SERVICE, new
ServerConfigService(serverConfig));
builder.addDependency(DependencyType.OPTIONAL, MBEAN_SERVER_NAME,
MBeanServer.class, serverConfig.getMBeanServerInjector());
builder.addDependency(ServerEnvironmentService.SERVICE_NAME,
ServerEnvironment.class, serverConfig.getServerEnvironmentInjector());
+ for (ServiceName dep : dependencies) {
+ builder.addDependency(dep);
+ }
builder.addListener(listener);
builder.setInitialMode(Mode.ACTIVE);
ServiceController<?> sc = builder.install();
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -28,6 +28,7 @@
import java.util.Collections;
import java.util.List;
+import org.jboss.as.controller.OperationContext;
import org.jboss.as.server.deployment.AttachmentKey;
import org.jboss.as.server.deployment.Attachments;
import org.jboss.as.server.deployment.DeploymentUnit;
@@ -292,4 +293,10 @@
return service != null ? service.getValue() : null;
}
+ @SuppressWarnings("unchecked")
+ public static <T> T getMSCService(final ServiceName serviceName, final
Class<T> clazz, final OperationContext context) {
+ ServiceController<T> service =
(ServiceController<T>)context.getServiceRegistry(false).getService(serviceName);
+ return service != null ? service.getValue() : null;
+ }
+
}
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/ServiceContainerEndpointRegistry.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/ServiceContainerEndpointRegistry.java 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/ServiceContainerEndpointRegistry.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -46,8 +46,8 @@
String contextPath = sname.getParent().getSimpleName().substring(8);
String endpointName = sname.getSimpleName();
final StringBuilder name = new StringBuilder(Endpoint.SEPID_DOMAIN +
":");
- name.append(Endpoint.SEPID_PROPERTY_CONTEXT + "=" + contextPath
+ ",");
- name.append(Endpoint.SEPID_PROPERTY_ENDPOINT + "=" +
endpointName);
+ name.append(Endpoint.SEPID_PROPERTY_CONTEXT +
"=").append(contextPath).append(",");
+ name.append(Endpoint.SEPID_PROPERTY_ENDPOINT +
"=").append(endpointName);
endpoints.add(ObjectNameFactory.create(name.toString()));
}
}
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/WSAttachmentKeys.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/WSAttachmentKeys.java 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/WSAttachmentKeys.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -29,6 +29,7 @@
import org.jboss.metadata.ear.jboss.JBossAppMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.spi.metadata.jms.JMSEndpointsMetaData;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
@@ -52,6 +53,7 @@
public static final AttachmentKey<ClassLoader> CLASSLOADER_KEY =
AttachmentKey.create(ClassLoader.class);
public static final AttachmentKey<WSReferences> WS_REFERENCES =
AttachmentKey.create(WSReferences.class);
public static final AttachmentKey<WSEndpointHandlersMapping>
WS_ENDPOINT_HANDLERS_MAPPING_KEY = AttachmentKey.create(WSEndpointHandlersMapping.class);
+ public static final AttachmentKey<ServerConfig> SERVER_CONFIG_KEY =
AttachmentKey.create(ServerConfig.class);
private WSAttachmentKeys() {
// forbidden inheritance
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/WSServices.java
===================================================================
---
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/WSServices.java 2013-12-02
22:24:36 UTC (rev 18115)
+++
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/WSServices.java 2013-12-03
11:55:51 UTC (rev 18116)
@@ -36,12 +36,14 @@
public static final ServiceName WS_SERVICE =
ServiceName.JBOSS.append("ws");
public static final ServiceName CONFIG_SERVICE =
WS_SERVICE.append("config");
+ public static final ServiceName CLIENT_CONFIG_SERVICE =
WS_SERVICE.append("client-config");
+ public static final ServiceName ENDPOINT_CONFIG_SERVICE =
WS_SERVICE.append("endpoint-config");
public static final ServiceName MODEL_SERVICE =
WS_SERVICE.append("model");
public static final ServiceName ENDPOINT_SERVICE =
WS_SERVICE.append("endpoint");
public static final ServiceName ENDPOINT_PUBLISH_SERVICE =
WS_SERVICE.append("endpoint-publish");
public static final ServiceName PORT_COMPONENT_LINK_SERVICE =
WS_SERVICE.append("port-component-link");
- private static ServiceRegistry registry;
+ private static volatile ServiceRegistry registry;
public static void saveContainerRegistry(ServiceRegistry containerRegistry) {
registry = containerRegistry;