Author: asoldano
Date: 2015-03-03 06:16:12 -0500 (Tue, 03 Mar 2015)
New Revision: 19508
Added:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/ConfigResolver.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSEndpointConfigMapping.java
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/AbstractIntegrationProcessorJAXWS.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_HANDLER.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WebServiceAnnotationProcessor.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_EJB.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_POJO.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/WSAttachmentKeys.java
Log:
[JBWS-3846] Resolve endpoint configurations in PARSE phase and create proper components
for handlers specified in endpoint configurations
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/AbstractIntegrationProcessorJAXWS.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/AbstractIntegrationProcessorJAXWS.java 2015-03-03
11:15:20 UTC (rev 19507)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/AbstractIntegrationProcessorJAXWS.java 2015-03-03
11:16:12 UTC (rev 19508)
@@ -111,9 +111,7 @@
}
static boolean isEjb3(final ClassInfo clazz) {
- final boolean isStateless =
clazz.annotations().containsKey(STATELESS_ANNOTATION);
- final boolean isSingleton =
clazz.annotations().containsKey(SINGLETON_ANNOTATION);
- return isStateless || isSingleton;
+ return clazz.annotations().containsKey(STATELESS_ANNOTATION) ||
clazz.annotations().containsKey(SINGLETON_ANNOTATION);
}
}
Added:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/ConfigResolver.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/ConfigResolver.java
(rev 0)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/ConfigResolver.java 2015-03-03
11:16:12 UTC (rev 19508)
@@ -0,0 +1,144 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2015, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.as.webservices.deployers;
+
+import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+import org.jboss.jandex.AnnotationInstance;
+import org.jboss.jandex.AnnotationValue;
+import org.jboss.jandex.ClassInfo;
+import org.jboss.jandex.DotName;
+import org.jboss.metadata.javaee.spec.ParamValueMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.ws.api.annotation.EndpointConfig;
+import org.jboss.ws.common.configuration.AbstractCommonConfigResolver;
+import org.jboss.ws.common.integration.WSConstants;
+import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
+
+public class ConfigResolver extends AbstractCommonConfigResolver {
+
+ private final ClassInfo epClassInfo;
+ private final String className;
+ private final String annotationConfigName;
+ private final String annotationConfigFile;
+ private final String descriptorConfigName;
+ private final String descriptorConfigFile;
+ private final VirtualFile root;
+ private final boolean isWar;
+
+ public ConfigResolver(ClassInfo epClassInfo, JBossWebservicesMetaData jwmd,
JBossWebMetaData jbwebmd, VirtualFile root, boolean isWar) {
+ this.epClassInfo = epClassInfo;
+ this.className = epClassInfo.name().toString();
+ List<AnnotationInstance> annotations = epClassInfo.annotations().get(
+ DotName.createSimple(EndpointConfig.class.getName()));
+ if (annotations != null && !annotations.isEmpty()) {
+ AnnotationInstance ann = annotations.get(0);
+ AnnotationValue av = ann.value("configName");
+ this.annotationConfigName = av != null ? av.asString() : null;
+ av = ann.value("configFile");
+ this.annotationConfigFile = av != null ? av.asString() : null;
+ } else {
+ this.annotationConfigName = null;
+ this.annotationConfigFile = null;
+ }
+ String f = null;
+ String n = null;
+ if (jbwebmd != null && jbwebmd.getContextParams() != null) {
+ for (ParamValueMetaData pvmd : jbwebmd.getContextParams()) {
+ if (WSConstants.JBOSSWS_CONFIG_NAME.equals(pvmd.getParamName())) {
+ n = pvmd.getParamValue();
+ }
+ if (WSConstants.JBOSSWS_CONFIG_FILE.equals(pvmd.getParamName())) {
+ f = pvmd.getParamValue();
+ }
+ }
+ }
+ this.descriptorConfigFile = f != null ? f : (jwmd != null ? jwmd.getConfigFile()
: null);
+ this.descriptorConfigName = n != null ? n : (jwmd != null ? jwmd.getConfigName()
: null);
+ this.root = root;
+ this.isWar = isWar;
+ }
+
+ @Override
+ protected String getEndpointClassName() {
+ return className;
+ }
+
+ @Override
+ protected <T extends Annotation> boolean
isEndpointClassAnnotated(Class<T> annotation) {
+ return
epClassInfo.annotations().containsKey(DotName.createSimple(annotation.getName()));
+ }
+
+ @Override
+ protected String getEndpointConfigNameFromAnnotation() {
+ return annotationConfigName;
+ }
+
+ @Override
+ protected String getEndpointConfigFileFromAnnotation() {
+ return annotationConfigFile;
+ }
+
+ @Override
+ protected String getEndpointConfigNameOverride() {
+ return descriptorConfigName;
+ }
+
+ @Override
+ protected String getEndpointConfigFileOverride() {
+ return descriptorConfigFile;
+ }
+
+ @Override
+ protected URL getConfigFile(String configFileName) throws IOException {
+ return root.getChild(configFileName).asFileURL();
+ }
+
+ @Override
+ protected URL getDefaultConfigFile(String defaultConfigFileName) {
+ URL url = null;
+ if (isWar) {
+ url = asFileURL(root.getChild("/WEB-INF/classes/" +
defaultConfigFileName));
+ }
+ if (url == null) {
+ url = asFileURL(root.getChild("/" + defaultConfigFileName));
+ }
+ return url;
+ }
+
+ private URL asFileURL(VirtualFile vf) {
+ URL url = null;
+ if (vf != null && vf.exists()) {
+ try {
+ url = vf.asFileURL();
+ } catch (MalformedURLException e) {
+ // ignore
+ }
+ }
+ return url;
+ }
+}
Property changes on:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/ConfigResolver.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSEndpointConfigMapping.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSEndpointConfigMapping.java
(rev 0)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSEndpointConfigMapping.java 2015-03-03
11:16:12 UTC (rev 19508)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2015, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.jboss.as.webservices.deployers;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.wsf.spi.metadata.config.EndpointConfig;
+
+/**
+ * Defines mapping of endpoints and their config.
+ *
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
+ */
+public final class WSEndpointConfigMapping {
+
+ private final Map<String, EndpointConfig> endpointConfigMap = new
HashMap<String, EndpointConfig>();
+
+ /**
+ * Registers endpoint and its config.
+ *
+ * @param endpointClass WS endpoint
+ * @param config Config with endpoint
+ */
+ public void registerEndpointConfig(final String endpointClass, final EndpointConfig
config) {
+ if ((endpointClass == null) || (config == null)) {
+ throw new IllegalArgumentException();
+ }
+ endpointConfigMap.put(endpointClass, config);
+ }
+
+ /**
+ * Returns config associated with WS endpoint.
+ *
+ * @param endpointClass to get associated config
+ * @return associated config
+ */
+ public EndpointConfig getConfig(final String endpointClass) {
+ return endpointConfigMap.get(endpointClass);
+ }
+
+ public boolean isEmpty() {
+ return endpointConfigMap.size() == 0;
+ }
+
+}
Property changes on:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSEndpointConfigMapping.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_HANDLER.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_HANDLER.java 2015-03-03
11:15:20 UTC (rev 19507)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_HANDLER.java 2015-03-03
11:16:12 UTC (rev 19508)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., and individual contributors
+ * Copyright 2015, 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.
*
@@ -22,11 +22,15 @@
package org.jboss.as.webservices.deployers;
+import static org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT;
import static org.jboss.as.webservices.util.ASHelper.getJaxwsEjbs;
import static org.jboss.as.webservices.util.ASHelper.getJaxwsPojos;
import static org.jboss.as.webservices.util.ASHelper.getOptionalAttachment;
+import static org.jboss.as.webservices.util.ASHelper.isJaxwsEndpoint;
import static
org.jboss.as.webservices.util.WSAttachmentKeys.WS_ENDPOINT_HANDLERS_MAPPING_KEY;
+import java.util.Set;
+
import javax.jws.WebService;
import javax.xml.ws.WebServiceProvider;
@@ -35,18 +39,29 @@
import org.jboss.as.ee.component.EEModuleClassDescription;
import org.jboss.as.ee.component.EEModuleDescription;
import org.jboss.as.ee.metadata.ClassAnnotationInformation;
+import org.jboss.as.ee.structure.DeploymentType;
+import org.jboss.as.ee.structure.DeploymentTypeMarker;
+import org.jboss.as.server.deployment.Attachments;
import org.jboss.as.server.deployment.DeploymentUnit;
import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
+import org.jboss.as.server.deployment.annotation.CompositeIndex;
import org.jboss.as.webservices.injection.WSEndpointHandlersMapping;
import org.jboss.as.webservices.metadata.model.EJBEndpoint;
import org.jboss.as.webservices.metadata.model.POJOEndpoint;
+import org.jboss.as.webservices.util.ASHelper;
+import org.jboss.as.webservices.util.WSAttachmentKeys;
import org.jboss.jandex.ClassInfo;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.ServiceName;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.wsf.spi.metadata.config.EndpointConfig;
+import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
/**
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @author <a href="mailto:ema@redhat.com">Jim Ma</a>
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
*/
public final class WSIntegrationProcessorJAXWS_HANDLER extends
AbstractIntegrationProcessorJAXWS {
@@ -56,8 +71,11 @@
@Override
protected void processAnnotation(final DeploymentUnit unit, final EEModuleDescription
moduleDescription) throws DeploymentUnitProcessingException {
final WSEndpointHandlersMapping mapping = getOptionalAttachment(unit,
WS_ENDPOINT_HANDLERS_MAPPING_KEY);
- if (mapping == null)
- return;
+ final VirtualFile root = unit.getAttachment(DEPLOYMENT_ROOT).getRoot();
+ final JBossWebservicesMetaData jbossWebservicesMD =
unit.getAttachment(WSAttachmentKeys.JBOSS_WEBSERVICES_METADATA_KEY);
+ final CompositeIndex index =
unit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX);
+ final boolean war = DeploymentTypeMarker.isType(DeploymentType.WAR, unit);
+ final JBossWebMetaData jwmd = ASHelper.getJBossWebMetaData(unit);
for (EEModuleClassDescription classDescription :
moduleDescription.getClassDescriptions()) {
ClassInfo classInfo = null;
ClassAnnotationInformation<WebService, WebServiceAnnotationInfo>
annotationInfo = classDescription
@@ -70,27 +88,34 @@
if (providreInfo != null) {
classInfo = (ClassInfo)
providreInfo.getClassLevelAnnotations().get(0).getTarget();
}
- if (classInfo != null &&
mapping.getHandlers(classInfo.name().toString()) != null) {
+
+ if (classInfo != null && isJaxwsEndpoint(classInfo, index, false)) {
final String endpointClassName = classInfo.name().toString();
- if (isEjb3(classInfo)) {
- for (final EJBEndpoint ejbEndpoint : getJaxwsEjbs(unit)) {
- if (endpointClassName.equals(ejbEndpoint.getClassName())) {
- for (final String handlerClassName :
mapping.getHandlers(endpointClassName)) {
- final String ejbEndpointName = ejbEndpoint.getName();
- final String handlerName = ejbEndpointName +
"-" + handlerClassName;
- final ComponentDescription jaxwsHandlerDescription =
createComponentDescription(unit,
- handlerName, handlerClassName, ejbEndpointName);
- propagateNamingContext(jaxwsHandlerDescription,
ejbEndpoint);
+ final ConfigResolver configResolver = new ConfigResolver(classInfo,
jbossWebservicesMD, jwmd, root, war);
+ final EndpointConfig config = configResolver.resolveEndpointConfig();
+ registerConfigMapping(endpointClassName, config, unit);
+ final Set<String> handlers = getHandlers(endpointClassName, config,
configResolver, mapping);
+ if (!handlers.isEmpty()) {
+ if (isEjb3(classInfo)) {
+ for (final EJBEndpoint ejbEndpoint : getJaxwsEjbs(unit)) {
+ if (endpointClassName.equals(ejbEndpoint.getClassName())) {
+ for (final String handlerClassName : handlers) {
+ final String ejbEndpointName =
ejbEndpoint.getName();
+ final String handlerName = ejbEndpointName +
"-" + handlerClassName;
+ final ComponentDescription jaxwsHandlerDescription =
createComponentDescription(unit,
+ handlerName, handlerClassName,
ejbEndpointName);
+ propagateNamingContext(jaxwsHandlerDescription,
ejbEndpoint);
+ }
}
}
- }
- } else {
- for (final POJOEndpoint pojoEndpoint : getJaxwsPojos(unit)) {
- if (endpointClassName.equals(pojoEndpoint.getClassName())) {
- for (final String handlerClassName :
mapping.getHandlers(endpointClassName)) {
- final String pojoEndpointName = pojoEndpoint.getName();
- final String handlerName = pojoEndpointName +
"-" + handlerClassName;
- createComponentDescription(unit, handlerName,
handlerClassName, pojoEndpointName);
+ } else {
+ for (final POJOEndpoint pojoEndpoint : getJaxwsPojos(unit)) {
+ if (endpointClassName.equals(pojoEndpoint.getClassName())) {
+ for (final String handlerClassName : handlers) {
+ final String pojoEndpointName =
pojoEndpoint.getName();
+ final String handlerName = pojoEndpointName +
"-" + handlerClassName;
+ createComponentDescription(unit, handlerName,
handlerClassName, pojoEndpointName);
+ }
}
}
}
@@ -99,6 +124,27 @@
}
}
+ //TODO this could be moved to a separate DeploymentUnitProcessor operating on
endpoints (together with the rest of the config resolution mechanism)
+ private void registerConfigMapping(String endpointClassName, EndpointConfig config,
DeploymentUnit unit) {
+ WSEndpointConfigMapping mapping =
unit.getAttachment(WSAttachmentKeys.WS_ENDPOINT_CONFIG_MAPPING_KEY);
+ if (mapping == null) {
+ mapping = new WSEndpointConfigMapping();
+ unit.putAttachment(WSAttachmentKeys.WS_ENDPOINT_CONFIG_MAPPING_KEY,
mapping);
+ }
+ mapping.registerEndpointConfig(endpointClassName, config);
+ }
+
+ private Set<String> getHandlers(String endpointClassName, EndpointConfig
config, ConfigResolver resolver, WSEndpointHandlersMapping mapping) {
+ Set<String> handlers = resolver.getAllHandlers(config); //handlers from the
resolved endpoint configuration
+ if (mapping != null) {
+ Set<String> hch = mapping.getHandlers(endpointClassName); // handlers
from @HandlerChain
+ if (hch != null) {
+ handlers.addAll(hch);
+ }
+ }
+ return handlers;
+ }
+
private static void propagateNamingContext(final ComponentDescription
jaxwsHandlerDescription, final EJBEndpoint ejbEndpoint) {
final ServiceName ejbContextServiceName = ejbEndpoint.getContextServiceName();
final DeploymentDescriptorEnvironment ejbEnv =
ejbEndpoint.getDeploymentDescriptorEnvironment();
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WebServiceAnnotationProcessor.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WebServiceAnnotationProcessor.java 2015-03-03
11:15:20 UTC (rev 19507)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/WebServiceAnnotationProcessor.java 2015-03-03
11:16:12 UTC (rev 19508)
@@ -54,6 +54,7 @@
this.factories = Collections.unmodifiableList(factories);
}
+ @SuppressWarnings({ "unchecked", "rawtypes" })
public final void deploy(final DeploymentPhaseContext phaseContext) throws
DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_EJB.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_EJB.java 2015-03-03
11:15:20 UTC (rev 19507)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_EJB.java 2015-03-03
11:16:12 UTC (rev 19508)
@@ -27,7 +27,9 @@
import static org.jboss.wsf.spi.deployment.EndpointType.JAXWS_EJB3;
import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.webservices.deployers.WSEndpointConfigMapping;
import org.jboss.as.webservices.metadata.model.EJBEndpoint;
+import org.jboss.as.webservices.util.WSAttachmentKeys;
import org.jboss.msc.service.ServiceName;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -46,6 +48,7 @@
@Override
protected void build(final Deployment dep, final DeploymentUnit unit) {
ROOT_LOGGER.creatingEndpointsMetaDataModel("JAXWS", "EJB");
+ WSEndpointConfigMapping ecm =
unit.getAttachment(WSAttachmentKeys.WS_ENDPOINT_CONFIG_MAPPING_KEY);
for (final EJBEndpoint ejbEndpoint : getJaxwsEjbs(unit)) {
final String ejbEndpointName = ejbEndpoint.getName();
ROOT_LOGGER.ejbName(ejbEndpointName);
@@ -56,6 +59,7 @@
if (componentViewName != null) {
ep.setProperty(COMPONENT_VIEW_NAME, componentViewName);
}
+ ep.setEndpointConfig(ecm.getConfig(ejbEndpointClassName));
}
}
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_POJO.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_POJO.java 2015-03-03
11:15:20 UTC (rev 19507)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/DeploymentModelBuilderJAXWS_POJO.java 2015-03-03
11:16:12 UTC (rev 19508)
@@ -27,7 +27,9 @@
import static org.jboss.wsf.spi.deployment.EndpointType.JAXWS_JSE;
import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.webservices.deployers.WSEndpointConfigMapping;
import org.jboss.as.webservices.metadata.model.POJOEndpoint;
+import org.jboss.as.webservices.util.WSAttachmentKeys;
import org.jboss.msc.service.ServiceName;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -46,6 +48,7 @@
@Override
protected void build(final Deployment dep, final DeploymentUnit unit) {
ROOT_LOGGER.creatingEndpointsMetaDataModel("JAXWS", "POJO");
+ WSEndpointConfigMapping ecm =
unit.getAttachment(WSAttachmentKeys.WS_ENDPOINT_CONFIG_MAPPING_KEY);
for (final POJOEndpoint pojoEndpoint : getJaxwsPojos(unit)) {
final String pojoEndpointName = pojoEndpoint.getName();
ROOT_LOGGER.pojoName(pojoEndpointName);
@@ -56,6 +59,9 @@
if (componentViewName != null) {
ep.setProperty(COMPONENT_VIEW_NAME, componentViewName);
}
+ if (ecm != null) {
+ ep.setEndpointConfig(ecm.getConfig(pojoEndpointClassName));
+ }
}
}
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java 2015-03-03
11:15:20 UTC (rev 19507)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java 2015-03-03
11:16:12 UTC (rev 19508)
@@ -208,6 +208,10 @@
}
public static boolean isJaxwsEndpoint(final ClassInfo clazz, final CompositeIndex
index) {
+ return isJaxwsEndpoint(clazz, index, true);
+ }
+
+ public static boolean isJaxwsEndpoint(final ClassInfo clazz, final CompositeIndex
index, boolean log) {
// assert JAXWS endpoint class flags
final short flags = clazz.flags();
if (Modifier.isInterface(flags)) return false;
@@ -220,11 +224,15 @@
return false;
}
if (hasWebServiceAnnotation && hasWebServiceProviderAnnotation) {
- ROOT_LOGGER.mutuallyExclusiveAnnotations(clazz.name().toString());
+ if (log) {
+ ROOT_LOGGER.mutuallyExclusiveAnnotations(clazz.name().toString());
+ }
return false;
}
if (Modifier.isFinal(flags)) {
- ROOT_LOGGER.finalEndpointClassDetected(clazz.name().toString());
+ if (log) {
+ ROOT_LOGGER.finalEndpointClassDetected(clazz.name().toString());
+ }
return false;
}
return true;
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/WSAttachmentKeys.java
===================================================================
---
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/WSAttachmentKeys.java 2015-03-03
11:15:20 UTC (rev 19507)
+++
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/util/WSAttachmentKeys.java 2015-03-03
11:16:12 UTC (rev 19508)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat, Inc., and individual contributors
+ * Copyright 2015, 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.
*
@@ -22,6 +22,7 @@
package org.jboss.as.webservices.util;
import org.jboss.as.server.deployment.AttachmentKey;
+import org.jboss.as.webservices.deployers.WSEndpointConfigMapping;
import org.jboss.as.webservices.injection.WSEndpointHandlersMapping;
import org.jboss.as.webservices.metadata.model.JAXWSDeployment;
import org.jboss.as.webservices.webserviceref.WSRefRegistry;
@@ -51,6 +52,7 @@
public static final AttachmentKey<ClassLoader> CLASSLOADER_KEY =
AttachmentKey.create(ClassLoader.class);
public static final AttachmentKey<WSRefRegistry> WS_REFREGISTRY =
AttachmentKey.create(WSRefRegistry.class);
public static final AttachmentKey<WSEndpointHandlersMapping>
WS_ENDPOINT_HANDLERS_MAPPING_KEY = AttachmentKey.create(WSEndpointHandlersMapping.class);
+ public static final AttachmentKey<WSEndpointConfigMapping>
WS_ENDPOINT_CONFIG_MAPPING_KEY = AttachmentKey.create(WSEndpointConfigMapping.class);
public static final AttachmentKey<ServerConfig> SERVER_CONFIG_KEY =
AttachmentKey.create(ServerConfig.class);
private WSAttachmentKeys() {