Author: asoldano
Date: 2014-05-14 10:39:59 -0400 (Wed, 14 May 2014)
New Revision: 18648
Added:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/config/DisabledOperationException.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/JandexAnnotationsInfo.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSServerConfigAttributeHandler.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/XTSClientIntegrationService.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/test/java/org/jboss/as/webservices/config/
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/test/java/org/jboss/as/webservices/config/ServerConfigImplTestCase.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/test/resources/org/jboss/as/webservices/config/
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/test/resources/org/jboss/as/webservices/config/util/
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/test/resources/org/jboss/as/webservices/config/util/META-INF/
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/test/resources/org/jboss/as/webservices/config/util/META-INF/services/
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/test/resources/org/jboss/as/webservices/config/util/META-INF/services/org.jboss.wsf.spi.management.StackConfigFactory
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/WSMessages.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/config/ServerConfigImpl.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/config/WebServerInfoImpl.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSModelDeploymentProcessor.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSServiceDependenciesProcessor.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigAdd.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerAdd.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainAdd.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/PackageUtils.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/PropertyAdd.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSExtension.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/injection/WSHandlerChainAnnotationProcessor.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/PropertyService.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/WSServices.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java
container/wildfly81/branches/jbossws-wildfly810/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java
Log:
[JBWS-3794] JBossWS 4.2.x -> 4.3.x
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/WSMessages.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/WSMessages.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/WSMessages.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -29,6 +29,7 @@
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
import org.jboss.as.server.deployment.module.ResourceRoot;
+import org.jboss.as.webservices.config.DisabledOperationException;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.Message;
@@ -170,4 +171,10 @@
@Message(id = 15606, value = "Class verification of Java Web Service
implementation class %s failed.")
DeploymentUnitProcessingException jwsWebServiceClassVerificationFailed(Class<?>
seiClass);
+ @Message(id = 15615, value = "Could not update WS server configuration because
of pending former model update(s) requiring reload.")
+ DisabledOperationException couldNotUpdateServerConfigBecauseOfReloadRequired();
+
+ @Message(id = 15616, value = "Could not update WS server configuration because
of existing WS deployment on the server.")
+ DisabledOperationException
couldNotUpdateServerConfigBecauseOfExistingWSDeployment();
+
}
Added:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/config/DisabledOperationException.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/config/DisabledOperationException.java
(rev 0)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/config/DisabledOperationException.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.as.webservices.config;
+
+/**
+ * Exception indicating the required operation is disabled (temporarly or pemanently) and
hence coudn't be performed.
+ *
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
+ */
+public final class DisabledOperationException extends RuntimeException {
+
+ private static final long serialVersionUID = 1773053642986195568L;
+
+ public DisabledOperationException() {
+ super();
+ }
+
+ public DisabledOperationException(String message) {
+ super(message);
+ }
+
+ public DisabledOperationException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
Property changes on:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/config/DisabledOperationException.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/config/ServerConfigImpl.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/config/ServerConfigImpl.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/config/ServerConfigImpl.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -22,16 +22,21 @@
package org.jboss.as.webservices.config;
import java.io.File;
+import java.net.UnknownHostException;
+import java.util.concurrent.atomic.AtomicInteger;
import javax.management.MBeanServer;
import org.jboss.as.server.ServerEnvironment;
+import org.jboss.as.webservices.WSMessages;
import org.jboss.msc.value.InjectedValue;
import org.jboss.ws.common.management.AbstractServerConfig;
import org.jboss.ws.common.management.AbstractServerConfigMBean;
+import org.jboss.wsf.spi.metadata.config.ClientConfig;
/**
- * AS specific ServerConfig.
+ * WFLY specific ServerConfig, extending AbstractServerConfig with management
+ * related functionalities.
*
* @author <a href="mailto:asoldano@redhat.com">Alessio
Soldano</a>
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
@@ -41,11 +46,80 @@
private final InjectedValue<MBeanServer> injectedMBeanServer = new
InjectedValue<MBeanServer>();
private final InjectedValue<ServerEnvironment> injectedServerEnvironment = new
InjectedValue<ServerEnvironment>();
+ private final AtomicInteger wsDeploymentCount = new AtomicInteger(0);
+ private final DMRSynchCheckHandler webServiceHostUCH = new DMRSynchCheckHandler();
+ private final DMRSynchCheckHandler webServicePortUCH = new DMRSynchCheckHandler();
+ private final DMRSynchCheckHandler webServiceSecurePortUCH = new
DMRSynchCheckHandler();
+ private final DMRSynchCheckHandler modifySOAPAddressUCH = new
DMRSynchCheckHandler();
+
private ServerConfigImpl() {
// forbidden inheritance
}
+ @Override
+ public void create() throws Exception {
+ super.create();
+ wsDeploymentCount.set(0);
+ webServiceHostUCH.reset();
+ webServicePortUCH.reset();
+ webServiceSecurePortUCH.reset();
+ modifySOAPAddressUCH.reset();
+ }
+
+ public void incrementWSDeploymentCount() {
+ wsDeploymentCount.incrementAndGet();
+ }
+
+ public void decrementWSDeploymentCount() {
+ wsDeploymentCount.decrementAndGet();
+ }
+
+ protected boolean isModifiable() {
+ return (wsDeploymentCount.get() == 0);
+ }
+
+ public void setWebServiceHost(String host, boolean forceUpdate) throws
UnknownHostException {
+ setWebServiceHost(host, forceUpdate ? null : webServiceHostUCH);
+ }
+
+ @Override
+ public void setWebServiceHost(String host) throws UnknownHostException {
+ //prevent any change if the DMR configuration is not in synch anymore with the
runtime
+ setWebServiceHost(host, webServiceHostUCH);
+ }
+
+ public void setWebServicePort(int port, boolean forceUpdate) {
+ setWebServicePort(port, forceUpdate ? null : webServicePortUCH);
+ }
+
+ @Override
+ public void setWebServicePort(int port) {
+ //prevent any change if the DMR configuration is not in synch anymore with the
runtime
+ setWebServicePort(port, webServicePortUCH);
+ }
+
+ public void setWebServiceSecurePort(int port, boolean forceUpdate) {
+ setWebServiceSecurePort(port, forceUpdate ? null : webServiceSecurePortUCH);
+ }
+
+ @Override
+ public void setWebServiceSecurePort(int port) {
+ //prevent any change if the DMR configuration is not in synch anymore with the
runtime
+ setWebServiceSecurePort(port, webServiceSecurePortUCH);
+ }
+
+ public void setModifySOAPAddress(boolean flag, boolean forceUpdate) {
+ setModifySOAPAddress(flag, forceUpdate ? null : modifySOAPAddressUCH);
+ }
+
+ @Override
+ public void setModifySOAPAddress(boolean flag) {
+ //prevent any change if the DMR configuration is not in synch anymore with the
runtime
+ setModifySOAPAddress(flag, modifySOAPAddressUCH);
+ }
+
+
public File getServerTempDir() {
return getServerEnvironment().getServerTempDir();
}
@@ -84,4 +158,29 @@
return new ServerConfigImpl();
}
+ public void setClientConfigWrapper(ClientConfig config, boolean reload) {
+ clientConfigStore.setWrapperConfig(config, reload);
+ }
+
+ private class DMRSynchCheckHandler implements UpdateCallbackHandler {
+
+ private volatile boolean dmrSynched = true;
+
+ @Override
+ public void onBeforeUpdate() {
+ if (!dmrSynched) {
+ throw
WSMessages.MESSAGES.couldNotUpdateServerConfigBecauseOfReloadRequired();
+ }
+ //prevent any modification to the AbstractServerConfig members
+ //when there's at least a WS endpoint deployment on the server
+ if (!isModifiable()) {
+ dmrSynched = false;
+ throw
WSMessages.MESSAGES.couldNotUpdateServerConfigBecauseOfExistingWSDeployment();
+ }
+ }
+
+ public void reset() {
+ dmrSynched = true;
+ }
+ }
}
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/config/WebServerInfoImpl.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/config/WebServerInfoImpl.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/config/WebServerInfoImpl.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -26,7 +26,7 @@
public class WebServerInfoImpl implements WebServerInfo {
- private CommonWebServer webServer;
+ private final CommonWebServer webServer;
public WebServerInfoImpl(CommonWebServer webServer) {
this.webServer = webServer;
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -92,7 +92,7 @@
}
//extract SOAP-over-JMS 1.0 bindings
- final JMSEndpointsMetaData endpointsMetaData = new JMSEndpointsMetaData();
+ List<JMSEndpointMetaData> list = new
LinkedList<JMSEndpointMetaData>();
if (!map.isEmpty()) {
for (String wsdlLocation : map.keySet()) {
@@ -114,14 +114,7 @@
ClassInfo webServiceClassInfo = (ClassInfo) ai.target();
String beanClassName =
webServiceClassInfo.name().toString();
//service name ?
- JMSEndpointMetaData endpointMetaData = new
JMSEndpointMetaData(endpointsMetaData);
- endpointMetaData.setEndpointName(port);
- endpointMetaData.setName(beanClassName);
- endpointMetaData.setImplementor(beanClassName);
- //endpointMetaData.setName(name);
- endpointMetaData.setSoapAddress(soapAddress);
- endpointMetaData.setWsdlLocation(wsdlLocation);
- endpointsMetaData.addEndpointMetaData(endpointMetaData);
+ list.add(new JMSEndpointMetaData(beanClassName, port,
beanClassName, wsdlLocation, soapAddress));
}
}
} catch (Exception ignore) {
@@ -130,7 +123,7 @@
}
}
- unit.putAttachment(JMS_ENDPOINT_METADATA_KEY, endpointsMetaData);
+ unit.putAttachment(JMS_ENDPOINT_METADATA_KEY, new JMSEndpointsMetaData(list));
}
@Override
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSModelDeploymentProcessor.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSModelDeploymentProcessor.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSModelDeploymentProcessor.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -25,7 +25,10 @@
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.config.ServerConfigImpl;
import org.jboss.as.webservices.deployers.deployment.WSDeploymentBuilder;
+import org.jboss.as.webservices.util.WSAttachmentKeys;
+import org.jboss.as.webservices.util.WSServices;
/**
* This deployer initializes JBossWS deployment meta data.
@@ -39,11 +42,22 @@
public void internalDeploy(final DeploymentPhaseContext phaseContext) throws
DeploymentUnitProcessingException {
final DeploymentUnit unit = phaseContext.getDeploymentUnit();
WSDeploymentBuilder.getInstance().build(unit);
+
+ if (isWebServiceDeployment(unit)) { //note, this check works only after the
WSDeploymentBuilder above has run
+ ServerConfigImpl config =
(ServerConfigImpl)phaseContext.getServiceRegistry().getRequiredService(WSServices.CONFIG_SERVICE).getValue();
+ config.incrementWSDeploymentCount();
+ }
}
@Override
public void internalUndeploy(final org.jboss.as.server.deployment.DeploymentUnit
context) {
- // does nothing
+ if (isWebServiceDeployment(context)) {
+ ServerConfigImpl config =
(ServerConfigImpl)context.getServiceRegistry().getRequiredService(WSServices.CONFIG_SERVICE).getValue();
+ config.decrementWSDeploymentCount();
+ }
}
+ private static boolean isWebServiceDeployment(final DeploymentUnit unit) {
+ return unit.getAttachment(WSAttachmentKeys.DEPLOYMENT_KEY) != null;
+ }
}
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSServiceDependenciesProcessor.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSServiceDependenciesProcessor.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSServiceDependenciesProcessor.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -29,7 +29,7 @@
import org.jboss.as.webservices.util.WSServices;
/**
- * A DUP that sets the service dependencies to be satisfied before installing any WS
deployments
+ * A DUP that sets the service dependencies to be satisfied before installing any
deployments
*
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
*/
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -44,6 +44,7 @@
import org.jboss.ws.common.ResourceLoaderAdapter;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.AnnotationsInfo;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
@@ -210,6 +211,8 @@
}
dep.setRuntimeClassLoader(classLoader);
dep.setType(deploymentType);
+ //add an AnnotationInfo attachment that uses composite jandex index
+ dep.addAttachment(AnnotationsInfo.class, new JandexAnnotationsInfo(unit));
return dep;
}
Added:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/JandexAnnotationsInfo.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/JandexAnnotationsInfo.java
(rev 0)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/JandexAnnotationsInfo.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.as.webservices.deployers.deployment;
+
+import static org.jboss.as.server.deployment.Attachments.ANNOTATION_INDEX;
+
+import java.util.List;
+
+import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.module.ResourceRoot;
+import org.jboss.as.webservices.util.ASHelper;
+import org.jboss.jandex.AnnotationInstance;
+import org.jboss.jandex.DotName;
+import org.jboss.jandex.Index;
+import org.jboss.wsf.spi.deployment.AnnotationsInfo;
+
+/**
+ * A Jandex based implementation of org.jboss.wsf.spi.deployment.AnnotationsInfo
+ *
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
+ */
+public final class JandexAnnotationsInfo implements AnnotationsInfo {
+
+ private final List<ResourceRoot> resourceRoots;
+
+ public JandexAnnotationsInfo(DeploymentUnit unit) {
+ resourceRoots = ASHelper.getResourceRoots(unit);
+ }
+
+ @Override
+ public boolean hasAnnotatedClasses(String... annotation) {
+ if (annotation == null) {
+ throw new IllegalArgumentException();
+ }
+ if (resourceRoots != null) {
+ Index index = null;
+ for (ResourceRoot resourceRoot : resourceRoots) {
+ index = resourceRoot.getAttachment(ANNOTATION_INDEX);
+ if (index != null) {
+ for (String ann : annotation) {
+ List<AnnotationInstance> list =
index.getAnnotations(DotName.createSimple(ann));
+ if (list != null && !list.isEmpty()) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+}
Property changes on:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/JandexAnnotationsInfo.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -32,14 +32,17 @@
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.ServiceVerificationHandler;
import org.jboss.as.webservices.service.ConfigService;
+import org.jboss.as.webservices.service.PropertyService;
import org.jboss.as.webservices.util.ASHelper;
import org.jboss.as.webservices.util.WSServices;
import org.jboss.dmr.ModelNode;
+import org.jboss.msc.inject.Injector;
import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceTarget;
import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
/**
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
@@ -77,7 +80,10 @@
final ConfigService clientConfigService = new ConfigService(serverConfig, name,
true);
final ServiceTarget target = context.getServiceTarget();
final ServiceBuilder<?> clientServiceBuilder =
target.addService(serviceName, clientConfigService);
-
+ setDependency(context, clientServiceBuilder,
clientConfigService.getPropertiesInjector(), PropertyService.class, serviceName, address,
Constants.PROPERTY);
+ setDependency(context, clientServiceBuilder,
clientConfigService.getPreHandlerChainsInjector(), UnifiedHandlerChainMetaData.class,
serviceName, address, Constants.PRE_HANDLER_CHAIN);
+ final Injector<UnifiedHandlerChainMetaData> postInjector =
clientConfigService.getPostHandlerChainsInjector();
+ setDependency(context, clientServiceBuilder, postInjector,
UnifiedHandlerChainMetaData.class, serviceName, address, Constants.POST_HANDLER_CHAIN);
ServiceController<?> controller =
clientServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
newControllers.add(controller);
@@ -86,4 +92,11 @@
context.reloadRequired();
}
}
+
+ private <T> void setDependency(final OperationContext context, final
ServiceBuilder<?> builder, final Injector<T> injector,
+ final Class<T> injectedClass, final ServiceName serviceName, final
PathAddress address, final String handlerChainType) {
+ for (ServiceName sn : PackageUtils.getServiceNameDependencies(context,
serviceName, address, handlerChainType)) {
+ builder.addDependency(sn, injectedClass, injector);
+ }
+ }
}
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigAdd.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigAdd.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigAdd.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -35,11 +35,13 @@
import org.jboss.as.webservices.util.ASHelper;
import org.jboss.as.webservices.util.WSServices;
import org.jboss.dmr.ModelNode;
+import org.jboss.msc.inject.Injector;
import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceTarget;
import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
/**
* @author <a href="ema(a)redhat.com">Jim Ma</a>
@@ -81,6 +83,8 @@
final ServiceTarget target = context.getServiceTarget();
final ServiceBuilder<?> clientServiceBuilder =
target.addService(serviceName, endpointConfigService);
+ setDependency(context, clientServiceBuilder,
endpointConfigService.getPreHandlerChainsInjector(), serviceName, address,
Constants.PRE_HANDLER_CHAIN);
+ setDependency(context, clientServiceBuilder,
endpointConfigService.getPostHandlerChainsInjector(), serviceName, address,
Constants.POST_HANDLER_CHAIN);
ServiceController<?> controller =
clientServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
newControllers.add(controller);
@@ -89,4 +93,11 @@
context.reloadRequired();
}
}
+
+ private void setDependency(final OperationContext context, final
ServiceBuilder<?> builder, final Injector<UnifiedHandlerChainMetaData>
injector,
+ final ServiceName serviceName, final PathAddress address, final String
handlerChainType) {
+ for (ServiceName sn : PackageUtils.getServiceNameDependencies(context,
serviceName, address, handlerChainType)) {
+ builder.addDependency(sn, UnifiedHandlerChainMetaData.class, injector);
+ }
+ }
}
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerAdd.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerAdd.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerAdd.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2012, Red Hat, Inc., and individual contributors
+ * Copyright 2013, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -43,7 +43,6 @@
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceRegistry;
import org.jboss.msc.service.ServiceTarget;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
/**
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
@@ -73,6 +72,7 @@
final PathElement confElem = address.getElement(address.size() - 3);
final String configType = confElem.getKey();
final String configName = confElem.getValue();
+ final String handlerChainType = address.getElement(address.size() -
2).getKey();
final String handlerChainId = address.getElement(address.size() -
2).getValue();
final String handlerName = address.getElement(address.size() -
1).getValue();
final String handlerClass = operation.require(CLASS).asString();
@@ -84,15 +84,13 @@
if (registry.getService(configServiceName) == null) {
throw MESSAGES.missingConfig(configName);
}
- final ServiceName handlerChainServiceName =
getHandlerChainServiceName(configServiceName, handlerChainId);
+ final ServiceName handlerChainServiceName =
getHandlerChainServiceName(configServiceName, handlerChainType, handlerChainId);
if (registry.getService(handlerChainServiceName) == null) {
- String handlerChainType = address.getElement(address.size() -
2).getKey();
throw MESSAGES.missingHandlerChain(configName, handlerChainType,
handlerChainId);
}
final ServiceName handlerServiceName =
getHandlerServiceName(handlerChainServiceName, handlerName);
final ServiceBuilder<?> handlerServiceBuilder =
target.addService(handlerServiceName, service);
- handlerServiceBuilder.addDependency(handlerChainServiceName,
UnifiedHandlerChainMetaData.class, service.getHandlerChain());
ServiceController<?> controller =
handlerServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
newControllers.add(controller);
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainAdd.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainAdd.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainAdd.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -23,6 +23,7 @@
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
import static org.jboss.as.webservices.WSMessages.MESSAGES;
+import static org.jboss.as.webservices.dmr.Constants.HANDLER;
import static org.jboss.as.webservices.dmr.Constants.PROTOCOL_BINDINGS;
import static org.jboss.as.webservices.dmr.PackageUtils.getConfigServiceName;
import static org.jboss.as.webservices.dmr.PackageUtils.getHandlerChainServiceName;
@@ -37,11 +38,12 @@
import org.jboss.as.controller.ServiceVerificationHandler;
import org.jboss.as.webservices.service.HandlerChainService;
import org.jboss.dmr.ModelNode;
+import org.jboss.msc.inject.Injector;
import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceTarget;
-import org.jboss.wsf.spi.metadata.config.AbstractCommonConfig;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
/**
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
@@ -80,11 +82,14 @@
throw MESSAGES.missingConfig(configName);
}
- final ServiceName handlerChainServiceName =
getHandlerChainServiceName(configServiceName, handlerChainId);
- final HandlerChainService<AbstractCommonConfig> service = new
HandlerChainService<AbstractCommonConfig>(handlerChainType, handlerChainId,
protocolBindings);
+ final ServiceName handlerChainServiceName =
getHandlerChainServiceName(configServiceName, handlerChainType, handlerChainId);
+ final HandlerChainService service = new HandlerChainService(handlerChainType,
handlerChainId, protocolBindings);
final ServiceTarget target = context.getServiceTarget();
final ServiceBuilder<?> handlerChainServiceBuilder =
target.addService(handlerChainServiceName, service);
- handlerChainServiceBuilder.addDependency(configServiceName,
AbstractCommonConfig.class, service.getAbstractCommonConfig());
+ final Injector<UnifiedHandlerMetaData> injector =
service.getHandlersInjector();
+ for (ServiceName sn : PackageUtils.getServiceNameDependencies(context,
handlerChainServiceName, address, HANDLER)) {
+ handlerChainServiceBuilder.addDependency(sn,
UnifiedHandlerMetaData.class, injector);
+ }
ServiceController<?> controller =
handlerChainServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
newControllers.add(controller);
Added:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java
(rev 0)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -0,0 +1,38 @@
+package org.jboss.as.webservices.dmr;
+
+import java.util.List;
+
+import org.jboss.msc.inject.InjectionException;
+import org.jboss.msc.inject.Injector;
+import org.jboss.msc.inject.RetainingInjector;
+import org.jboss.msc.value.Value;
+
+public final class ListInjector<T> extends RetainingInjector<T> implements
Injector<T> {
+ private final List<T> list;
+
+ public ListInjector(final List<T> list) {
+ this.list = list;
+ }
+
+ /** {@inheritDoc} */
+ public void inject(final T value) throws InjectionException {
+ synchronized (list) {
+ if (value != null) {
+ list.add(value);
+ }
+ super.inject(value);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void uninject() {
+ synchronized (list) {
+ try {
+ final Value<T> storedValue = getStoredValue();
+ if (storedValue != null) list.remove(storedValue.getValue());
+ } finally {
+ super.uninject();
+ }
+ }
+ }
+}
\ No newline at end of file
Property changes on:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/PackageUtils.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/PackageUtils.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/PackageUtils.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -24,9 +24,15 @@
import static org.jboss.as.webservices.dmr.Constants.ENDPOINT_CONFIG;
import static org.jboss.as.webservices.dmr.Constants.HANDLER;
-import static org.jboss.as.webservices.dmr.Constants.HANDLER_CHAIN;
import static org.jboss.as.webservices.dmr.Constants.PROPERTY;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.jboss.as.controller.OperationContext;
+import org.jboss.as.controller.PathAddress;
+import org.jboss.as.controller.registry.Resource;
+import org.jboss.as.controller.registry.Resource.ResourceEntry;
import org.jboss.as.webservices.util.WSServices;
import org.jboss.msc.service.ServiceName;
@@ -52,14 +58,10 @@
return (ENDPOINT_CONFIG.equals(configType) ?
getEndpointConfigServiceName(configName) : getClientConfigServiceName(configName));
}
- static ServiceName getHandlerChainServiceName(final String configType, final String
configName, final String handlerChainId) {
- return getHandlerChainServiceName(getConfigServiceName(configType, configName),
handlerChainId);
+ static ServiceName getHandlerChainServiceName(final ServiceName configServiceName,
final String handlerChainType, final String handlerChainId) {
+ return configServiceName.append(handlerChainType).append(handlerChainId);
}
- static ServiceName getHandlerChainServiceName(final ServiceName configServiceName,
final String handlerChainId) {
- return configServiceName.append(HANDLER_CHAIN).append(handlerChainId);
- }
-
static ServiceName getHandlerServiceName(final ServiceName handlerChainServiceName,
final String handlerName) {
return handlerChainServiceName.append(HANDLER).append(handlerName);
}
@@ -68,4 +70,13 @@
return configServiceName.append(PROPERTY).append(propertyName);
}
+ static List<ServiceName> getServiceNameDependencies(final OperationContext
context, final ServiceName baseServiceName, final PathAddress address, final String
childType) {
+ final List<ServiceName> childrenServiceNames = new
LinkedList<ServiceName>();
+ final Resource resource = context.readResourceFromRoot(address);
+ final ServiceName sn = baseServiceName.append(childType);
+ for (ResourceEntry re : resource.getChildren(childType)) {
+ childrenServiceNames.add(sn.append(re.getName()));
+ }
+ return childrenServiceNames;
+ }
}
\ No newline at end of file
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/PropertyAdd.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/PropertyAdd.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/PropertyAdd.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -41,7 +41,6 @@
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceTarget;
-import org.jboss.wsf.spi.metadata.config.AbstractCommonConfig;
/**
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
@@ -74,7 +73,7 @@
final String configName = confElem.getValue();
final String propertyValue = operation.has(VALUE) ?
Attributes.VALUE.resolveModelAttribute(context,operation).asString() : null;
- final PropertyService<AbstractCommonConfig> service = new
PropertyService<AbstractCommonConfig>(propertyName, propertyValue);
+ final PropertyService service = new PropertyService(propertyName,
propertyValue);
final ServiceTarget target = context.getServiceTarget();
final ServiceName configServiceName = getConfigServiceName(configType,
configName);
if (context.getServiceRegistry(false).getService(configServiceName) == null)
{
@@ -83,7 +82,6 @@
final ServiceName propertyServiceName =
getPropertyServiceName(configServiceName, propertyName);
final ServiceBuilder<?> propertyServiceBuilder =
target.addService(propertyServiceName, service);
- propertyServiceBuilder.addDependency(configServiceName,
AbstractCommonConfig.class, service.getAbstractCommonConfig());
ServiceController<?> controller =
propertyServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
newControllers.add(controller);
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSExtension.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSExtension.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSExtension.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -29,11 +29,6 @@
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.PROPERTY;
-import static org.jboss.as.webservices.dmr.Constants.ENDPOINT_WSDL;
-import static org.jboss.as.webservices.dmr.Constants.ENDPOINT_CLASS;
-import static org.jboss.as.webservices.dmr.Constants.ENDPOINT_CONTEXT;
-import static org.jboss.as.webservices.dmr.Constants.ENDPOINT_TYPE;
-import static org.jboss.as.webservices.dmr.Constants.ENDPOINT_NAME;
import org.jboss.as.controller.Extension;
import org.jboss.as.controller.AttributeDefinition;
@@ -158,10 +153,10 @@
.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))
+ .addReadWriteAttribute(Attributes.WSDL_HOST, null, new
WSServerConfigAttributeHandler(Attributes.WSDL_HOST))
+ .addReadWriteAttribute(Attributes.WSDL_PORT, null, new
WSServerConfigAttributeHandler(Attributes.WSDL_PORT))
+ .addReadWriteAttribute(Attributes.WSDL_SECURE_PORT, null, new
WSServerConfigAttributeHandler(Attributes.WSDL_SECURE_PORT))
+ .addReadWriteAttribute(Attributes.MODIFY_WSDL_ADDRESS, null, new
WSServerConfigAttributeHandler(Attributes.MODIFY_WSDL_ADDRESS))
.build();
ManagementResourceRegistration subsystemRegistration =
subsystem.registerSubsystemModel(subsystemResource);
subsystemRegistration.registerSubModel(epConfigsDef);
Added:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSServerConfigAttributeHandler.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSServerConfigAttributeHandler.java
(rev 0)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSServerConfigAttributeHandler.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -0,0 +1,135 @@
+/*
+ * 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.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 java.net.UnknownHostException;
+
+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.config.DisabledOperationException;
+import org.jboss.as.webservices.config.ServerConfigImpl;
+import org.jboss.as.webservices.util.WSServices;
+import org.jboss.dmr.ModelNode;
+
+/**
+ * An AbstractWriteAttributeHandler extension for updating basic WS server config
attributes
+ *
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
+ */
+final class WSServerConfigAttributeHandler extends
AbstractWriteAttributeHandler<WSServerConfigAttributeHandler.RollbackInfo> {
+
+ public WSServerConfigAttributeHandler(final AttributeDefinition... definitions) {
+ super(definitions);
+ }
+
+ @Override
+ protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation,
String attributeName,
+ ModelNode resolvedValue, ModelNode currentValue,
HandbackHolder<WSServerConfigAttributeHandler.RollbackInfo> handbackHolder)
+ throws OperationFailedException {
+
+ //if the server is booting or the required value is the current one,
+ //we do not need to do anything and reload is not required
+ if (resolvedValue.equals(currentValue) || context.isBooting()) {
+ return false;
+ }
+
+ final String value = resolvedValue.isDefined() ? resolvedValue.asString() :
null;
+ boolean done = updateServerConfig(context, attributeName, value, false);
+ handbackHolder.setHandback(new RollbackInfo(done));
+ return !done; //reload required if runtime has not been updated
+ }
+
+ @Override
+ protected void revertUpdateToRuntime(OperationContext context, ModelNode operation,
String attributeName,
+ ModelNode valueToRestore, ModelNode valueToRevert,
WSServerConfigAttributeHandler.RollbackInfo handback) throws OperationFailedException {
+ if (handback != null && handback.isRuntimeUpdated()) { //nothing to do if
the runtime was not updated
+ final String value = valueToRestore.isDefined() ? valueToRestore.asString() :
null;
+ try {
+ updateServerConfig(context, attributeName, value, true);
+ } catch (DisabledOperationException e) { //revert rejected by WS stack
+ throw new OperationFailedException(e);
+ }
+ }
+ }
+
+ /**
+ * Returns true if the update operation succeeds in modifying the runtime, false
otherwise.
+ *
+ * @param context
+ * @param attributeName
+ * @param value
+ * @return
+ * @throws OperationFailedException
+ * @throws DisabledOperationException
+ */
+ private boolean updateServerConfig(OperationContext context, String attributeName,
String value, boolean isRevert) throws OperationFailedException,
DisabledOperationException {
+ ServerConfigImpl config =
(ServerConfigImpl)context.getServiceRegistry(false).getRequiredService(WSServices.CONFIG_SERVICE).getValue();
+ try {
+ if (MODIFY_WSDL_ADDRESS.equals(attributeName)) {
+ final boolean modifyWSDLAddress = value != null &&
Boolean.parseBoolean(value);
+ config.setModifySOAPAddress(modifyWSDLAddress, isRevert);
+ } else if (WSDL_HOST.equals(attributeName)) {
+ final String host = value != null ? value : null;
+ try {
+ config.setWebServiceHost(host, isRevert);
+ } catch (final UnknownHostException 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, isRevert);
+ } else if (WSDL_SECURE_PORT.equals(attributeName)) {
+ final int securePort = value != null ? Integer.parseInt(value) : -1;
+ config.setWebServiceSecurePort(securePort, isRevert);
+ } else {
+ throw new IllegalArgumentException(attributeName);
+ }
+ } catch (DisabledOperationException doe) {
+ // the WS stack rejected the runtime update
+ if (!isRevert) {
+ return false;
+ } else {
+ throw doe;
+ }
+ }
+ return true;
+ }
+
+ static class RollbackInfo {
+ private final boolean runtimeUpdated;
+
+ public RollbackInfo(boolean runtimeUpdated) {
+ this.runtimeUpdated = runtimeUpdated;
+ }
+
+ public boolean isRuntimeUpdated() {
+ return this.runtimeUpdated;
+ }
+ }
+}
Property changes on:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSServerConfigAttributeHandler.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -47,6 +47,7 @@
import org.jboss.as.web.host.CommonWebServer;
import org.jboss.as.webservices.config.ServerConfigImpl;
import org.jboss.as.webservices.service.ServerConfigService;
+import org.jboss.as.webservices.service.XTSClientIntegrationService;
import org.jboss.as.webservices.util.ModuleClassLoaderProvider;
import org.jboss.dmr.ModelNode;
import org.jboss.msc.service.ServiceController;
@@ -91,6 +92,7 @@
ServerConfigImpl serverConfig = createServerConfig(model, false, context);
newControllers.add(ServerConfigService.install(serviceTarget, serverConfig,
verificationHandler, getServerConfigDependencies(context, appclient), jmxAvailable));
}
+ newControllers.add(XTSClientIntegrationService.install(serviceTarget,
verificationHandler));
}
private static ServerConfigImpl createServerConfig(ModelNode configuration, boolean
appclient, OperationContext context) throws OperationFailedException {
@@ -133,24 +135,9 @@
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));
- }
- }
- }
-
private static boolean isJMXSubsystemAvailable(final OperationContext context) {
Resource root =
context.readResourceFromRoot(PathAddress.pathAddress(PathAddress.EMPTY_ADDRESS), false);
return root.hasChild(PathElement.pathElement(SUBSYSTEM,
JMXExtension.SUBSYSTEM_NAME));
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/injection/WSHandlerChainAnnotationProcessor.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/injection/WSHandlerChainAnnotationProcessor.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/injection/WSHandlerChainAnnotationProcessor.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -23,8 +23,6 @@
package org.jboss.as.webservices.injection;
import static org.jboss.as.server.deployment.Attachments.ANNOTATION_INDEX;
-import static org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT;
-import static org.jboss.as.server.deployment.Attachments.RESOURCE_ROOTS;
import static org.jboss.as.webservices.WSMessages.MESSAGES;
import static org.jboss.as.webservices.util.ASHelper.isJaxwsService;
import static org.jboss.as.webservices.util.DotNames.HANDLER_CHAIN_ANNOTATION;
@@ -44,14 +42,13 @@
import org.jboss.as.ee.structure.DeploymentType;
import org.jboss.as.ee.structure.DeploymentTypeMarker;
-import org.jboss.as.server.deployment.AttachmentList;
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.server.deployment.EjbDeploymentMarker;
import org.jboss.as.server.deployment.module.ResourceRoot;
import org.jboss.as.webservices.WSLogger;
+import org.jboss.as.webservices.util.ASHelper;
import org.jboss.jandex.AnnotationInstance;
import org.jboss.jandex.AnnotationTarget;
import org.jboss.jandex.ClassInfo;
@@ -73,14 +70,7 @@
if (DeploymentTypeMarker.isType(DeploymentType.EAR, unit)) {
return;
}
- // wars define resource roots
- AttachmentList<ResourceRoot> resourceRoots =
unit.getAttachment(RESOURCE_ROOTS);
- if (!unit.getName().endsWith(".war") &&
EjbDeploymentMarker.isEjbDeployment(unit)) {
- // ejb archives don't define resource roots, using root resource
- resourceRoots = new AttachmentList<ResourceRoot>(ResourceRoot.class);
- final ResourceRoot root = unit.getAttachment(DEPLOYMENT_ROOT);
- resourceRoots.add(root);
- }
+ List<ResourceRoot> resourceRoots = ASHelper.getResourceRoots(unit);
if (resourceRoots == null) {
return;
}
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -21,6 +21,13 @@
*/
package org.jboss.as.webservices.service;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.as.webservices.dmr.ListInjector;
+import org.jboss.msc.inject.Injector;
import org.jboss.msc.service.Service;
import org.jboss.msc.service.StartContext;
import org.jboss.msc.service.StartException;
@@ -29,6 +36,7 @@
import org.jboss.wsf.spi.metadata.config.AbstractCommonConfig;
import org.jboss.wsf.spi.metadata.config.ClientConfig;
import org.jboss.wsf.spi.metadata.config.EndpointConfig;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
/**
* A service for setting a ws client / endpoint config.
@@ -41,6 +49,9 @@
private final ServerConfig serverConfig;
private final String configName;
private final boolean client;
+ private final List<UnifiedHandlerChainMetaData> preHandlerChains = new
ArrayList<UnifiedHandlerChainMetaData>(1);
+ private final List<UnifiedHandlerChainMetaData> postHandlerChains = new
ArrayList<UnifiedHandlerChainMetaData>(1);
+ private final List<PropertyService> properties = new
ArrayList<PropertyService>(1);
private volatile AbstractCommonConfig config;
public ConfigService(ServerConfig serverConfig, String configName, boolean client) {
@@ -56,15 +67,20 @@
@Override
public void start(final StartContext context) throws StartException {
+ Map<String, String> props = null;
+ if (!properties.isEmpty()) {
+ props = new HashMap<String, String>(properties.size(), 1);
+ for (PropertyService ps : properties) {
+ props.put(ps.getPropName(), ps.getPropValue());
+ }
+ }
if (client) {
- ClientConfig clientConfig = new ClientConfig();
- clientConfig.setConfigName(configName);
- serverConfig.addClientConfig(clientConfig);
+ ClientConfig clientConfig = new ClientConfig(configName, preHandlerChains,
postHandlerChains, props, null);
+ serverConfig.registerClientConfig(clientConfig);
config = clientConfig;
} else {
- EndpointConfig endpointConfig = new EndpointConfig();
- endpointConfig.setConfigName(configName);
- serverConfig.addEndpointConfig(endpointConfig);
+ EndpointConfig endpointConfig = new EndpointConfig(configName,
preHandlerChains, postHandlerChains, props, null);
+ serverConfig.registerEndpointConfig(endpointConfig);
config = endpointConfig;
}
}
@@ -72,9 +88,22 @@
@Override
public void stop(final StopContext context) {
if (client) {
- serverConfig.getClientConfigs().remove(config);
+ serverConfig.unregisterClientConfig((ClientConfig)config);
} else {
- serverConfig.getEndpointConfigs().remove(config);
+ serverConfig.unregisterEndpointConfig((EndpointConfig)config);
}
}
+
+ public Injector<UnifiedHandlerChainMetaData> getPreHandlerChainsInjector() {
+ return new ListInjector<UnifiedHandlerChainMetaData>(preHandlerChains);
+ }
+
+ public Injector<UnifiedHandlerChainMetaData> getPostHandlerChainsInjector() {
+ return new ListInjector<UnifiedHandlerChainMetaData>(postHandlerChains);
+ }
+
+ public Injector<PropertyService> getPropertiesInjector() {
+ return new ListInjector<PropertyService>(properties);
+ }
+
}
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -23,32 +23,35 @@
import static org.jboss.as.webservices.WSMessages.MESSAGES;
+import java.util.ArrayList;
import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
+import org.jboss.as.webservices.dmr.ListInjector;
+import org.jboss.msc.inject.Injector;
import org.jboss.msc.service.Service;
import org.jboss.msc.service.StartContext;
import org.jboss.msc.service.StartException;
import org.jboss.msc.service.StopContext;
-import org.jboss.msc.value.InjectedValue;
-import org.jboss.wsf.spi.metadata.config.AbstractCommonConfig;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
/**
- * A service for setting a handler chain into an endpoint / client config.
+ * A service for creating handler chain metadata.
*
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
*/
-public final class HandlerChainService<T extends AbstractCommonConfig> implements
Service<UnifiedHandlerChainMetaData> {
+public final class HandlerChainService implements
Service<UnifiedHandlerChainMetaData> {
- private InjectedValue<T> abstractCommonConfig = new InjectedValue<T>();
- private final String handlerChainType;
+ private final List<UnifiedHandlerMetaData> handlers = new
ArrayList<UnifiedHandlerMetaData>(2);
private final String handlerChainId;
private final String protocolBindings;
private volatile UnifiedHandlerChainMetaData handlerChain;
public HandlerChainService(String handlerChainType, String handlerChainId, String
protocolBindings) {
- this.handlerChainType = handlerChainType;
+ if (!handlerChainType.equalsIgnoreCase("pre-handler-chain") &&
!handlerChainType.equals("post-handler-chain")) {
+ throw new RuntimeException(
+ MESSAGES.wrongHandlerChainType(handlerChainType,
"pre-handler-chain", "post-handler-chain"));
+ }
this.handlerChainId = handlerChainId;
this.protocolBindings = protocolBindings;
}
@@ -60,63 +63,15 @@
@Override
public void start(final StartContext context) throws StartException {
- final AbstractCommonConfig commonConfig = abstractCommonConfig.getValue();
- List<UnifiedHandlerChainMetaData> handlerChains;
- if ("pre-handler-chain".equals(handlerChainType)) {
- synchronized (commonConfig) { //JBWS-3707
- handlerChains = commonConfig.getPreHandlerChains();
- if (handlerChains == null) {
- handlerChains = new
CopyOnWriteArrayList<UnifiedHandlerChainMetaData>();
- commonConfig.setPreHandlerChains(handlerChains);
- }
- }
- } else if ("post-handler-chain".equals(handlerChainType)) {
- synchronized (commonConfig) { //JBWS-3707
- handlerChains = commonConfig.getPostHandlerChains();
- if (handlerChains == null) {
- handlerChains = new
CopyOnWriteArrayList<UnifiedHandlerChainMetaData>();
- commonConfig.setPostHandlerChains(handlerChains);
- }
- }
- } else {
- throw new StartException(
- MESSAGES.wrongHandlerChainType(handlerChainType,
"pre-handler-chain", "post-handler-chain"));
- }
- handlerChain = getChain(handlerChains, handlerChainId);
- if (handlerChain != null) {
- throw new
StartException(MESSAGES.multipleHandlerChainsWithSameId(handlerChainType, handlerChainId,
- commonConfig.getConfigName()));
- }
- handlerChain = new UnifiedHandlerChainMetaData();
- handlerChain.setId(handlerChainId);
- handlerChain.setProtocolBindings(protocolBindings);
- handlerChains.add(handlerChain);
+ handlerChain = new UnifiedHandlerChainMetaData(null, null, protocolBindings,
handlers, false, handlerChainId);
}
- private static UnifiedHandlerChainMetaData getChain(final
List<UnifiedHandlerChainMetaData> handlerChains,
- final String handlerChainId) {
- for (final UnifiedHandlerChainMetaData handlerChain : handlerChains) {
- if (handlerChainId.equals(handlerChain.getId())) {
- return handlerChain;
- }
- }
- return null;
- }
-
@Override
public void stop(final StopContext context) {
- final AbstractCommonConfig commonConfig = abstractCommonConfig.getValue();
-
- final List<UnifiedHandlerChainMetaData> handlerChains;
- if ("pre-handler-chain".equals(handlerChainType)) {
- handlerChains = commonConfig.getPreHandlerChains();
- } else {
- handlerChains = commonConfig.getPostHandlerChains();
- }
- handlerChains.remove(handlerChain);
+ handlerChain = null;
}
- public InjectedValue<T> getAbstractCommonConfig() {
- return abstractCommonConfig;
+ public Injector<UnifiedHandlerMetaData> getHandlersInjector() {
+ return new ListInjector<UnifiedHandlerMetaData>(handlers);
}
}
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -25,18 +25,15 @@
import org.jboss.msc.service.StartContext;
import org.jboss.msc.service.StartException;
import org.jboss.msc.service.StopContext;
-import org.jboss.msc.value.InjectedValue;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
/**
- * A service for setting a handler into the handler-chain of an endpoint / client
config.
+ * A service for creating handler metadata.
*
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
*/
public final class HandlerService implements Service<UnifiedHandlerMetaData> {
- private InjectedValue<UnifiedHandlerChainMetaData> handlerChain = new
InjectedValue<UnifiedHandlerChainMetaData>();
private final String handlerName;
private final String handlerClass;
private volatile UnifiedHandlerMetaData handler;
@@ -53,24 +50,11 @@
@Override
public void start(final StartContext context) throws StartException {
- final UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData();
- handler.setHandlerName(handlerName);
- handler.setHandlerClass(handlerClass);
- final UnifiedHandlerChainMetaData chain = handlerChain.getValue();
- synchronized (chain) { //JBWS-3707
- chain.addHandler(handler);
- }
+ handler = new UnifiedHandlerMetaData(handlerClass, handlerName, null, null, null,
null);
}
@Override
public void stop(final StopContext context) {
- final UnifiedHandlerChainMetaData chain = handlerChain.getValue();
- synchronized (chain) { //JBWS-3707
- chain.getHandlers().remove(handler);
- }
+ handler = null;
}
-
- public InjectedValue<UnifiedHandlerChainMetaData> getHandlerChain() {
- return handlerChain;
- }
}
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/PropertyService.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/PropertyService.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/PropertyService.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -25,19 +25,16 @@
import org.jboss.msc.service.StartContext;
import org.jboss.msc.service.StartException;
import org.jboss.msc.service.StopContext;
-import org.jboss.msc.value.InjectedValue;
-import org.jboss.wsf.spi.metadata.config.AbstractCommonConfig;
/**
- * A service for setting a property into an endpoint / client config.
+ * A service for getting a property to be stored in endpoint / client config.
*
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
*/
-public final class PropertyService<T extends AbstractCommonConfig> implements
Service<String> {
+public final class PropertyService implements Service<PropertyService> {
- private InjectedValue<T> abstractCommonConfig = new InjectedValue<T>();
- private final String propValue;
private final String propName;
+ private final String propValue;
public PropertyService(String propName, String propValue) {
this.propValue = propValue;
@@ -45,29 +42,26 @@
}
@Override
- public String getValue() {
+ public PropertyService getValue() {
+ return this;
+ }
+
+ public String getPropName() {
+ return propName;
+ }
+
+ public String getPropValue() {
return propValue;
}
@Override
public void start(final StartContext context) throws StartException {
- final AbstractCommonConfig commonConfig = abstractCommonConfig.getValue();
- synchronized (commonConfig) { //JBWS-3707
- commonConfig.setProperty(propName, propValue);
- }
+ //NOOP
}
@Override
public void stop(final StopContext context) {
- final AbstractCommonConfig commonConfig = abstractCommonConfig.getValue();
- synchronized (commonConfig) { //JBWS-3707
- if (commonConfig.getProperties().containsKey(propName)) {
- commonConfig.getProperties().remove(propName);
- }
- }
+ //NOOP
}
- public InjectedValue<T> getAbstractCommonConfig() {
- return abstractCommonConfig;
- }
}
Added:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/XTSClientIntegrationService.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/XTSClientIntegrationService.java
(rev 0)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/XTSClientIntegrationService.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -0,0 +1,93 @@
+/*
+ * 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 java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.as.webservices.config.ServerConfigImpl;
+import org.jboss.as.webservices.dmr.ListInjector;
+import org.jboss.as.webservices.util.WSServices;
+import org.jboss.msc.inject.Injector;
+import org.jboss.msc.service.Service;
+import org.jboss.msc.service.ServiceBuilder;
+import org.jboss.msc.service.ServiceController;
+import org.jboss.msc.service.ServiceListener;
+import org.jboss.msc.service.ServiceName;
+import org.jboss.msc.service.ServiceTarget;
+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.management.ServerConfig;
+import org.jboss.wsf.spi.metadata.config.ClientConfig;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+
+/**
+ * A service for triggering the XTS client config integration
+ *
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
+ */
+public final class XTSClientIntegrationService implements Service<Void> {
+
+ private final InjectedValue<ServerConfig> serverConfig = new
InjectedValue<ServerConfig>();
+ private final List<UnifiedHandlerChainMetaData> postHandlerChains = new
ArrayList<UnifiedHandlerChainMetaData>(1);
+
+ private XTSClientIntegrationService() {
+ //NOOP
+ }
+
+ @Override
+ public void start(final StartContext context) throws StartException {
+ ClientConfig wrapper = new ClientConfig(null, null, postHandlerChains, null,
null);
+ ((ServerConfigImpl)(serverConfig.getValue())).setClientConfigWrapper(wrapper,
true);
+ }
+
+ @Override
+ public void stop(final StopContext context) {
+ ((ServerConfigImpl)(serverConfig.getValue())).setClientConfigWrapper(null,
false);
+ }
+
+ public Injector<UnifiedHandlerChainMetaData> getPostHandlerChainsInjector() {
+ return new ListInjector<UnifiedHandlerChainMetaData>(postHandlerChains);
+ }
+
+ public Injector<ServerConfig> getServerConfigInjector() {
+ return serverConfig;
+ }
+
+ public static ServiceController<?> install(final ServiceTarget serviceTarget,
final ServiceListener<Object> listeners) {
+ final XTSClientIntegrationService service = new XTSClientIntegrationService();
+ final ServiceBuilder<?> builder =
serviceTarget.addService(WSServices.XTS_CLIENT_INTEGRATION_SERVICE, service);
+
builder.addDependency(ServiceName.JBOSS.append("xts").append("handlers"),
UnifiedHandlerChainMetaData.class, service.getPostHandlerChainsInjector());
+ builder.addDependency(WSServices.CONFIG_SERVICE, ServerConfig.class,
service.getServerConfigInjector());
+ builder.addListener(listeners);
+ //set passive initial mode, as this has to start only *if* the XTS service above
is actually installed and started
+ return builder.setInitialMode(ServiceController.Mode.PASSIVE).install();
+ }
+
+ @Override
+ public Void getValue() {
+ return null;
+ }
+
+}
Property changes on:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/service/XTSClientIntegrationService.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -21,6 +21,8 @@
*/
package org.jboss.as.webservices.util;
+import static org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT;
+import static org.jboss.as.server.deployment.Attachments.RESOURCE_ROOTS;
import static org.jboss.as.webservices.WSLogger.ROOT_LOGGER;
import static org.jboss.as.webservices.util.DotNames.JAXWS_SERVICE_CLASS;
import static org.jboss.as.webservices.util.DotNames.WEB_SERVICE_ANNOTATION;
@@ -39,9 +41,12 @@
import org.jboss.as.ee.metadata.ClassAnnotationInformation;
import org.jboss.as.server.CurrentServiceContainer;
import org.jboss.as.server.deployment.AttachmentKey;
+import org.jboss.as.server.deployment.AttachmentList;
import org.jboss.as.server.deployment.Attachments;
import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.EjbDeploymentMarker;
import org.jboss.as.server.deployment.annotation.CompositeIndex;
+import org.jboss.as.server.deployment.module.ResourceRoot;
import org.jboss.as.web.common.WarMetaData;
import org.jboss.as.webservices.deployers.WebServiceAnnotationInfo;
import org.jboss.as.webservices.deployers.WebServiceProviderAnnotationInfo;
@@ -344,4 +349,16 @@
}
return refRegistry;
}
+
+ public static List<ResourceRoot> getResourceRoots(DeploymentUnit unit) {
+ // wars define resource roots
+ AttachmentList<ResourceRoot> resourceRoots =
unit.getAttachment(RESOURCE_ROOTS);
+ if (!unit.getName().endsWith(".war") &&
EjbDeploymentMarker.isEjbDeployment(unit)) {
+ // ejb archives don't define resource roots, using root resource
+ resourceRoots = new AttachmentList<ResourceRoot>(ResourceRoot.class);
+ final ResourceRoot root = unit.getAttachment(DEPLOYMENT_ROOT);
+ resourceRoots.add(root);
+ }
+ return resourceRoots;
+ }
}
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/WSServices.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/WSServices.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/WSServices.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -41,6 +41,7 @@
public static final ServiceName ENDPOINT_SERVICE =
WS_SERVICE.append("endpoint");
public static final ServiceName ENDPOINT_DEPLOY_SERVICE =
WS_SERVICE.append("endpoint-deploy");
public static final ServiceName ENDPOINT_PUBLISH_SERVICE =
WS_SERVICE.append("endpoint-publish");
+ public static final ServiceName XTS_CLIENT_INTEGRATION_SERVICE =
WS_SERVICE.append("xts-integration");
private WSServices() {
// forbidden inheritance
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -32,7 +32,10 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
import java.util.List;
+import java.util.Set;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
@@ -71,9 +74,6 @@
private WSRefUtils() {
}
-
-
-
static UnifiedServiceRefMetaData translate(final ServiceReferenceMetaData
serviceRefMD, final UnifiedServiceRefMetaData serviceRefUMDM) {
serviceRefUMDM.setServiceRefName(serviceRefMD.getName());
serviceRefUMDM.setServiceRefType(serviceRefMD.getServiceRefType());
@@ -181,66 +181,41 @@
final List<StubPropertyMetaData> stubPropertiesMD =
jbossPortComponentMD.getStubProperties();
if (stubPropertiesMD != null) {
for (final StubPropertyMetaData stubPropertyMD : stubPropertiesMD) {
- final UnifiedStubPropertyMetaData stubPropertyUMDM = new
UnifiedStubPropertyMetaData();
- stubPropertyUMDM.setPropName(stubPropertyMD.getPropName());
- stubPropertyUMDM.setPropValue(stubPropertyMD.getPropValue());
- portComponentUMDM.addStubProperty(stubPropertyUMDM);
+ portComponentUMDM.addStubProperty(new
UnifiedStubPropertyMetaData(stubPropertyMD.getPropName(),
stubPropertyMD.getPropValue()));
}
}
}
private static UnifiedHandlerMetaData
getUnifiedHandlerMetaData(ServiceReferenceHandlerMetaData srhmd) {
- UnifiedHandlerMetaData handlerUMDM = new UnifiedHandlerMetaData();
- handlerUMDM.setHandlerName(srhmd.getHandlerName());
- handlerUMDM.setHandlerClass(srhmd.getHandlerClass());
+ List<UnifiedInitParamMetaData> unifiedInitParamMDs = new
LinkedList<UnifiedInitParamMetaData>();
List<ParamValueMetaData> initParams = srhmd.getInitParam();
if (initParams != null) {
for (ParamValueMetaData initParam : initParams) {
- UnifiedInitParamMetaData param = new UnifiedInitParamMetaData();
- param.setParamName(initParam.getParamName());
- param.setParamValue(initParam.getParamValue());
- handlerUMDM.addInitParam(param);
+ unifiedInitParamMDs.add(new
UnifiedInitParamMetaData(initParam.getParamName(), initParam.getParamValue()));
}
}
List<QName> soapHeaders = srhmd.getSoapHeader();
- if (soapHeaders != null) {
- for (QName soapHeader : soapHeaders) {
- handlerUMDM.addSoapHeader(soapHeader);
- }
- }
+ Set<QName> soapHeaderList = soapHeaders != null ? new
HashSet<QName>(soapHeaders) : null;
List<String> soapRoles = srhmd.getSoapRole();
- if (soapRoles != null) {
- for (String soapRole : soapRoles) {
- handlerUMDM.addSoapRole(soapRole);
- }
- }
+ Set<String> soapRolesList = soapRoles != null ? new
HashSet<String>(soapRoles) : null;
List<String> portNames = srhmd.getPortName();
- if (portNames != null) {
- for (String portName : portNames) {
- handlerUMDM.addPortName(portName);
- }
- }
- return handlerUMDM;
+ Set<String> portNameList = portNames != null ? new
HashSet<String>(portNames) : null;
+ return new UnifiedHandlerMetaData(srhmd.getHandlerClass(),
srhmd.getHandlerName(), unifiedInitParamMDs, soapHeaderList, soapRolesList,
portNameList);
}
private static UnifiedHandlerChainsMetaData getUnifiedHandlerChainsMetaData(final
ServiceReferenceHandlerChainsMetaData handlerChainsMD) {
- final UnifiedHandlerChainsMetaData handlerChainsUMDM = new
UnifiedHandlerChainsMetaData();
-
+ List<UnifiedHandlerChainMetaData> uhcmds = new
LinkedList<UnifiedHandlerChainMetaData>();
for (final ServiceReferenceHandlerChainMetaData handlerChainMD :
handlerChainsMD.getHandlers()) {
- final UnifiedHandlerChainMetaData handlerChainUMDM = new
UnifiedHandlerChainMetaData();
-
handlerChainUMDM.setServiceNamePattern(handlerChainMD.getServiceNamePattern());
- handlerChainUMDM.setPortNamePattern(handlerChainMD.getPortNamePattern());
- handlerChainUMDM.setProtocolBindings(handlerChainMD.getProtocolBindings());
-
+ List<UnifiedHandlerMetaData> uhmds = new
LinkedList<UnifiedHandlerMetaData>();
for (final ServiceReferenceHandlerMetaData handlerMD :
handlerChainMD.getHandler()) {
final UnifiedHandlerMetaData handlerUMDM =
getUnifiedHandlerMetaData(handlerMD);
- handlerChainUMDM.addHandler(handlerUMDM);
+ uhmds.add(handlerUMDM);
}
-
- handlerChainsUMDM.addHandlerChain(handlerChainUMDM);
+ uhcmds.add(new
UnifiedHandlerChainMetaData(handlerChainMD.getServiceNamePattern(),
handlerChainMD.getPortNamePattern(),
+ handlerChainMD.getProtocolBindings(), uhmds, false, null));
}
- return handlerChainsUMDM;
+ return new UnifiedHandlerChainsMetaData(uhcmds);
}
static void processAnnotatedElement(final AnnotatedElement anElement, final
UnifiedServiceRefMetaData serviceRefUMDM) {
Added:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/test/java/org/jboss/as/webservices/config/ServerConfigImplTestCase.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/test/java/org/jboss/as/webservices/config/ServerConfigImplTestCase.java
(rev 0)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/test/java/org/jboss/as/webservices/config/ServerConfigImplTestCase.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -0,0 +1,227 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.as.webservices.config;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import javax.management.MBeanServer;
+
+import org.jboss.msc.value.ImmediateValue;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.StackConfig;
+import org.jboss.wsf.spi.management.StackConfigFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ *
+ * @author <a href="mailto:alessio.soldano@jboss.com>Alessio
Soldano</a>
+ */
+public class ServerConfigImplTestCase {
+
+ private static ClassLoader origTCCL;
+
+ public ServerConfigImplTestCase() {
+ }
+
+ @Test
+ public void testIsModifiable() throws Exception {
+ ServerConfigImpl sc = newServerConfigImpl();
+ sc.create();
+ assertTrue(sc.isModifiable());
+ sc.incrementWSDeploymentCount();
+ assertFalse(sc.isModifiable());
+ sc.decrementWSDeploymentCount();
+ assertTrue(sc.isModifiable());
+ sc.incrementWSDeploymentCount();
+ sc.incrementWSDeploymentCount();
+ assertFalse(sc.isModifiable());
+ sc.create();
+ assertTrue(sc.isModifiable());
+ }
+
+ @Test
+ public void testSingleAttributeUpdate() throws Exception {
+ internalTestSingleAttributeUpdate(new Callback() {
+ @Override
+ public void setAttribute(ServerConfig sc) throws Exception {
+ sc.setModifySOAPAddress(true);
+ }
+ });
+ internalTestSingleAttributeUpdate(new Callback() {
+ @Override
+ public void setAttribute(ServerConfig sc) throws Exception {
+ sc.setWebServiceHost("foo");
+ }
+ });
+ internalTestSingleAttributeUpdate(new Callback() {
+ @Override
+ public void setAttribute(ServerConfig sc) throws Exception {
+ sc.setWebServicePort(976);
+ }
+ });
+ internalTestSingleAttributeUpdate(new Callback() {
+ @Override
+ public void setAttribute(ServerConfig sc) throws Exception {
+ sc.setWebServiceSecurePort(5435);
+ }
+ });
+ }
+
+ @Test
+ public void testMultipleAttributesUpdate() throws Exception {
+ Callback cbA = new Callback() {
+ @Override
+ public void setAttribute(ServerConfig sc) throws Exception {
+ sc.setModifySOAPAddress(true);
+ }
+ };
+ Callback cbB = new Callback() {
+ @Override
+ public void setAttribute(ServerConfig sc) throws Exception {
+ sc.setWebServiceHost("foo");
+ }
+ };
+ Callback cbC = new Callback() {
+ @Override
+ public void setAttribute(ServerConfig sc) throws Exception {
+ sc.setWebServicePort(976);
+ }
+ };
+ Callback cbD = new Callback() {
+ @Override
+ public void setAttribute(ServerConfig sc) throws Exception {
+ sc.setWebServiceSecurePort(5435);
+ }
+ };
+ internalTestMultipleAttributeUpdate(cbA, new Callback[]{cbB, cbC, cbD});
+ internalTestMultipleAttributeUpdate(cbB, new Callback[]{cbA, cbC, cbD});
+ internalTestMultipleAttributeUpdate(cbC, new Callback[]{cbA, cbB, cbD});
+ internalTestMultipleAttributeUpdate(cbD, new Callback[]{cbA, cbB, cbC});
+ }
+
+ protected void internalTestSingleAttributeUpdate(Callback cb) throws Exception {
+ ServerConfigImpl sc = newServerConfigImpl();
+ sc.create();
+ assertTrue(sc.isModifiable());
+ cb.setAttribute(sc);
+ sc.incrementWSDeploymentCount();
+ assertFalse(sc.isModifiable());
+ try {
+ cb.setAttribute(sc);
+ fail();
+ } catch (DisabledOperationException e) {
+ //check the error message says the operation can't be done because
there's an active deployment
+ assertTrue("Expected JBAS015616 message, but got " +
e.getMessage(), e.getMessage().contains("JBAS015616"));
+ }
+ sc.decrementWSDeploymentCount();
+ assertTrue(sc.isModifiable());
+ try {
+ cb.setAttribute(sc);
+ fail();
+ } catch (DisabledOperationException e) {
+ //check the error message says the operation can't be done because of
pending former model update(s) requiring reload
+ assertTrue("Expected JBAS015615 message, but got " +
e.getMessage(), e.getMessage().contains("JBAS015615"));
+ }
+ sc.create();
+ assertTrue(sc.isModifiable());
+ cb.setAttribute(sc);
+ }
+
+ protected void internalTestMultipleAttributeUpdate(Callback cb1, Callback[] otherCbs)
throws Exception {
+ ServerConfigImpl sc = newServerConfigImpl();
+ sc.create();
+ assertTrue(sc.isModifiable());
+ cb1.setAttribute(sc);
+ sc.incrementWSDeploymentCount();
+ assertFalse(sc.isModifiable());
+ try {
+ cb1.setAttribute(sc);
+ fail();
+ } catch (DisabledOperationException e) {
+ //check the error message says the operation can't be done because
there's an active deployment
+ assertTrue("Expected JBAS015616 message, but got " +
e.getMessage(), e.getMessage().contains("JBAS015616"));
+ }
+ sc.decrementWSDeploymentCount();
+ assertTrue(sc.isModifiable());
+ try {
+ cb1.setAttribute(sc);
+ fail();
+ } catch (DisabledOperationException e) {
+ //check the error message says the operation can't be done because of
pending former model update(s) requiring reload
+ assertTrue("Expected JBAS015615 message, but got " +
e.getMessage(), e.getMessage().contains("JBAS015615"));
+ }
+ //other attributes are still modified properly as they're still in synch
+ for (Callback cb : otherCbs) {
+ cb.setAttribute(sc);
+ }
+ }
+
+ private static ServerConfigImpl newServerConfigImpl() {
+ ServerConfigImpl sc = ServerConfigImpl.newInstance();
+ sc.getMBeanServerInjector().setValue(new
ImmediateValue<MBeanServer>(null));
+ return sc;
+ }
+
+ @BeforeClass
+ public static void setStackConfigFactory() throws Exception {
+ URL url = ServerConfigImplTestCase.class.getResource("util/");
+ origTCCL = Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(new URLClassLoader(new URL[]
{url}));
+ }
+
+ @AfterClass
+ public static void restoreStackConfigFactory() {
+ Thread.currentThread().setContextClassLoader(origTCCL);
+ origTCCL = null;
+ }
+
+ public static interface Callback {
+ public void setAttribute(ServerConfig sc) throws Exception;
+ }
+
+ public static class TestStackConfigFactory extends StackConfigFactory {
+ @Override
+ public StackConfig getStackConfig() {
+ return new TestStackConfig();
+ }
+ }
+
+ public static class TestStackConfig implements StackConfig {
+ @Override
+ public String getImplementationTitle() {
+ return null;
+ }
+
+ @Override
+ public String getImplementationVersion() {
+ return null;
+ }
+ }
+}
Property changes on:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/test/java/org/jboss/as/webservices/config/ServerConfigImplTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/test/resources/org/jboss/as/webservices/config/util/META-INF/services/org.jboss.wsf.spi.management.StackConfigFactory
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/test/resources/org/jboss/as/webservices/config/util/META-INF/services/org.jboss.wsf.spi.management.StackConfigFactory
(rev 0)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/test/resources/org/jboss/as/webservices/config/util/META-INF/services/org.jboss.wsf.spi.management.StackConfigFactory 2014-05-14
14:39:59 UTC (rev 18648)
@@ -0,0 +1 @@
+org.jboss.as.webservices.config.ServerConfigImplTestCase$TestStackConfigFactory
\ No newline at end of file
Modified:
container/wildfly81/branches/jbossws-wildfly810/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java 2014-05-14
14:00:52 UTC (rev 18647)
+++
container/wildfly81/branches/jbossws-wildfly810/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java 2014-05-14
14:39:59 UTC (rev 18648)
@@ -81,7 +81,11 @@
import static org.jboss.as.security.Constants.CLASSIC;
import static org.jboss.as.security.Constants.CODE;
import static org.jboss.as.security.Constants.FLAG;
+import static org.jboss.as.security.Constants.AUTH_MODULE;
+import static org.jboss.as.security.Constants.JASPI;
import static org.jboss.as.security.Constants.LOGIN_MODULE;
+import static org.jboss.as.security.Constants.LOGIN_MODULE_STACK;
+import static org.jboss.as.security.Constants.LOGIN_MODULE_STACK_REF;
import static org.jboss.as.security.Constants.MODULE_OPTIONS;
import static org.jboss.as.security.Constants.SECURITY_DOMAIN;
@@ -90,6 +94,7 @@
*
* @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:ema@redhat.com">Jim Ma</a>
*/
public final class RemoteDeployer implements Deployer {
@@ -256,6 +261,67 @@
}
}
+ public void addJaspiSecurityDomain(String name, String loginModuleStackName,
Map<String, String> loginModuleOptions,
+ String authModuleName, Map<String, String> authModuleOptions) throws
Exception {
+ synchronized (securityDomainUsers) {
+ if (securityDomainUsers.containsKey(name)) {
+ int count = securityDomainUsers.get(name);
+ securityDomainUsers.put(name, (count + 1));
+ return;
+ } else {
+ securityDomainUsers.put(name, 1);
+ }
+
+ final List<ModelNode> updates = new ArrayList<ModelNode>();
+
+ final ModelNode compositeOp = new ModelNode();
+ compositeOp.get(OP).set(COMPOSITE);
+ compositeOp.get(OP_ADDR).setEmptyList();
+ compositeOp.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true);
+
+ ModelNode steps = compositeOp.get(STEPS);
+ PathAddress address = PathAddress.pathAddress().append(SUBSYSTEM,
"security").append(SECURITY_DOMAIN, name);
+ steps.add(Util.createAddOperation(address));
+
+ PathAddress parentAddress = address.append(AUTHENTICATION, JASPI);
+ steps.add(Util.createAddOperation(parentAddress));
+
+ // step 3
+ PathAddress loignStackAddress = parentAddress.append(LOGIN_MODULE_STACK,
loginModuleStackName);
+ ModelNode loginStack = Util.createAddOperation(loignStackAddress);
+ steps.add(loginStack);
+
+ // step 4
+ ModelNode loginModule =
Util.createAddOperation(loignStackAddress.append(LOGIN_MODULE, "UsersRoles"));
+ loginModule.get(CODE).set("UsersRoles");
+ loginModule.get(FLAG).set(REQUIRED);
+
loginModule.get(OPERATION_HEADERS).get(ALLOW_RESOURCE_SERVICE_RESTART).set(true);
+ final ModelNode moduleOptions = loginModule.get(MODULE_OPTIONS);
+ if (loginModuleOptions != null) {
+ for (final String k : loginModuleOptions.keySet()) {
+ moduleOptions.add(k, loginModuleOptions.get(k));
+ }
+ }
+ steps.add(loginModule);
+
+ PathAddress authModule = parentAddress.append(AUTH_MODULE, authModuleName);
+ ModelNode authModuleNode = Util.createAddOperation(authModule);
+ authModuleNode.get(LOGIN_MODULE_STACK_REF).set(loginModuleStackName);
+ authModuleNode.get(CODE).set(authModuleName);
+ ModelNode options = authModuleNode.get(MODULE_OPTIONS);
+ if (authModuleOptions != null) {
+ for (final String k : authModuleOptions.keySet()) {
+ options.add(k, authModuleOptions.get(k));
+ }
+ }
+ steps.add(authModuleNode);
+
+ updates.add(compositeOp);
+
+ applyUpdates(updates);
+ }
+ }
+
@Override
public void removeSecurityDomain(String name) throws Exception {
synchronized (securityDomainUsers) {