Author: asoldano
Date: 2015-01-21 09:05:16 -0500 (Wed, 21 Jan 2015)
New Revision: 19406
Added:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/test/java/org/jboss/as/webservices/dmr/WebservicesSubsystemRuntimeTestCase.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/test/resources/org/jboss/as/webservices/dmr/ws-subsystem12-rt.xml
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/WSMessages.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/AspectDeploymentProcessor.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/EndpointServiceDeploymentAspect.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSClassVerificationProcessor.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSComponentInstanceAssociationInterceptor.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_EJB.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_POJO.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WebContextAnnotationInfo.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WebContextAnnotationInformationFactory.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WebServiceAnnotationProcessor.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_EJB.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_POJO.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigAdd.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainAdd.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSDeploymentActivator.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/injection/InjectionDeploymentAspect.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderEJB.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderPOJO.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/metadata/MetaDataBuilderJAXWS_EJB.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/metadata/model/EJBEndpoint.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/publish/EndpointPublisherImpl.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/AbstractSecurityMetaDataAccessorEJB.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/SecurityMetaDataAccessorEJB.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/ServletDelegateFactoryImpl.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataModifier.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefDDProcessor.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WebServiceReferences.java
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/resources/META-INF/stack-agnostic-deployment-aspects.xml
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/test/java/org/jboss/as/webservices/parser/TestDA1.java
container/wildfly82/branches/jbossws-wildfly820/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java
Log:
------------------------------------------------------------------------
[JBWS-3793] Use latest jbossws-spi
------------------------------------------------------------------------
[JBWS-3779] WIP
------------------------------------------------------------------------
[JBWS-3793] More cleanup
------------------------------------------------------------------------
[JBWS-3733]:Add endpointMetrics in EndpointService
------------------------------------------------------------------------
[JBWS-3815] Add mechanism for setting system properties while running JBossWS tests
------------------------------------------------------------------------
[JBWS-3815] Support former log ids
------------------------------------------------------------------------
[JBWS-3514]:Back port fix to wildfly810 branch
------------------------------------------------------------------------
[JBWS-3809] integration of fix from wfly9
------------------------------------------------------------------------
Backporting [WFLY-3905] Only execute POJO processor on WAR deployments
------------------------------------------------------------------------
Backport [WFLY-3535] check
------------------------------------------------------------------------
[JBWS-3835] Add mechanism for restarting target container while running JBossWS tests
------------------------------------------------------------------------
[JBWS-3842] Fix regression
------------------------------------------------------------------------
[JBWS-3838] Sort UnifiedHandlerMetaData instances before adding to the chain
------------------------------------------------------------------------
[JBWS-2680]:Fix authentication realm name hard-coded as "EJBServiceEndpointServlet
Realm"
------------------------------------------------------------------------
[JBWS-3854] EndpointConfigAdd does not set required PropertyService dependencies
------------------------------------------------------------------------
[JBWS-3855] Fix regression
------------------------------------------------------------------------
Backporting WFLY 9 additional test at
https://github.com/asoldano/wildfly/commit/2141438ab18ceffc2f00f339114036...
(modified for running with webservices 1.2 subsystem version as the ASIL does not upgrade
the subsystem schema on purpose)
------------------------------------------------------------------------
[JBWS-3839]:excessive ERROR logging on webservices invocation if SoapFault
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -300,4 +300,11 @@
+ WS_SPEC_REF_5_3_2_4_2)
void finalizeMethodNotAllowed(Class<?> seiClass);
+ @LogMessage(level = WARN)
+ @Message(id = 15617, value = "Annotation '@%s' found on class
'%s'. Perhaps you forgot to add a '%s' module dependency to your
deployment?")
+ void missingModuleDependency(String annotation, String clazz, String module);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 15618, value = "Could not activate the webservices
subsystem.")
+ void couldNotActivateSubsystem(@Cause Throwable cause);
}
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/WSMessages.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/WSMessages.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/WSMessages.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -148,8 +148,8 @@
@Message(id = 15590, value = "Config %s, %s handler chain %s: doesn't
contain handler with name %s")
OperationFailedException missingHandler(String configName, String handlerChainType,
String handlerChainId, String handlerName);
- @Message(id = 15594, value = "Method invocation failed with exception:
%s")
- String methodInvocationFailed(String message);
+ //@Message(id = 15594, value = "Method invocation failed with exception:
%s")
+ //String methodInvocationFailed(String message);
@Message(id = 15595, value = "Unable to get URL for: %s")
DeploymentUnitProcessingException cannotGetURLForDescriptor(@Cause Throwable cause,
String resourcePath);
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/AspectDeploymentProcessor.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/AspectDeploymentProcessor.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/AspectDeploymentProcessor.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -66,17 +66,15 @@
if (isWebServiceDeployment(unit)) {
ensureAspectInitialized();
final Deployment dep = ASHelper.getRequiredAttachment(unit,
WSAttachmentKeys.DEPLOYMENT_KEY);
- if (aspect.canHandle(dep)) {
- ROOT_LOGGER.aspectStart(aspect, unit.getName());
- ClassLoader origClassLoader =
WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();
- try {
-
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(aspect.getLoader());
- dep.addAttachment(ServiceTarget.class,
phaseContext.getServiceTarget());
- aspect.start(dep);
- dep.removeAttachment(ServiceTarget.class);
- } finally {
-
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(origClassLoader);
- }
+ ROOT_LOGGER.aspectStart(aspect, unit.getName());
+ ClassLoader origClassLoader =
WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();
+ try {
+
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(aspect.getLoader());
+ dep.addAttachment(ServiceTarget.class, phaseContext.getServiceTarget());
+ aspect.start(dep);
+ dep.removeAttachment(ServiceTarget.class);
+ } finally {
+
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(origClassLoader);
}
}
}
@@ -85,15 +83,13 @@
public void undeploy(final DeploymentUnit unit) {
if (isWebServiceDeployment(unit)) {
final Deployment dep = ASHelper.getRequiredAttachment(unit,
WSAttachmentKeys.DEPLOYMENT_KEY);
- if (aspect.canHandle(dep)) {
- ROOT_LOGGER.aspectStop(aspect, unit.getName());
- ClassLoader origClassLoader =
WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();
- try {
-
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(aspect.getLoader());
- aspect.stop(dep);
- } finally {
-
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(origClassLoader);
- }
+ ROOT_LOGGER.aspectStop(aspect, unit.getName());
+ ClassLoader origClassLoader =
WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();
+ try {
+
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(aspect.getLoader());
+ aspect.stop(dep);
+ } finally {
+
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(origClassLoader);
}
}
}
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/EndpointServiceDeploymentAspect.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/EndpointServiceDeploymentAspect.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/EndpointServiceDeploymentAspect.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -70,8 +70,6 @@
public Object clone() {
EndpointServiceDeploymentAspect clone = new EndpointServiceDeploymentAspect();
- clone.setForJaxRpc(isForJaxRpc());
- clone.setForJaxWs(isForJaxWs());
clone.setLast(isLast());
clone.setProvides(getProvides());
clone.setRelativeOrder(getRelativeOrder());
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSClassVerificationProcessor.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSClassVerificationProcessor.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSClassVerificationProcessor.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2013, Red Hat, Inc., and individual contributors
+ * Copyright 2014, 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.
*
@@ -25,6 +25,8 @@
import static org.jboss.as.webservices.WSLogger.ROOT_LOGGER;
import static org.jboss.as.webservices.WSMessages.MESSAGES;
import static org.jboss.as.webservices.util.WSAttachmentKeys.JAXWS_ENDPOINTS_KEY;
+import static org.jboss.as.webservices.util.DotNames.WEB_SERVICE_ANNOTATION;
+import static org.jboss.as.webservices.util.DotNames.WEB_SERVICE_PROVIDER_ANNOTATION;
import javax.jws.WebService;
@@ -33,14 +35,23 @@
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.annotation.CompositeIndex;
+import org.jboss.as.server.deployment.module.ModuleDependency;
+import org.jboss.as.server.deployment.module.ModuleSpecification;
import org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex;
+import org.jboss.as.webservices.WSLogger;
import org.jboss.as.webservices.metadata.model.AbstractEndpoint;
import org.jboss.as.webservices.metadata.model.JAXWSDeployment;
import org.jboss.as.webservices.verification.JwsWebServiceEndpointVerifier;
+import org.jboss.jandex.AnnotationInstance;
+import org.jboss.jandex.AnnotationTarget;
+import org.jboss.jandex.ClassInfo;
+import org.jboss.jandex.DotName;
import org.jboss.modules.Module;
/**
* @author sfcoy
+ * @autor <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
*
*/
public class WSClassVerificationProcessor implements DeploymentUnitProcessor {
@@ -60,6 +71,7 @@
for (AbstractEndpoint ejbEndpoint : wsDeployment.getEjbEndpoints()) {
verifyEndpoint(ejbEndpoint, moduleClassLoader,
deploymentReflectionIndex);
}
+ verifyApacheCXFModuleDependencyRequirement(unit);
}
}
@@ -94,7 +106,44 @@
throw
MESSAGES.declaredEndpointInterfaceClassNotFound(endpointInterfaceClassName,
endpointClass);
}
}
+
+ private void verifyApacheCXFModuleDependencyRequirement(DeploymentUnit unit) {
+ if (!hasCxfModuleDependency(unit)) {
+ // notify user if he clearly forgot the CXF module dependency
+ final CompositeIndex index = unit
+ .getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX);
+ final DotName[] dotNames = { WEB_SERVICE_ANNOTATION,
+ WEB_SERVICE_PROVIDER_ANNOTATION };
+ for (final DotName dotName : dotNames) {
+ for (AnnotationInstance ai : index.getAnnotations(dotName)) {
+ AnnotationTarget at = ai.target();
+ if (at instanceof ClassInfo) {
+ final ClassInfo clazz = (ClassInfo) ai.target();
+ for (DotName dn : clazz.annotations().keySet()) {
+ if (dn.toString().startsWith("org.apache.cxf")) {
+ WSLogger.ROOT_LOGGER.missingModuleDependency(
+ dn.toString(), clazz.name().toString(),
+ "org.apache.cxf");
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ private static boolean hasCxfModuleDependency(DeploymentUnit unit) {
+ final ModuleSpecification moduleSpec = unit
+ .getAttachment(Attachments.MODULE_SPECIFICATION);
+ for (ModuleDependency dep : moduleSpec.getUserDependencies()) {
+ final String id = dep.getIdentifier().getName();
+ if ("org.apache.cxf".equals(id) ||
"org.apache.cxf.impl".equals(id)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
@Override
public void undeploy(DeploymentUnit context) {
}
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSComponentInstanceAssociationInterceptor.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSComponentInstanceAssociationInterceptor.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSComponentInstanceAssociationInterceptor.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -24,6 +24,7 @@
import org.jboss.as.ee.component.BasicComponentInstance;
import org.jboss.as.ee.component.Component;
import org.jboss.as.ee.component.ComponentInstance;
+import org.jboss.as.naming.ManagedReference;
import org.jboss.as.webservices.injection.WSComponent;
import org.jboss.invocation.ImmediateInterceptorFactory;
import org.jboss.invocation.Interceptor;
@@ -44,7 +45,13 @@
@Override
public Object processInvocation(final InterceptorContext interceptorContext) throws
Exception {
final WSComponent wsComponent =
(WSComponent)interceptorContext.getPrivateData(Component.class);
- final BasicComponentInstance pojoComponentInstance =
wsComponent.getComponentInstance();
+ BasicComponentInstance pojoComponentInstance = null;
+ if (interceptorContext.getPrivateData(ManagedReference.class) != null) {
+ ManagedReference reference =
interceptorContext.getPrivateData(ManagedReference.class);
+ pojoComponentInstance =
(BasicComponentInstance)wsComponent.createInstance(reference.getInstance());
+ } else {
+ pojoComponentInstance = wsComponent.getComponentInstance();
+ }
interceptorContext.putPrivateData(ComponentInstance.class,
pojoComponentInstance);
return interceptorContext.proceed();
}
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_EJB.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_EJB.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_EJB.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -105,12 +105,12 @@
final String authMethod = webCtx.getAuthMethod();
final boolean isSecureWsdlAccess = webCtx.isSecureWsdlAccess();
final String transportGuarantee = webCtx.getTransportGuarantee();
-
+ final String realmName = webCtx.getRealmName();
for (final SessionBeanComponentDescription sessionBean : sessionBeans) {
if (sessionBean.isStateless() || sessionBean.isSingleton()) {
final EJBViewDescription ejbViewDescription =
sessionBean.addWebserviceEndpointView();
final ServiceName ejbViewName =
ejbViewDescription.getServiceName();
- jaxwsDeployment.addEndpoint(new EJBEndpoint(sessionBean,
ejbViewName, securityRoles, authMethod, isSecureWsdlAccess, transportGuarantee));
+ jaxwsDeployment.addEndpoint(new EJBEndpoint(sessionBean,
ejbViewName, securityRoles, authMethod, realmName, isSecureWsdlAccess,
transportGuarantee));
}
}
}
@@ -192,10 +192,11 @@
private final String authMethod;
private final String transportGuarantee;
private final boolean secureWsdlAccess;
-
+ private final String realmName;
WebContextAnnotationWrapper(final AnnotationInstance annotation) {
authMethod = stringValueOrNull(annotation, "authMethod");
transportGuarantee = stringValueOrNull(annotation,
"transportGuarantee");
+ realmName = stringValueOrNull(annotation, "realmName");
secureWsdlAccess = booleanValue(annotation, "secureWSDLAccess");
}
@@ -211,6 +212,10 @@
return secureWsdlAccess;
}
+ String getRealmName() {
+ return realmName;
+ }
+
private String stringValueOrNull(final AnnotationInstance annotation, final
String attribute) {
if (annotation == null) return null;
final AnnotationValue value = annotation.value(attribute);
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_POJO.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_POJO.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_POJO.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -77,7 +77,10 @@
// @Override
protected void processAnnotation(final DeploymentUnit unit, final EEModuleDescription
moduleDescription)
throws DeploymentUnitProcessingException {
- final Map<String, EEModuleClassDescription> classDescriptionMap = new
HashMap<String, org.jboss.as.ee.component.EEModuleClassDescription>();
+ if (!DeploymentTypeMarker.isType(DeploymentType.WAR, unit)) {
+ return;
+ }
+ final Map<String, EEModuleClassDescription> classDescriptionMap = new
HashMap<String, EEModuleClassDescription>();
final CompositeIndex index =
unit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX);
for (EEModuleClassDescription classDescritpion :
moduleDescription.getClassDescriptions()) {
if (isJaxwsEndpoint(classDescritpion, index) && !exclude(unit,
classDescritpion)) {
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WebContextAnnotationInfo.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WebContextAnnotationInfo.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WebContextAnnotationInfo.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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;
/**
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WebContextAnnotationInformationFactory.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WebContextAnnotationInformationFactory.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WebContextAnnotationInformationFactory.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,9 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2014, Red Hat Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.as.webservices.deployers;
+import org.jboss.ws.api.annotation.WebContext;
+
import org.jboss.as.ee.metadata.ClassAnnotationInformationFactory;
import org.jboss.jandex.AnnotationInstance;
import org.jboss.jandex.AnnotationValue;
-import org.jboss.ws.api.annotation.WebContext;
+import org.jboss.metadata.property.PropertyReplacer;
/**
* User: rsearls
@@ -28,7 +51,6 @@
secureWSDLAccessValue, transportGuaranteeValue, urlPatternValue,
virtualHostValue);
}
-
private String asString(final AnnotationInstance annotation, String property) {
AnnotationValue value = annotation.value(property);
return value == null ? "" : value.asString();
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WebServiceAnnotationProcessor.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WebServiceAnnotationProcessor.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/WebServiceAnnotationProcessor.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -36,6 +36,8 @@
import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
import org.jboss.as.server.deployment.DeploymentUnitProcessor;
import org.jboss.as.server.deployment.annotation.CompositeIndex;
+import org.jboss.metadata.property.PropertyReplacers;
+
/**
* @author <a href="mailto:ema@redhat.com">Jim Ma</a>
*/
@@ -57,12 +59,13 @@
final EEModuleDescription eeModuleDescription =
deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
final CompositeIndex index =
deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.COMPOSITE_ANNOTATION_INDEX);
+ final Boolean replacement =
deploymentUnit.getAttachment(org.jboss.as.ee.structure.Attachments.ANNOTATION_PROPERTY_REPLACEMENT);
if (index == null || eeModuleDescription == null) {
return;
}
for (final ClassAnnotationInformationFactory factory : factories) {
- final Map<String, ClassAnnotationInformation<?, ?>> data =
factory.createAnnotationInformation(index, false);
+ final Map<String, ClassAnnotationInformation<?, ?>> data =
factory.createAnnotationInformation(index, replacement);
for (Map.Entry<String, ClassAnnotationInformation<?, ?>> entry :
data.entrySet()) {
EEModuleClassDescription clazz =
eeModuleDescription.addOrGetLocalClassDescription(entry.getKey());
clazz.addAnnotationInformation(entry.getValue());
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -48,9 +48,9 @@
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
-import org.jboss.wsf.spi.deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.EndpointType;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
@@ -65,21 +65,17 @@
/** Deployment model factory. */
private final DeploymentModelFactory deploymentModelFactory;
- /** Deployment type this builder creates. */
- private final DeploymentType deploymentType;
-
/** Endpoint type this builder creates. */
private final EndpointType endpointType;
/**
* Constructor.
*/
- protected AbstractDeploymentModelBuilder(final DeploymentType deploymentType, final
EndpointType endpointType) {
+ protected AbstractDeploymentModelBuilder(final EndpointType endpointType) {
// deployment factory
final ClassLoader cl = AbstractDeploymentModelBuilder.class.getClassLoader();
final SPIProvider spiProvider =
SPIProviderResolver.getInstance(cl).getProvider();
this.deploymentModelFactory = spiProvider.getSPI(DeploymentModelFactory.class,
cl);
- this.deploymentType = deploymentType;
this.endpointType = endpointType;
}
@@ -189,28 +185,20 @@
} else {
classLoader = module.getClassLoader();
}
- final ArchiveDeployment dep = this.newDeployment(unit.getName(), classLoader);
-
+
+ ArchiveDeployment parentDep = null;
if (unit.getParent() != null) {
- final String parentDeploymentName = unit.getParent().getName();
final Module parentModule =
unit.getParent().getAttachment(Attachments.MODULE);
if (parentModule == null) {
throw MESSAGES.classLoaderResolutionFailed(deploymentRoot);
}
- final ClassLoader parentClassLoader = parentModule.getClassLoader();
-
ROOT_LOGGER.creatingUnifiedWebservicesDeploymentModel(unit.getParent());
- final ArchiveDeployment parentDep = this.newDeployment(parentDeploymentName,
parentClassLoader);
- dep.setParent(parentDep);
+ parentDep = this.newDeployment(null, unit.getParent().getName(),
parentModule.getClassLoader(), null);
}
+
+ final UnifiedVirtualFile uvf = root != null ? new VirtualFileAdaptor(root) : new
ResourceLoaderAdapter(classLoader);
+ final ArchiveDeployment dep = this.newDeployment(parentDep, unit.getName(),
classLoader, uvf);
- if (root != null) {
- dep.setRootFile(new VirtualFileAdaptor(root));
- } else {
- dep.setRootFile(new ResourceLoaderAdapter(classLoader));
- }
- dep.setRuntimeClassLoader(classLoader);
- dep.setType(deploymentType);
//add an AnnotationInfo attachment that uses composite jandex index
dep.addAttachment(AnnotationsInfo.class, new JandexAnnotationsInfo(unit));
@@ -224,7 +212,11 @@
* @param loader deployment loader
* @return new archive deployment
*/
- private ArchiveDeployment newDeployment(final String name, final ClassLoader loader)
{
- return (ArchiveDeployment) this.deploymentModelFactory.newDeployment(name,
loader);
+ private ArchiveDeployment newDeployment(final ArchiveDeployment parent, final String
name, final ClassLoader loader, final UnifiedVirtualFile rootFile) {
+ if (parent != null) {
+ return (ArchiveDeployment) this.deploymentModelFactory.newDeployment(parent, name,
loader, rootFile);
+ } else {
+ return (ArchiveDeployment) this.deploymentModelFactory.newDeployment(name, loader,
rootFile);
+ }
}
}
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_EJB.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_EJB.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_EJB.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -24,7 +24,6 @@
import static org.jboss.as.webservices.WSLogger.ROOT_LOGGER;
import static
org.jboss.as.webservices.metadata.model.AbstractEndpoint.COMPONENT_VIEW_NAME;
import static org.jboss.as.webservices.util.ASHelper.getJaxwsEjbs;
-import static org.jboss.wsf.spi.deployment.DeploymentType.JAXWS;
import static org.jboss.wsf.spi.deployment.EndpointType.JAXWS_EJB3;
import org.jboss.as.server.deployment.DeploymentUnit;
@@ -41,7 +40,7 @@
final class DeploymentModelBuilderJAXWS_EJB extends AbstractDeploymentModelBuilder {
DeploymentModelBuilderJAXWS_EJB() {
- super(JAXWS, JAXWS_EJB3);
+ super(JAXWS_EJB3);
}
@Override
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -24,7 +24,6 @@
import static org.jboss.as.webservices.WSLogger.ROOT_LOGGER;
import static org.jboss.as.webservices.util.ASHelper.getOptionalAttachment;
import static org.jboss.as.webservices.util.WSAttachmentKeys.JMS_ENDPOINT_METADATA_KEY;
-import static org.jboss.wsf.spi.deployment.DeploymentType.JAXWS;
import static org.jboss.wsf.spi.deployment.EndpointType.JAXWS_JSE;
import org.jboss.as.server.deployment.DeploymentUnit;
@@ -40,7 +39,7 @@
final class DeploymentModelBuilderJAXWS_JMS extends AbstractDeploymentModelBuilder {
DeploymentModelBuilderJAXWS_JMS() {
- super(JAXWS, JAXWS_JSE);
+ super(JAXWS_JSE);
}
@Override
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_POJO.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_POJO.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_POJO.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -24,7 +24,6 @@
import static org.jboss.as.webservices.WSLogger.ROOT_LOGGER;
import static
org.jboss.as.webservices.metadata.model.AbstractEndpoint.COMPONENT_VIEW_NAME;
import static org.jboss.as.webservices.util.ASHelper.getJaxwsPojos;
-import static org.jboss.wsf.spi.deployment.DeploymentType.JAXWS;
import static org.jboss.wsf.spi.deployment.EndpointType.JAXWS_JSE;
import org.jboss.as.server.deployment.DeploymentUnit;
@@ -41,7 +40,7 @@
final class DeploymentModelBuilderJAXWS_POJO extends AbstractDeploymentModelBuilder {
DeploymentModelBuilderJAXWS_POJO() {
- super(JAXWS, JAXWS_JSE);
+ super(JAXWS_JSE);
}
@Override
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -36,7 +36,6 @@
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;
@@ -80,10 +79,15 @@
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);
+ for (ServiceName sn : PackageUtils.getServiceNameDependencies(context,
serviceName, address, Constants.PROPERTY)) {
+ clientServiceBuilder.addDependency(sn, PropertyService.class,
clientConfigService.getPropertiesInjector()); //get a new injector instance each time
+ }
+ for (ServiceName sn : PackageUtils.getServiceNameDependencies(context,
serviceName, address, Constants.PRE_HANDLER_CHAIN)) {
+ clientServiceBuilder.addDependency(sn, UnifiedHandlerChainMetaData.class,
clientConfigService.getPreHandlerChainsInjector()); //get a new injector instance each
time
+ }
+ for (ServiceName sn : PackageUtils.getServiceNameDependencies(context,
serviceName, address, Constants.POST_HANDLER_CHAIN)) {
+ clientServiceBuilder.addDependency(sn, UnifiedHandlerChainMetaData.class,
clientConfigService.getPostHandlerChainsInjector()); //get a new injector instance each
time
+ }
ServiceController<?> controller =
clientServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
newControllers.add(controller);
@@ -92,11 +96,4 @@
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/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigAdd.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigAdd.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigAdd.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -32,10 +32,10 @@
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;
@@ -82,10 +82,17 @@
final ConfigService endpointConfigService = new ConfigService(serverConfig,
name, false);
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();
+ final ServiceBuilder<?> serviceBuilder = target.addService(serviceName,
endpointConfigService);
+ for (ServiceName sn : PackageUtils.getServiceNameDependencies(context,
serviceName, address, Constants.PROPERTY)) {
+ serviceBuilder.addDependency(sn, PropertyService.class,
endpointConfigService.getPropertiesInjector()); //get a new injector instance each time
+ }
+ for (ServiceName sn : PackageUtils.getServiceNameDependencies(context,
serviceName, address, Constants.PRE_HANDLER_CHAIN)) {
+ serviceBuilder.addDependency(sn, UnifiedHandlerChainMetaData.class,
endpointConfigService.getPreHandlerChainsInjector()); //get a new injector instance each
time
+ }
+ for (ServiceName sn : PackageUtils.getServiceNameDependencies(context,
serviceName, address, Constants.POST_HANDLER_CHAIN)) {
+ serviceBuilder.addDependency(sn, UnifiedHandlerChainMetaData.class,
endpointConfigService.getPostHandlerChainsInjector()); //get a new injector instance each
time
+ }
+ ServiceController<?> controller =
serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
newControllers.add(controller);
}
@@ -93,11 +100,4 @@
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/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainAdd.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainAdd.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainAdd.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -86,7 +86,7 @@
final ServiceTarget target = context.getServiceTarget();
final ServiceBuilder<?> handlerChainServiceBuilder =
target.addService(handlerChainServiceName, service);
for (ServiceName sn : PackageUtils.getServiceNameDependencies(context,
handlerChainServiceName, address, HANDLER)) {
- handlerChainServiceBuilder.addDependency(sn,
UnifiedHandlerMetaData.class, service.getHandlersInjector());
+ handlerChainServiceBuilder.addDependency(sn,
UnifiedHandlerMetaData.class, service.getHandlersInjector()); //get a new injector
instance each time
}
ServiceController<?> controller =
handlerChainServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSDeploymentActivator.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSDeploymentActivator.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSDeploymentActivator.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., and individual contributors
+ * Copyright 2014, 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.
*
@@ -44,6 +44,7 @@
import org.jboss.as.webservices.deployers.WebservicesDescriptorDeploymentProcessor;
import org.jboss.as.webservices.deployers.deployment.DeploymentAspectsProvider;
import org.jboss.as.webservices.injection.WSHandlerChainAnnotationProcessor;
+import org.jboss.as.webservices.util.ModuleClassLoaderProvider;
import org.jboss.as.webservices.webserviceref.WSRefAnnotationProcessor;
import org.jboss.as.webservices.webserviceref.WSRefDDProcessor;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
@@ -55,6 +56,9 @@
final class WSDeploymentActivator {
static void activate(final DeploymentProcessorTarget processorTarget, final boolean
appclient) {
+ if (!isModularEnvironment()) {
+ return;
+ }
processorTarget.addDeploymentProcessor(WSExtension.SUBSYSTEM_NAME,
Phase.POST_MODULE, Phase.POST_MODULE_WS_REF_DESCRIPTOR, new WSRefDDProcessor());
processorTarget.addDeploymentProcessor(WSExtension.SUBSYSTEM_NAME,
Phase.POST_MODULE, Phase.POST_MODULE_WS_REF_ANNOTATION, new WSRefAnnotationProcessor());
if (!appclient) {
@@ -85,4 +89,13 @@
}
}
+ private static boolean isModularEnvironment() {
+ try {
+
ModuleClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader();
+ return true;
+ } catch (Exception e) {
+ ROOT_LOGGER.couldNotActivateSubsystem(e);
+ return false;
+ }
+ }
}
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/injection/InjectionDeploymentAspect.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/injection/InjectionDeploymentAspect.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/injection/InjectionDeploymentAspect.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., and individual contributors
+ * Copyright 2014, 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.
*
@@ -19,7 +19,6 @@
* 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.injection;
import java.security.AccessController;
@@ -35,7 +34,6 @@
import org.jboss.msc.service.ServiceName;
import org.jboss.ws.common.deployment.ReferenceFactory;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
-import org.jboss.ws.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.InstanceProvider;
@@ -48,8 +46,6 @@
@Override
public void start(final Deployment dep) {
- if (WSHelper.isJaxrpcDeployment(dep)) return;
-
for (final Endpoint ep : dep.getService().getEndpoints()) {
setInjectionAwareInstanceProvider(ep);
}
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -36,6 +36,7 @@
import org.jboss.as.ee.component.Component;
import org.jboss.as.ee.component.ComponentView;
import org.jboss.as.naming.ManagedReference;
+import org.jboss.as.webservices.WSLogger;
import org.jboss.as.webservices.injection.WSComponent;
import org.jboss.invocation.InterceptorContext;
import org.jboss.msc.service.ServiceName;
@@ -76,7 +77,7 @@
if (componentView == null) {
componentView = getMSCService(componentViewName, ComponentView.class);
if (componentView == null) {
- throw MESSAGES.cannotFindComponentView(componentViewName);
+ throw MESSAGES.cannotFindComponentView(componentViewName);
}
if (reference == null) {
try {
@@ -102,22 +103,24 @@
try {
// prepare for invocation
onBeforeInvocation(wsInvocation);
- //for spring integration we don't need to go into ee's interceptors
- if(wsInvocation.getInvocationContext().getTargetBean() != null &&
endpoint.getProperty("SpringBus") != null) {
- this.reference = new ManagedReference() {
- public void release() {
- }
-
- public Object getInstance() {
- return wsInvocation.getInvocationContext().getTargetBean();
- }
- };
- }
// prepare invocation data
final ComponentView componentView = getComponentView();
Component component = componentView.getComponent();
- if (component instanceof WSComponent &&
endpoint.getProperty("SpringBus") != null) {
- ((WSComponent)component).setReference(reference);
+ //for spring integration and @FactoryType is annotated we don't need to go
into ee's interceptors
+ if(wsInvocation.getInvocationContext().getTargetBean() != null
+ && (endpoint.getProperty("SpringBus") != null)
+ ||
wsInvocation.getInvocationContext().getProperty("forceTargetBean") != null) {
+ this.reference = new ManagedReference() {
+ public void release() {
+ }
+
+ public Object getInstance() {
+ return wsInvocation.getInvocationContext().getTargetBean();
+ }
+ };
+ if (component instanceof WSComponent) {
+ ((WSComponent) component).setReference(reference);
+ }
}
final Method method = getComponentViewMethod(wsInvocation.getJavaMethod(),
componentView.getViewMethods());
final InterceptorContext context = new InterceptorContext();
@@ -126,13 +129,15 @@
context.setParameters(wsInvocation.getArgs());
context.putPrivateData(Component.class, component);
context.putPrivateData(ComponentView.class, componentView);
+ if(wsInvocation.getInvocationContext().getProperty("forceTargetBean")
!= null) {
+ context.putPrivateData(ManagedReference.class, reference);
+ }
// invoke method
final Object retObj = componentView.invoke(context);
// set return value
wsInvocation.setReturnValue(retObj);
}
catch (Throwable t) {
- log.error(MESSAGES.methodInvocationFailed(t.getLocalizedMessage()), t);
handleInvocationException(t);
}
finally {
@@ -209,5 +214,4 @@
return true;
}
-}
-
+}
\ No newline at end of file
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderEJB.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderEJB.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderEJB.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -51,12 +51,12 @@
*/
final EJBArchiveMetaData create(final Deployment dep) {
ROOT_LOGGER.creatingEjbDeployment(dep.getSimpleName());
- final EJBArchiveMetaData ejbArchiveMD = new EJBArchiveMetaData();
+ final EJBArchiveMetaData.Builder ejbArchiveMDBuilder = new
EJBArchiveMetaData.Builder();
- this.buildEnterpriseBeansMetaData(dep, ejbArchiveMD);
- this.buildWebservicesMetaData(dep, ejbArchiveMD);
+ this.buildEnterpriseBeansMetaData(dep, ejbArchiveMDBuilder);
+ this.buildWebservicesMetaData(dep, ejbArchiveMDBuilder);
- return ejbArchiveMD;
+ return ejbArchiveMDBuilder.build();
}
/**
@@ -67,7 +67,7 @@
* @param ejbMetaData
* universal EJB meta data model
*/
- protected abstract void buildEnterpriseBeansMetaData(Deployment dep,
EJBArchiveMetaData ejbMetaData);
+ protected abstract void buildEnterpriseBeansMetaData(Deployment dep,
EJBArchiveMetaData.Builder ejbMetaDataBuilder);
/**
* Builds webservices meta data. This methods sets:
@@ -81,7 +81,7 @@
* @param dep webservice deployment
* @param ejbArchiveMD universal EJB meta data model
*/
- private void buildWebservicesMetaData(final Deployment dep, final EJBArchiveMetaData
ejbArchiveMD)
+ private void buildWebservicesMetaData(final Deployment dep, final
EJBArchiveMetaData.Builder ejbArchiveMDBuilder)
{
final JBossWebservicesMetaData webservicesMD = WSHelper.getOptionalAttachment(dep,
JBossWebservicesMetaData.class);
@@ -89,23 +89,23 @@
// set context root
final String contextRoot = webservicesMD.getContextRoot();
- ejbArchiveMD.setWebServiceContextRoot(contextRoot);
+ ejbArchiveMDBuilder.setWebServiceContextRoot(contextRoot);
ROOT_LOGGER.settingContextRoot(contextRoot);
// set config name
final String configName = webservicesMD.getConfigName();
- ejbArchiveMD.setConfigName(configName);
+ ejbArchiveMDBuilder.setConfigName(configName);
ROOT_LOGGER.settingConfigName(configName);
// set config file
final String configFile = webservicesMD.getConfigFile();
- ejbArchiveMD.setConfigFile(configFile);
+ ejbArchiveMDBuilder.setConfigFile(configFile);
ROOT_LOGGER.settingConfigFile(configFile);
// set wsdl location resolver
final JBossWebserviceDescriptionMetaData[] wsDescriptionsMD =
webservicesMD.getWebserviceDescriptions();
final PublishLocationAdapter resolver = new
PublishLocationAdapterImpl(wsDescriptionsMD);
- ejbArchiveMD.setPublishLocationAdapter(resolver);
+ ejbArchiveMDBuilder.setPublishLocationAdapter(resolver);
}
protected JBossPortComponentMetaData getPortComponent(final String ejbName, final
JBossWebservicesMetaData jbossWebservicesMD) {
@@ -125,37 +125,30 @@
* jboss agnostic EJBs meta data
*/
protected void buildEnterpriseBeanMetaData(final List<EJBMetaData> wsEjbsMD,
final EJBEndpoint ejbEndpoint, final JBossWebservicesMetaData jbossWebservicesMD) {
- final EJBMetaData wsEjbMD = new SLSBMetaData();
+ final SLSBMetaData.Builder wsEjbMDBuilder = new SLSBMetaData.Builder();
// set EJB name and class
- wsEjbMD.setEjbName(ejbEndpoint.getName());
- wsEjbMD.setEjbClass(ejbEndpoint.getClassName());
+ wsEjbMDBuilder.setEjbName(ejbEndpoint.getName());
+ wsEjbMDBuilder.setEjbClass(ejbEndpoint.getClassName());
final JBossPortComponentMetaData portComponentMD =
getPortComponent(ejbEndpoint.getName(), jbossWebservicesMD);
if (portComponentMD != null) {
// set port component meta data
- wsEjbMD.setPortComponentName(portComponentMD.getPortComponentName());
- wsEjbMD.setPortComponentURI(portComponentMD.getPortComponentURI());
+ wsEjbMDBuilder.setPortComponentName(portComponentMD.getPortComponentName());
+ wsEjbMDBuilder.setPortComponentURI(portComponentMD.getPortComponentURI());
}
// set security meta data
- buildSecurityMetaData(wsEjbMD, ejbEndpoint, portComponentMD);
-
- wsEjbsMD.add(wsEjbMD);
- }
-
- private static void buildSecurityMetaData(final EJBMetaData wsEjbMD, final
EJBEndpoint ejbEndpoint, final JBossPortComponentMetaData portComponentMD) {
- final EJBSecurityMetaData smd = new EJBSecurityMetaData();
// auth method
final String authMethod = getAuthMethod(ejbEndpoint, portComponentMD);
- smd.setAuthMethod(authMethod);
// transport guarantee
final String transportGuarantee = getTransportGuarantee(ejbEndpoint,
portComponentMD);
- smd.setTransportGuarantee(transportGuarantee);
// secure wsdl access
final boolean secureWsdlAccess = isSecureWsdlAccess(ejbEndpoint,
portComponentMD);
- smd.setSecureWSDLAccess(secureWsdlAccess);
+ final String realmName = getRealmName(ejbEndpoint, portComponentMD);
// propagate
- wsEjbMD.setSecurityMetaData(smd);
+ wsEjbMDBuilder.setSecurityMetaData(new EJBSecurityMetaData(authMethod, realmName,
transportGuarantee, secureWsdlAccess));
+
+ wsEjbsMD.add(wsEjbMDBuilder.build());
}
private static String getAuthMethod(final EJBEndpoint ejbEndpoint, final
JBossPortComponentMetaData portComponentMD) {
@@ -173,4 +166,9 @@
return (portComponentMD != null && portComponentMD.getSecureWSDLAccess()
!= null) ? portComponentMD.getSecureWSDLAccess() : false;
}
+ private static String getRealmName(final EJBEndpoint ejbEndpoint, final
JBossPortComponentMetaData portComponentMD) {
+ if (ejbEndpoint.getRealmName() != null) return ejbEndpoint.getRealmName();
+ return portComponentMD != null ? portComponentMD.getRealmName() : null;
+ }
+
}
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderPOJO.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderPOJO.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderPOJO.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -38,13 +38,11 @@
import org.jboss.metadata.web.spec.SecurityConstraintMetaData;
import org.jboss.metadata.web.spec.ServletMappingMetaData;
import org.jboss.metadata.web.spec.WebResourceCollectionMetaData;
-import org.jboss.metadata.web.spec.WebResourceCollectionsMetaData;
import org.jboss.ws.common.integration.WSConstants;
import org.jboss.ws.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData.JSEResourceCollection;
import org.jboss.wsf.spi.metadata.j2ee.PublishLocationAdapter;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
@@ -72,40 +70,40 @@
final JBossWebMetaData jbossWebMD = WSHelper.getRequiredAttachment(dep,
JBossWebMetaData.class);
final DeploymentUnit unit = WSHelper.getRequiredAttachment(dep,
DeploymentUnit.class);
final List<POJOEndpoint> pojoEndpoints = getPojoEndpoints(unit);
- final JSEArchiveMetaData jseArchiveMD = new JSEArchiveMetaData();
+ final JSEArchiveMetaData.Builder jseArchiveMDBuilder = new
JSEArchiveMetaData.Builder();
// set context root
final String contextRoot = getContextRoot(dep, jbossWebMD);
- jseArchiveMD.setContextRoot(contextRoot);
+ jseArchiveMDBuilder.setContextRoot(contextRoot);
ROOT_LOGGER.settingContextRoot(contextRoot);
// set servlet url patterns mappings
final Map<String, String> servletMappings =
getServletUrlPatternsMappings(jbossWebMD, pojoEndpoints);
- jseArchiveMD.setServletMappings(servletMappings);
+ jseArchiveMDBuilder.setServletMappings(servletMappings);
// set servlet class names mappings
final Map<String, String> servletClassNamesMappings =
getServletClassMappings(jbossWebMD, pojoEndpoints);
- jseArchiveMD.setServletClassNames(servletClassNamesMappings);
+ jseArchiveMDBuilder.setServletClassNames(servletClassNamesMappings);
// set security domain
final String securityDomain = jbossWebMD.getSecurityDomain();
- jseArchiveMD.setSecurityDomain(securityDomain);
+ jseArchiveMDBuilder.setSecurityDomain(securityDomain);
// set wsdl location resolver
final JBossWebservicesMetaData jbossWebservicesMD =
WSHelper.getOptionalAttachment(dep, JBossWebservicesMetaData.class);
if (jbossWebservicesMD != null) {
final PublishLocationAdapter resolver = new
PublishLocationAdapterImpl(jbossWebservicesMD.getWebserviceDescriptions());
- jseArchiveMD.setPublishLocationAdapter(resolver);
+ jseArchiveMDBuilder.setPublishLocationAdapter(resolver);
}
// set security meta data
final List<JSESecurityMetaData> jseSecurityMDs =
getSecurityMetaData(jbossWebMD.getSecurityConstraints());
- jseArchiveMD.setSecurityMetaData(jseSecurityMDs);
+ jseArchiveMDBuilder.setSecurityMetaData(jseSecurityMDs);
// set config name and file
- setConfigNameAndFile(jseArchiveMD, jbossWebMD, jbossWebservicesMD);
+ setConfigNameAndFile(jseArchiveMDBuilder, jbossWebMD, jbossWebservicesMD);
- return jseArchiveMD;
+ return jseArchiveMDBuilder.build();
}
protected abstract List<POJOEndpoint> getPojoEndpoints(final DeploymentUnit
unit);
@@ -116,14 +114,14 @@
* @param jseArchiveMD universal JSE meta data model
* @param jbossWebMD jboss web meta data
*/
- private void setConfigNameAndFile(final JSEArchiveMetaData jseArchiveMD, final
JBossWebMetaData jbossWebMD, final JBossWebservicesMetaData jbossWebservicesMD) {
+ private void setConfigNameAndFile(final JSEArchiveMetaData.Builder
jseArchiveMDBuilder, final JBossWebMetaData jbossWebMD, final JBossWebservicesMetaData
jbossWebservicesMD) {
if (jbossWebservicesMD != null) {
if (jbossWebservicesMD.getConfigName() != null) {
final String configName = jbossWebservicesMD.getConfigName();
- jseArchiveMD.setConfigName(configName);
+ jseArchiveMDBuilder.setConfigName(configName);
ROOT_LOGGER.settingConfigName(configName);
final String configFile = jbossWebservicesMD.getConfigFile();
- jseArchiveMD.setConfigFile(configFile);
+ jseArchiveMDBuilder.setConfigFile(configFile);
ROOT_LOGGER.settingConfigFile(configFile);
// ensure higher priority against web.xml context parameters
@@ -136,12 +134,12 @@
for (final ParamValueMetaData contextParam : contextParams) {
if (WSConstants.JBOSSWS_CONFIG_NAME.equals(contextParam.getParamName()))
{
final String configName = contextParam.getParamValue();
- jseArchiveMD.setConfigName(configName);
+ jseArchiveMDBuilder.setConfigName(configName);
ROOT_LOGGER.settingConfigName(configName);
}
if (WSConstants.JBOSSWS_CONFIG_FILE.equals(contextParam.getParamName()))
{
final String configFile = contextParam.getParamValue();
- jseArchiveMD.setConfigFile(configFile);
+ jseArchiveMDBuilder.setConfigFile(configFile);
ROOT_LOGGER.settingConfigFile(configFile);
}
}
@@ -159,15 +157,17 @@
if (securityConstraintsMD != null) {
for (final SecurityConstraintMetaData securityConstraintMD :
securityConstraintsMD) {
- final JSESecurityMetaData jseSecurityMD = new JSESecurityMetaData();
+ final JSESecurityMetaData.Builder jseSecurityMDBuilder = new
JSESecurityMetaData.Builder();
// transport guarantee
-
jseSecurityMD.setTransportGuarantee(securityConstraintMD.getTransportGuarantee().name());
-
+
jseSecurityMDBuilder.setTransportGuarantee(securityConstraintMD.getTransportGuarantee().name());
+
// web resources
- this.setWebResources(jseSecurityMD, securityConstraintMD);
+ for (final WebResourceCollectionMetaData webResourceMD :
securityConstraintMD.getResourceCollections()) {
+ jseSecurityMDBuilder.addWebResource(webResourceMD.getName(),
webResourceMD.getUrlPatterns());
+ }
- jseSecurityMDs.add(jseSecurityMD);
+ jseSecurityMDs.add(jseSecurityMDBuilder.build());
}
}
@@ -175,24 +175,6 @@
}
/**
- * Sets web resources in universal meta data model.
- *
- * @param jseSecurityMD universal JSE security meta data model
- * @param securityConstraintMD security constraint meta data
- */
- private void setWebResources(final JSESecurityMetaData jseSecurityMD, final
SecurityConstraintMetaData securityConstraintMD) {
- final WebResourceCollectionsMetaData webResources =
securityConstraintMD.getResourceCollections();
-
- for (final WebResourceCollectionMetaData webResourceMD : webResources) {
- final JSEResourceCollection jseResource =
jseSecurityMD.addWebResource(webResourceMD.getName());
-
- for (final String webResourceUrlPatterns : webResourceMD.getUrlPatterns()) {
- jseResource.addPattern(webResourceUrlPatterns);
- }
- }
- }
-
- /**
* Returns servlet name to url pattern mappings.
*
* @param jbossWebMD jboss web meta data
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/metadata/MetaDataBuilderJAXWS_EJB.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/metadata/MetaDataBuilderJAXWS_EJB.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/metadata/MetaDataBuilderJAXWS_EJB.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -42,14 +42,14 @@
final class MetaDataBuilderJAXWS_EJB extends AbstractMetaDataBuilderEJB {
@Override
- protected void buildEnterpriseBeansMetaData(final Deployment dep, final
EJBArchiveMetaData ejbArchiveMD) {
+ protected void buildEnterpriseBeansMetaData(final Deployment dep, final
EJBArchiveMetaData.Builder ejbArchiveMDBuilder) {
if (!WSHelper.isJaxwsJseDeployment(dep)) { // [AS7-1605] support
final JBossWebMetaData jbossWebMD = WSHelper.getOptionalAttachment(dep,
JBossWebMetaData.class);
final String contextRoot = getContextRoot(dep, jbossWebMD);
if (contextRoot != null) {
- final JSEArchiveMetaData jseArchiveMD = new JSEArchiveMetaData();
- jseArchiveMD.setContextRoot(contextRoot);
- dep.addAttachment(JSEArchiveMetaData.class, jseArchiveMD);
+ final JSEArchiveMetaData.Builder jseArchiveMDBuilder = new
JSEArchiveMetaData.Builder();
+ jseArchiveMDBuilder.setContextRoot(contextRoot);
+ dep.addAttachment(JSEArchiveMetaData.class,
jseArchiveMDBuilder.build());
}
}
@@ -61,7 +61,7 @@
buildEnterpriseBeanMetaData(wsEjbsMD, jbossEjbMD, jbossWebservicesMD);
}
- ejbArchiveMD.setEnterpriseBeans(wsEjbsMD);
+ ejbArchiveMDBuilder.setEnterpriseBeans(wsEjbsMD);
}
}
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/metadata/model/EJBEndpoint.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/metadata/model/EJBEndpoint.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/metadata/model/EJBEndpoint.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -38,12 +38,14 @@
private final String authMethod;
private final boolean secureWsdlAccess;
private final String transportGuarantee;
-
- public EJBEndpoint(final SessionBeanComponentDescription ejbMD, final ServiceName
viewName, final Set<String> declaredSecurityRoles, final String authMethod, final
boolean secureWsdlAccess, final String transportGuarantee) {
+ private final String realmName;
+
+ public EJBEndpoint(final SessionBeanComponentDescription ejbMD, final ServiceName
viewName, final Set<String> declaredSecurityRoles, final String authMethod, final
String realmName, final boolean secureWsdlAccess, final String transportGuarantee) {
super(ejbMD.getComponentName(), ejbMD.getComponentClassName(), viewName);
this.ejbMD = ejbMD;
this.declaredSecurityRoles = declaredSecurityRoles;
this.authMethod = authMethod;
+ this.realmName = realmName;
this.secureWsdlAccess = secureWsdlAccess;
this.transportGuarantee = transportGuarantee;
}
@@ -76,6 +78,9 @@
return transportGuarantee;
}
+ public String getRealmName() {
+ return realmName;
+ }
public ServiceName getEJBViewMethodSecurityAttributesService() {
return
EJBViewMethodSecurityAttributesService.getServiceName(ejbMD.getApplicationName(),
ejbMD.getModuleName(), ejbMD.getEJBName(), getClassName());
}
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/publish/EndpointPublisherImpl.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/publish/EndpointPublisherImpl.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/publish/EndpointPublisherImpl.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2012, Red Hat, Inc., and individual contributors
+ * Copyright 2014, 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.
*
@@ -324,7 +324,6 @@
depAspects.add(aspect);
//add another aspect to set InvocationHandlerJAXWS to each endpoint
ForceJAXWSInvocationHandlerDeploymentAspect handlerAspect = new
ForceJAXWSInvocationHandlerDeploymentAspect();
- handlerAspect.setForJaxRpc(false);
depAspects.add(handlerAspect);
} else {
depAspects.add(aspect);
@@ -349,7 +348,6 @@
publisherDepAspects.add(aspect);
//add another aspect to set InvocationHandlerJAXWS to each endpoint
ForceJAXWSInvocationHandlerDeploymentAspect handlerAspect = new
ForceJAXWSInvocationHandlerDeploymentAspect();
- handlerAspect.setForJaxRpc(false);
publisherDepAspects.add(handlerAspect);
} else {
publisherDepAspects.add(aspect);
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/service/EndpointService.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -63,9 +63,11 @@
import org.jboss.ws.common.management.AbstractServerConfig;
import org.jboss.ws.common.management.ManagedEndpoint;
import org.jboss.ws.common.monitoring.ManagedRecordProcessor;
+import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.EndpointType;
+import org.jboss.wsf.spi.management.EndpointMetricsFactory;
import org.jboss.wsf.spi.security.EJBMethodSecurityAttributeProvider;
/**
@@ -114,6 +116,8 @@
for (final RecordProcessor processor : processors) {
registerRecordProcessor(processor, endpoint);
}
+ final EndpointMetricsFactory factory =
SPIProvider.getInstance().getSPI(EndpointMetricsFactory.class);
+ endpoint.setEndpointMetrics(factory.newEndpointMetrics());
registerEndpoint(endpoint);
endpoint.getLifecycleHandler().start(endpoint);
}
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/AbstractSecurityMetaDataAccessorEJB.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/AbstractSecurityMetaDataAccessorEJB.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/AbstractSecurityMetaDataAccessorEJB.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -140,6 +140,11 @@
return hasEjbSecurityMD ? ejbSecurityMD.getTransportGuarantee() : null;
}
+ public String getRealmName(final Endpoint endpoint) {
+ final EJBSecurityMetaData ejbSecurityMD = this.getEjbSecurityMetaData(endpoint);
+ final boolean hasEjbSecurityMD = ejbSecurityMD != null;
+ return hasEjbSecurityMD ? ejbSecurityMD.getRealmName() : null;
+ }
/**
* Gets EJB security meta data if associated with EJB endpoint.
*
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/SecurityMetaDataAccessorEJB.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/SecurityMetaDataAccessorEJB.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/SecurityMetaDataAccessorEJB.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -71,4 +71,11 @@
* @return transport guarantee or null if not specified
*/
String getTransportGuarantee(Endpoint endpoint);
+ /**
+ * Gets realm name for protect resource
+ *
+ * @param endpoint webservice EJB endpoint
+ * @return realm name or null if not specified
+ */
+ String getRealmName(Endpoint endpoint);
}
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/ServletDelegateFactoryImpl.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/ServletDelegateFactoryImpl.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/ServletDelegateFactoryImpl.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -28,7 +28,7 @@
import org.jboss.wsf.spi.deployment.ServletDelegateFactory;
/**
- * AS7 implementation of {@link org.jboss.wsf.spi.deployment.ServletDelegateFactory}
+ * WildFly implementation of {@link org.jboss.wsf.spi.deployment.ServletDelegateFactory}
* that uses modular classloading for creating the delegate instance.
*
* @author alessio.soldano(a)jboss.com
@@ -38,11 +38,10 @@
public final class ServletDelegateFactoryImpl implements ServletDelegateFactory {
@Override
- public ServletDelegate newServletDelegate(final String servletClassName, final
boolean isJaxWs) {
+ public ServletDelegate newServletDelegate(final String servletClassName) {
final ClassLoaderProvider provider = ClassLoaderProvider.getDefaultProvider();
- final ClassLoader classLoader = isJaxWs ?
provider.getServerIntegrationClassLoader() :
provider.getServerJAXRPCIntegrationClassLoader();
try {
- final Class<?> clazz = classLoader.loadClass(servletClassName);
+ final Class<?> clazz =
provider.getServerIntegrationClassLoader().loadClass(servletClassName);
return (ServletDelegate) clazz.newInstance();
} catch (final Exception e) {
throw MESSAGES.cannotInstantiateServletDelegate(e, servletClassName);
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -267,11 +267,15 @@
private void createLoginConfig(final Deployment dep, final JBossWebMetaData
jbossWebMD) {
final String authMethod = getAuthMethod(dep);
final boolean hasAuthMethod = authMethod != null;
-
+ final String realmName = getRealmName(dep);
if (hasAuthMethod) {
ROOT_LOGGER.creatingLoginConfig(EJB_WEBSERVICE_REALM, authMethod);
final LoginConfigMetaData loginConfig =
WebMetaDataHelper.getLoginConfig(jbossWebMD);
- loginConfig.setRealmName(WebMetaDataCreator.EJB_WEBSERVICE_REALM);
+ if (realmName != null) {
+ loginConfig.setRealmName(realmName);
+ } else {
+ loginConfig.setRealmName(WebMetaDataCreator.EJB_WEBSERVICE_REALM);
+ }
loginConfig.setAuthMethod(authMethod);
}
}
@@ -344,4 +348,14 @@
return null;
}
+ private String getRealmName(final Deployment dep) {
+ for (final Endpoint ejbEndpoint : dep.getService().getEndpoints()) {
+ final String realmName = ejb3SecurityAccessor.getRealmName(ejbEndpoint);
+ final boolean hasRealmName = realmName != null;
+ if (hasRealmName) {
+ return realmName;
+ }
+ }
+ return null;
+ }
}
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataModifier.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataModifier.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataModifier.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -94,8 +94,6 @@
final List<ParamValueMetaData> initParams =
WebMetaDataHelper.getServletInitParams(servletMD);
// configure transport class name
WebMetaDataHelper.newParamValue(WSFServlet.STACK_SERVLET_DELEGATE_CLASS,
transportClassName, initParams);
- // configure the integration classloader to be used (JAXRPC or
JAXWS)
- WebMetaDataHelper.newParamValue(WSFServlet.INTEGRATION_CLASSLOADER,
dep.getType().toString(), initParams);
// configure webservice endpoint
WebMetaDataHelper.newParamValue(Endpoint.SEPID_DOMAIN_ENDPOINT,
endpointClassName, initParams);
}
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -43,7 +43,7 @@
private static final long serialVersionUID = -4509594124653184349L;
- private transient VirtualFile file;
+ private final transient VirtualFile file;
public VirtualFileAdaptor(VirtualFile file) {
this.file = file;
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefDDProcessor.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefDDProcessor.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefDDProcessor.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -89,8 +89,8 @@
throw MESSAGES.jaxRpcNotSupported();
}
// construct service ref
- final UnifiedServiceRefMetaData serviceRefUMDM = new
UnifiedServiceRefMetaData(getUnifiedVirtualFile(unit));
- translate(serviceRefMD, serviceRefUMDM);
+ final UnifiedServiceRefMetaData serviceRefUMDM = translate(serviceRefMD);
+ serviceRefUMDM.setVfsRoot(getUnifiedVirtualFile(unit));
processWSFeatures(unit, serviceRefMD.getInjectionTargets(), serviceRefUMDM);
final WSRefRegistry wsRefRegistry = ASHelper.getWSRefRegistry(unit);
wsRefRegistry.add(getCacheKey(componentDescription, serviceRefUMDM),
serviceRefUMDM);
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., and individual contributors
+ * Copyright 2014, 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.
*
@@ -53,14 +53,18 @@
import org.jboss.metadata.javaee.spec.ServiceReferenceHandlerChainsMetaData;
import org.jboss.metadata.javaee.spec.ServiceReferenceHandlerMetaData;
import org.jboss.metadata.javaee.spec.ServiceReferenceMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.AddressingMetadata;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.MTOMMetadata;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.RespectBindingMetadata;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedInitParamMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
+import
org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaDataBuilder;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaDataBuilder;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
-import org.jboss.wsf.spi.serviceref.ServiceRefType;
/**
* Translates WS Refs from JBossAS MD to JBossWS UMDM format.
@@ -74,22 +78,22 @@
private WSRefUtils() {
}
- static UnifiedServiceRefMetaData translate(final ServiceReferenceMetaData
serviceRefMD, final UnifiedServiceRefMetaData serviceRefUMDM) {
- serviceRefUMDM.setServiceRefName(serviceRefMD.getName());
- serviceRefUMDM.setServiceRefType(serviceRefMD.getServiceRefType());
- serviceRefUMDM.setServiceInterface(serviceRefMD.getServiceInterface());
- serviceRefUMDM.setWsdlFile(serviceRefMD.getWsdlFile());
- serviceRefUMDM.setMappingFile(serviceRefMD.getJaxrpcMappingFile());
- serviceRefUMDM.setServiceQName(serviceRefMD.getServiceQname());
+ static UnifiedServiceRefMetaData translate(final ServiceReferenceMetaData
serviceRefMD) {
+ UnifiedServiceRefMetaDataBuilder builder = new
UnifiedServiceRefMetaDataBuilder();
+ builder.setServiceRefName(serviceRefMD.getName());
+ builder.setServiceRefType(serviceRefMD.getServiceRefType());
+ builder.setServiceInterface(serviceRefMD.getServiceInterface());
+ builder.setWsdlFile(serviceRefMD.getWsdlFile());
+ builder.setMappingFile(serviceRefMD.getJaxrpcMappingFile());
+ builder.setServiceQName(serviceRefMD.getServiceQname());
// propagate port components
final Collection<? extends PortComponentRef> portComponentsMD =
serviceRefMD.getPortComponentRef();
if (portComponentsMD != null) {
for (final PortComponentRef portComponentMD : portComponentsMD) {
- final UnifiedPortComponentRefMetaData portComponentUMDM =
getUnifiedPortComponentRefMetaData(serviceRefUMDM,
- portComponentMD);
+ final UnifiedPortComponentRefMetaData portComponentUMDM =
getUnifiedPortComponentRefMetaData(portComponentMD);
if (portComponentUMDM.getServiceEndpointInterface() != null ||
portComponentUMDM.getPortQName() != null) {
- serviceRefUMDM.addPortComponentRef(portComponentUMDM);
+ builder.addPortComponentRef(portComponentUMDM);
} else {
ROOT_LOGGER.ignoringPortComponentRef(portComponentUMDM);
}
@@ -101,7 +105,7 @@
if (handlersMD != null) {
for (final ServiceReferenceHandlerMetaData handlerMD : handlersMD) {
final UnifiedHandlerMetaData handlerUMDM =
getUnifiedHandlerMetaData(handlerMD);
- serviceRefUMDM.addHandler(handlerUMDM);
+ builder.addHandler(handlerUMDM);
}
}
@@ -109,81 +113,71 @@
ServiceReferenceHandlerChainsMetaData handlerChainsMD =
serviceRefMD.getHandlerChains();
if (handlerChainsMD != null) {
final UnifiedHandlerChainsMetaData handlerChainsUMDM =
getUnifiedHandlerChainsMetaData(handlerChainsMD);
- serviceRefUMDM.setHandlerChains(handlerChainsUMDM);
+ builder.setHandlerChains(handlerChainsUMDM);
}
// propagate jboss specific MD
if (serviceRefMD instanceof JBossServiceReferenceMetaData) {
- processUnifiedJBossServiceRefMetaData(serviceRefUMDM, serviceRefMD);
+ final JBossServiceReferenceMetaData jbossServiceRefMD =
(JBossServiceReferenceMetaData) serviceRefMD;
+ builder.setServiceImplClass(jbossServiceRefMD.getServiceClass());
+ builder.setConfigName(jbossServiceRefMD.getConfigName());
+ builder.setConfigFile(jbossServiceRefMD.getConfigFile());
+ builder.setWsdlOverride(jbossServiceRefMD.getWsdlOverride());
+ builder.setHandlerChain(jbossServiceRefMD.getHandlerChain());
}
- serviceRefUMDM.setType(ServiceRefType.JAXWS);
-
- return serviceRefUMDM;
+ return builder.build();
}
- private static void processUnifiedJBossServiceRefMetaData(final
UnifiedServiceRefMetaData serviceRefUMDM, final ServiceReferenceMetaData serviceRefMD) {
- final JBossServiceReferenceMetaData jbossServiceRefMD =
(JBossServiceReferenceMetaData) serviceRefMD;
- serviceRefUMDM.setServiceImplClass(jbossServiceRefMD.getServiceClass());
- serviceRefUMDM.setConfigName(jbossServiceRefMD.getConfigName());
- serviceRefUMDM.setConfigFile(jbossServiceRefMD.getConfigFile());
- serviceRefUMDM.setWsdlOverride(jbossServiceRefMD.getWsdlOverride());
- serviceRefUMDM.setHandlerChain(jbossServiceRefMD.getHandlerChain());
- }
+ private static UnifiedPortComponentRefMetaData
getUnifiedPortComponentRefMetaData(final PortComponentRef portComponentMD) {
+ final UnifiedPortComponentRefMetaDataBuilder builder = new
UnifiedPortComponentRefMetaDataBuilder();
- private static UnifiedPortComponentRefMetaData
getUnifiedPortComponentRefMetaData(final UnifiedServiceRefMetaData serviceRefUMDM, final
PortComponentRef portComponentMD) {
- final UnifiedPortComponentRefMetaData portComponentUMDM = new
UnifiedPortComponentRefMetaData(serviceRefUMDM);
-
// propagate service endpoint interface
-
portComponentUMDM.setServiceEndpointInterface(portComponentMD.getServiceEndpointInterface());
+
builder.setServiceEndpointInterface(portComponentMD.getServiceEndpointInterface());
// propagate MTOM properties
- portComponentUMDM.setMtomEnabled(portComponentMD.isEnableMtom());
- portComponentUMDM.setMtomThreshold(portComponentMD.getMtomThreshold());
+ builder.setMtomEnabled(portComponentMD.isEnableMtom());
+ builder.setMtomThreshold(portComponentMD.getMtomThreshold());
// propagate addressing properties
final Addressing addressingMD = portComponentMD.getAddressing();
if (addressingMD != null) {
- portComponentUMDM.setAddressingAnnotationSpecified(true);
- portComponentUMDM.setAddressingEnabled(addressingMD.isEnabled());
- portComponentUMDM.setAddressingRequired(addressingMD.isRequired());
- portComponentUMDM.setAddressingResponses(addressingMD.getResponses());
+ builder.setAddressingAnnotationSpecified(true);
+ builder.setAddressingEnabled(addressingMD.isEnabled());
+ builder.setAddressingRequired(addressingMD.isRequired());
+ builder.setAddressingResponses(addressingMD.getResponses());
}
// propagate respect binding properties
if (portComponentMD.getRespectBinding() != null) {
- portComponentUMDM.setRespectBindingAnnotationSpecified(true);
- portComponentUMDM.setRespectBindingEnabled(true);
+ builder.setRespectBindingAnnotationSpecified(true);
+ builder.setRespectBindingEnabled(true);
}
// propagate link
- portComponentUMDM.setPortComponentLink(portComponentMD.getPortComponentLink());
+ builder.setPortComponentLink(portComponentMD.getPortComponentLink());
// propagate jboss specific MD
if (portComponentMD instanceof JBossPortComponentRef) {
- processUnifiedJBossPortComponentRefMetaData(portComponentUMDM,
portComponentMD);
- }
+ final JBossPortComponentRef jbossPortComponentMD = (JBossPortComponentRef)
portComponentMD;
- return portComponentUMDM;
- }
+ // propagate port QName
+ builder.setPortQName(jbossPortComponentMD.getPortQname());
- private static void processUnifiedJBossPortComponentRefMetaData(final
UnifiedPortComponentRefMetaData portComponentUMDM, final PortComponentRef portComponentMD)
{
- final JBossPortComponentRef jbossPortComponentMD = (JBossPortComponentRef)
portComponentMD;
+ // propagate configuration properties
+ builder.setConfigName(jbossPortComponentMD.getConfigName());
+ builder.setConfigFile(jbossPortComponentMD.getConfigFile());
- // propagate port QName
- portComponentUMDM.setPortQName(jbossPortComponentMD.getPortQname());
-
- // propagate configuration properties
- portComponentUMDM.setConfigName(jbossPortComponentMD.getConfigName());
- portComponentUMDM.setConfigFile(jbossPortComponentMD.getConfigFile());
-
- // propagate stub properties
- final List<StubPropertyMetaData> stubPropertiesMD =
jbossPortComponentMD.getStubProperties();
- if (stubPropertiesMD != null) {
- for (final StubPropertyMetaData stubPropertyMD : stubPropertiesMD) {
- portComponentUMDM.addStubProperty(new
UnifiedStubPropertyMetaData(stubPropertyMD.getPropName(),
stubPropertyMD.getPropValue()));
+ // propagate stub properties
+ final List<StubPropertyMetaData> stubPropertiesMD =
jbossPortComponentMD.getStubProperties();
+ if (stubPropertiesMD != null) {
+ for (final StubPropertyMetaData stubPropertyMD : stubPropertiesMD) {
+ builder.addStubProperty(new
UnifiedStubPropertyMetaData(stubPropertyMD.getPropName(),
stubPropertyMD.getPropValue()));
+ }
}
}
+
+ return builder.build();
}
private static UnifiedHandlerMetaData
getUnifiedHandlerMetaData(ServiceReferenceHandlerMetaData srhmd) {
@@ -230,10 +224,10 @@
final javax.xml.ws.soap.Addressing addressingAnnotation =
getAnnotation(anElement, javax.xml.ws.soap.Addressing.class);
if (addressingAnnotation != null) {
- serviceRefUMDM.setAddressingAnnotationSpecified(true);
- serviceRefUMDM.setAddressingEnabled(addressingAnnotation.enabled());
- serviceRefUMDM.setAddressingRequired(addressingAnnotation.required());
-
serviceRefUMDM.setAddressingResponses(addressingAnnotation.responses().toString());
+ serviceRefUMDM.setAddressingMedadata(new AddressingMetadata(true,
+ addressingAnnotation.enabled(),
+ addressingAnnotation.required(),
+ addressingAnnotation.responses().toString()));
}
}
@@ -241,9 +235,7 @@
final MTOM mtomAnnotation = getAnnotation(anElement, MTOM.class);
if (mtomAnnotation != null) {
- serviceRefUMDM.setMtomAnnotationSpecified(true);
- serviceRefUMDM.setMtomEnabled(mtomAnnotation.enabled());
- serviceRefUMDM.setMtomThreshold(mtomAnnotation.threshold());
+ serviceRefUMDM.setMTOMMetadata(new MTOMMetadata(true,
mtomAnnotation.enabled(), mtomAnnotation.threshold()));
}
}
@@ -251,8 +243,7 @@
final javax.xml.ws.RespectBinding respectBindingAnnotation =
getAnnotation(anElement, javax.xml.ws.RespectBinding.class);
if (respectBindingAnnotation != null) {
- serviceRefUMDM.setRespectBindingAnnotationSpecified(true);
- serviceRefUMDM.setRespectBindingEnabled(respectBindingAnnotation.enabled());
+ serviceRefUMDM.setRespectBindingMetadata(new RespectBindingMetadata(true,
respectBindingAnnotation.enabled()));
}
}
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WebServiceReferences.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WebServiceReferences.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WebServiceReferences.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -1,5 +1,7 @@
package org.jboss.as.webservices.webserviceref;
+import static org.jboss.as.webservices.webserviceref.WSRefUtils.processAnnotatedElement;
+
import java.lang.reflect.AnnotatedElement;
import javax.xml.ws.Service;
@@ -14,11 +16,8 @@
import org.jboss.modules.Module;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-import org.jboss.wsf.spi.serviceref.ServiceRefType;
import org.wildfly.security.manager.WildFlySecurityManager;
-import static org.jboss.as.webservices.webserviceref.WSRefUtils.processAnnotatedElement;
-
/**
* Utility class that encapsulates the creation of web service ref factories.
* <p/>
@@ -45,8 +44,7 @@
final WSRefRegistry wsRefRegistry = ASHelper.getWSRefRegistry(unit);
UnifiedServiceRefMetaData serviceRefUMDM = wsRefRegistry.get(refKey);
if (serviceRefUMDM == null) {
- serviceRefUMDM = new UnifiedServiceRefMetaData(getUnifiedVirtualFile(unit));
- serviceRefUMDM.setServiceRefName(bindingName);
+ serviceRefUMDM = new UnifiedServiceRefMetaData(getUnifiedVirtualFile(unit),
bindingName);
wsRefRegistry.add(refKey, serviceRefUMDM);
}
initServiceRef(unit, serviceRefUMDM, type, annotation);
@@ -75,8 +73,6 @@
} else {
serviceRefUMDM.setServiceInterface(Service.class.getName());
}
- // ref type
- serviceRefUMDM.setType(ServiceRefType.JAXWS);
return serviceRefUMDM;
}
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/resources/META-INF/stack-agnostic-deployment-aspects.xml
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/resources/META-INF/stack-agnostic-deployment-aspects.xml 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/main/resources/META-INF/stack-agnostic-deployment-aspects.xml 2015-01-21
14:05:16 UTC (rev 19406)
@@ -48,10 +48,6 @@
<property name="last"
class="boolean">true</property>
</deploymentAspect>
- <deploymentAspect
class="org.jboss.ws.common.deployment.EndpointMetricsDeploymentAspect">
- <property name="provides"
class="java.lang.String">EndpointMetrics</property>
- </deploymentAspect>
-
<deploymentAspect
class="org.jboss.ws.common.deployment.EndpointNameDeploymentAspect">
<property name="requires"
class="java.lang.String">URLPattern</property>
<property name="provides"
class="java.lang.String">EndpointName</property>
Copied:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/test/java/org/jboss/as/webservices/dmr/WebservicesSubsystemRuntimeTestCase.java
(from rev 19161,
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/test/java/org/jboss/as/webservices/dmr/WebservicesSubsystemRuntimeTestCase.java)
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/test/java/org/jboss/as/webservices/dmr/WebservicesSubsystemRuntimeTestCase.java
(rev 0)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/test/java/org/jboss/as/webservices/dmr/WebservicesSubsystemRuntimeTestCase.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -0,0 +1,156 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.dmr;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.as.controller.RunningMode;
+import org.jboss.as.server.Services;
+import org.jboss.as.server.moduleservice.ServiceModuleLoader;
+import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest;
+import org.jboss.as.subsystem.test.AdditionalInitialization;
+import org.jboss.as.subsystem.test.KernelServices;
+import org.jboss.as.subsystem.test.KernelServicesBuilder;
+import org.jboss.as.webservices.util.WSServices;
+import org.jboss.msc.service.ServiceContainer;
+import org.jboss.msc.service.ServiceController;
+import org.jboss.msc.service.ServiceName;
+import org.jboss.msc.service.ServiceTarget;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.metadata.config.ClientConfig;
+import org.jboss.wsf.spi.metadata.config.EndpointConfig;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * A test for checking the services that are created by the subsystem after boot.
+ *
+ * @author <a href="mailto:alessio.soldano@jboss.com>Alessio
Soldano</a>
+ */
+public class WebservicesSubsystemRuntimeTestCase extends AbstractSubsystemBaseTest {
+
+ public WebservicesSubsystemRuntimeTestCase() {
+ super(WSExtension.SUBSYSTEM_NAME, new WSExtension());
+ }
+
+ @Override
+ protected String getSubsystemXml() throws IOException {
+ return readResource("ws-subsystem12-rt.xml");
+ }
+
+ protected AdditionalInitialization createAdditionalInitialization() {
+ return new AdditionalInitialization() {
+ @Override
+ protected RunningMode getRunningMode() {
+ return RunningMode.NORMAL;
+ }
+
+ @Override
+ protected void addExtraServices(ServiceTarget target) {
+ super.addExtraServices(target);
+ target.addService(Services.JBOSS_SERVICE_MODULE_LOADER, new
ServiceModuleLoader(null)).install();
+ }
+ };
+ }
+
+ @Test
+ public void testSubsystem() throws Exception {
+ KernelServicesBuilder builder =
createKernelServicesBuilder(createAdditionalInitialization()).setSubsystemXml(getSubsystemXml());
+ KernelServices mainServices = builder.build();
+ if (!mainServices.isSuccessfulBoot()) {
+ Assert.fail(mainServices.getBootError().toString());
+ }
+
+ //WSDL soap:address rewrite engine options test
+ ServerConfig serverConfig = getMSCService(mainServices.getContainer(),
WSServices.CONFIG_SERVICE, ServerConfig.class);
+ Assert.assertTrue(serverConfig.isModifySOAPAddress());
+ Assert.assertEquals("localhost", serverConfig.getWebServiceHost());
+ Assert.assertEquals(9895, serverConfig.getWebServicePort());
+ Assert.assertEquals(9944, serverConfig.getWebServiceSecurePort());
+
+ //Client & Endpoint predefined configuration tests
+ //HACK: we need to manually reload the client/endpoint configs as the
ServerConfigService is actually not starting in this test;
+ //the reason is that it requires services which are not installed here and even
if those were available it would fail to start
+ //because we're not running in a modular environment and hence it won't
be able to detect the proper ws stack implementation.
+ //Even if we made the subsystem work with a flat classloader (which would not
make sense except for the tests here), we'd have
+ //to deal a hell of ws specific maven dependencies here... so really not worth
the effort.
+ serverConfig.reloadClientConfigs();
+ ClientConfig clCfg = serverConfig.getClientConfig("My-Client-Config");
+ Assert.assertNotNull(clCfg);
+ Assert.assertEquals(1, clCfg.getProperties().size());
+ Assert.assertEquals("bar3",
clCfg.getProperties().get("foo3"));
+ Assert.assertEquals(2, clCfg.getPreHandlerChains().size());
+ Map<String, UnifiedHandlerChainMetaData> map = new HashMap<String,
UnifiedHandlerChainMetaData>();
+ for (UnifiedHandlerChainMetaData uhc : clCfg.getPreHandlerChains()) {
+ map.put(uhc.getId(), uhc);
+ }
+ Assert.assertTrue(map.get("my-handlers").getHandlers().isEmpty());
+ Assert.assertEquals("##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP
##SOAP12_HTTP_MTOM", map.get("my-handlers").getProtocolBindings());
+ Assert.assertEquals(1, map.get("my-handlers2").getHandlers().size());
+ Assert.assertEquals("MyHandler",
map.get("my-handlers2").getHandlers().get(0).getHandlerName());
+ Assert.assertEquals("org.jboss.ws.common.invocation.MyHandler",
map.get("my-handlers2").getHandlers().get(0).getHandlerClass());
+ Assert.assertEquals("##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP
##SOAP12_HTTP_MTOM", map.get("my-handlers").getProtocolBindings());
+ Assert.assertEquals(1, clCfg.getPostHandlerChains().size());
+ Assert.assertEquals("my-handlers2",
clCfg.getPostHandlerChains().get(0).getId());
+ Assert.assertEquals(1,
clCfg.getPostHandlerChains().get(0).getHandlers().size());
+ Assert.assertEquals("MyHandler2",
clCfg.getPostHandlerChains().get(0).getHandlers().get(0).getHandlerName());
+ Assert.assertEquals("org.jboss.ws.common.invocation.MyHandler2",
clCfg.getPostHandlerChains().get(0).getHandlers().get(0).getHandlerClass());
+ Assert.assertEquals("##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP
##SOAP12_HTTP_MTOM", clCfg.getPostHandlerChains().get(0).getProtocolBindings());
+
+ serverConfig.reloadEndpointConfigs();
+ EndpointConfig epCfg =
serverConfig.getEndpointConfig("Standard-Endpoint-Config");
+ Assert.assertNotNull(epCfg);
+ Assert.assertTrue(epCfg.getProperties().isEmpty());
+ Assert.assertTrue(epCfg.getPreHandlerChains().isEmpty());
+ Assert.assertTrue(epCfg.getPostHandlerChains().isEmpty());
+ epCfg = serverConfig.getEndpointConfig("Recording-Endpoint-Config");
+ Assert.assertNotNull(epCfg);
+ Assert.assertEquals(2, epCfg.getProperties().size());
+ Assert.assertEquals("bar",
epCfg.getProperties().get("foo"));
+ Assert.assertEquals("bar2",
epCfg.getProperties().get("foo2"));
+ Assert.assertEquals(1, epCfg.getPreHandlerChains().size());
+ Assert.assertEquals("recording-handlers",
epCfg.getPreHandlerChains().get(0).getId());
+ Assert.assertEquals(2, epCfg.getPreHandlerChains().get(0).getHandlers().size());
+ Assert.assertEquals("RecordingHandler",
epCfg.getPreHandlerChains().get(0).getHandlers().get(0).getHandlerName());
+
Assert.assertEquals("org.jboss.ws.common.invocation.RecordingServerHandler",
epCfg.getPreHandlerChains().get(0).getHandlers().get(0).getHandlerClass());
+ Assert.assertEquals("AnotherRecordingHandler",
epCfg.getPreHandlerChains().get(0).getHandlers().get(1).getHandlerName());
+
Assert.assertEquals("org.jboss.ws.common.invocation.RecordingServerHandler",
epCfg.getPreHandlerChains().get(0).getHandlers().get(1).getHandlerClass());
+ Assert.assertEquals("##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP
##SOAP12_HTTP_MTOM", epCfg.getPreHandlerChains().get(0).getProtocolBindings());
+ Assert.assertEquals(1, epCfg.getPostHandlerChains().size());
+ Assert.assertEquals("recording-handlers2",
epCfg.getPostHandlerChains().get(0).getId());
+ Assert.assertEquals(2,
epCfg.getPostHandlerChains().get(0).getHandlers().size());
+ Assert.assertEquals("RecordingHandler2",
epCfg.getPostHandlerChains().get(0).getHandlers().get(0).getHandlerName());
+
Assert.assertEquals("org.jboss.ws.common.invocation.RecordingServerHandler",
epCfg.getPostHandlerChains().get(0).getHandlers().get(0).getHandlerClass());
+ Assert.assertEquals("AnotherRecordingHandler2",
epCfg.getPostHandlerChains().get(0).getHandlers().get(1).getHandlerName());
+
Assert.assertEquals("org.jboss.ws.common.invocation.RecordingServerHandler",
epCfg.getPostHandlerChains().get(0).getHandlers().get(1).getHandlerClass());
+ Assert.assertEquals("##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP
##SOAP12_HTTP_MTOM", epCfg.getPostHandlerChains().get(0).getProtocolBindings());
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T> T getMSCService(final ServiceContainer container, final
ServiceName serviceName, final Class<T> clazz) {
+ ServiceController<T> service = (ServiceController<T>)
container.getService(serviceName);
+ return service != null ? service.getValue() : null;
+ }
+}
Modified:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/test/java/org/jboss/as/webservices/parser/TestDA1.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/test/java/org/jboss/as/webservices/parser/TestDA1.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/test/java/org/jboss/as/webservices/parser/TestDA1.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -89,31 +89,6 @@
}
@Override
- public boolean canHandle(Deployment dep) {
- return false;
- }
-
- @Override
- public boolean isForJaxWs() {
- return false;
- }
-
- @Override
- public void setForJaxWs(boolean isForJaxWs) {
-
- }
-
- @Override
- public boolean isForJaxRpc() {
- return false;
- }
-
- @Override
- public void setForJaxRpc(boolean isForJaxRpc) {
-
- }
-
- @Override
public ClassLoader getLoader() {
return null;
}
Copied:
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/test/resources/org/jboss/as/webservices/dmr/ws-subsystem12-rt.xml
(from rev 19161,
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/test/resources/org/jboss/as/webservices/dmr/ws-subsystem12-rt.xml)
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/test/resources/org/jboss/as/webservices/dmr/ws-subsystem12-rt.xml
(rev 0)
+++
container/wildfly82/branches/jbossws-wildfly820/server-integration/src/test/resources/org/jboss/as/webservices/dmr/ws-subsystem12-rt.xml 2015-01-21
14:05:16 UTC (rev 19406)
@@ -0,0 +1,29 @@
+<subsystem xmlns="urn:jboss:domain:webservices:1.2">
+ <modify-wsdl-address>true</modify-wsdl-address>
+ <wsdl-host>localhost</wsdl-host>
+ <wsdl-port>9895</wsdl-port>
+ <wsdl-secure-port>9944</wsdl-secure-port>
+ <endpoint-config name="Standard-Endpoint-Config"/>
+ <endpoint-config name="Recording-Endpoint-Config">
+ <pre-handler-chain name="recording-handlers"
protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP
##SOAP12_HTTP_MTOM">
+ <handler name="RecordingHandler"
class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
+ <handler name="AnotherRecordingHandler"
class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
+ </pre-handler-chain>
+ <post-handler-chain name="recording-handlers2"
protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP
##SOAP12_HTTP_MTOM">
+ <handler name="RecordingHandler2"
class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
+ <handler name="AnotherRecordingHandler2"
class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
+ </post-handler-chain>
+ <property name="foo" value="bar"/>
+ <property name="foo2" value="bar2"/>
+ </endpoint-config>
+ <client-config name="My-Client-Config">
+ <pre-handler-chain name="my-handlers"
protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP
##SOAP12_HTTP_MTOM" />
+ <pre-handler-chain name="my-handlers2"
protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP
##SOAP12_HTTP_MTOM">
+ <handler name="MyHandler"
class="org.jboss.ws.common.invocation.MyHandler"/>
+ </pre-handler-chain>
+ <post-handler-chain name="my-handlers2"
protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP
##SOAP12_HTTP_MTOM">
+ <handler name="MyHandler2"
class="org.jboss.ws.common.invocation.MyHandler2"/>
+ </post-handler-chain>
+ <property name="foo3" value="bar3"/>
+ </client-config>
+</subsystem>
Modified:
container/wildfly82/branches/jbossws-wildfly820/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java
===================================================================
---
container/wildfly82/branches/jbossws-wildfly820/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java 2015-01-21
10:54:58 UTC (rev 19405)
+++
container/wildfly82/branches/jbossws-wildfly820/tests-integration/src/main/java/org/jboss/as/webservices/deployer/RemoteDeployer.java 2015-01-21
14:05:16 UTC (rev 19406)
@@ -67,12 +67,15 @@
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OUTCOME;
import static
org.jboss.as.controller.descriptions.ModelDescriptionConstants.READ_ATTRIBUTE_OPERATION;
+import static
org.jboss.as.controller.descriptions.ModelDescriptionConstants.READ_RESOURCE_OPERATION;
import static
org.jboss.as.controller.descriptions.ModelDescriptionConstants.RELEASE_VERSION;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REMOVE;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REQUIRED;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RESTART;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RESULT;
import static
org.jboss.as.controller.descriptions.ModelDescriptionConstants.ROLLBACK_ON_RUNTIME_FAILURE;
import static
org.jboss.as.controller.descriptions.ModelDescriptionConstants.SERVER_IDENTITY;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SHUTDOWN;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SSL;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.STEPS;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM;
@@ -415,6 +418,43 @@
}
}
+ @Override
+ public void restart() throws Exception {
+ ModelNode op = new ModelNode();
+ op.get("operation").set(SHUTDOWN);
+ op.get(RESTART).set("true");
+ applyUpdate(op);
+ waitForServerToRestart(TIMEOUT);
+ }
+
+ @Override
+ public String setSystemProperty(String propName, String propValue) throws Exception
{
+ if (propName == null || propName.trim().length() == 0) {
+ throw new IllegalArgumentException("Empty system property name
specified!");
+ }
+ ModelNode op = createOpNode("system-property=" + propName,
READ_RESOURCE_OPERATION);
+ String previousValue = null;
+ try {
+ ModelNode response = applyUpdate(op);
+ String rawResult = response.get(RESULT).asString();
+ previousValue = rawResult.substring(13, rawResult.length() - 2);
//{"value" => "xyz"}
+ } catch (Exception e) {
+ if (!e.getMessage().contains("WFLYCTL0216") &&
!e.getMessage().contains("JBAS014807")) {
+ throw e;
+ }
+ }
+ if (previousValue != null) {
+ op = createOpNode("system-property=" + propName, REMOVE);
+ applyUpdate(op);
+ }
+ if (propValue != null) {
+ op = createOpNode("system-property=" + propName, ADD);
+ op.get("value").set(propValue);
+ applyUpdate(op);
+ }
+ return previousValue;
+ }
+
private static void applyUpdates(final List<ModelNode> updates) throws
Exception {
for (final ModelNode update : updates) {
applyUpdate(update);
@@ -491,6 +531,36 @@
return op;
}
+ private void waitForServerToRestart(int timeout) throws Exception {
+ Thread.sleep(1000);
+ long start = System.currentTimeMillis();
+ long now;
+ do {
+ final ModelControllerClient client = newModelControllerClient(timeout / 10);
+ ModelNode operation = new ModelNode();
+ operation.get(OP_ADDR).setEmptyList();
+ operation.get(OP).set(READ_ATTRIBUTE_OPERATION);
+ operation.get(NAME).set("server-state");
+ try {
+ ModelNode result = client.execute(operation);
+ boolean normal =
"running".equals(result.get(RESULT).asString());
+ if (normal) {
+ return;
+ }
+ } catch (Exception e) {
+ //NOOP
+ } finally {
+ client.close();
+ }
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ }
+ now = System.currentTimeMillis();
+ } while (now - start < timeout);
+ throw new Exception("Server did not restart!");
+ }
+
private static String getSystemProperty(final String name, final String defaultValue)
{
PrivilegedAction<String> action = new PrivilegedAction<String>() {
public String run() {
@@ -501,9 +571,13 @@
}
private static ModelControllerClient newModelControllerClient() throws Exception {
- return ModelControllerClient.Factory.create(protocol, address.getHostAddress(),
port, callbackHandler, null, TIMEOUT);
+ return newModelControllerClient(TIMEOUT);
}
+ private static ModelControllerClient newModelControllerClient(int timeout) throws
Exception {
+ return ModelControllerClient.Factory.create(protocol, address.getHostAddress(),
port, callbackHandler, null, timeout);
+ }
+
private static ServerDeploymentManager newDeploymentManager(ModelControllerClient
client) throws Exception {
return ServerDeploymentManager.Factory.create(client);
}