Author: alessio.soldano(a)jboss.com
Date: 2012-05-25 13:09:13 -0400 (Fri, 25 May 2012)
New Revision: 16320
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
Log:
[JBWS-3287] Using deployment descriptor contribution too for jbossws endpoint config name
/ file
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2012-05-25
16:20:22 UTC (rev 16319)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2012-05-25
17:09:13 UTC (rev 16320)
@@ -126,10 +126,12 @@
* @param customization The binding customization to set in the configurer, if any
* @param wsdlPublisher The wsdl file publisher to set in the configurer, if any
* @param depEndpoints The list of deployment endpoints
+ * @param epConfigName The endpoint configuration name, if any
+ * @param epConfigFile The endpoint configuration file, if any
* @return The new jbossws cxf configurer
*/
public abstract Configurer createServerConfigurer(BindingCustomization customization,
- WSDLFilePublisher wsdlPublisher, List<Endpoint> depEndpoints,
UnifiedVirtualFile root);
+ WSDLFilePublisher wsdlPublisher, List<Endpoint> depEndpoints,
UnifiedVirtualFile root, String epConfigName, String epConfigFile);
protected static void setInterceptors(Bus bus)
{
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2012-05-25
16:20:22 UTC (rev 16319)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2012-05-25
17:09:13 UTC (rev 16320)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -179,13 +179,15 @@
@Override
public Configurer createServerConfigurer(BindingCustomization customization,
WSDLFilePublisher wsdlPublisher,
- List<Endpoint> depEndpoints, UnifiedVirtualFile root)
+ List<Endpoint> depEndpoints, UnifiedVirtualFile root, String epConfigName,
String epConfigFile)
{
ServerBeanCustomizer customizer = new ServerBeanCustomizer();
customizer.setBindingCustomization(customization);
customizer.setWsdlPublisher(wsdlPublisher);
customizer.setDeploymentEndpoints(depEndpoints);
customizer.setDeploymentRoot(root);
+ customizer.setEpConfigFile(epConfigFile);
+ customizer.setEpConfigName(epConfigName);
return new JBossWSNonSpringConfigurer(customizer);
}
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2012-05-25
16:20:22 UTC (rev 16319)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2012-05-25
17:09:13 UTC (rev 16320)
@@ -58,6 +58,10 @@
private UnifiedVirtualFile deploymentRoot;
+ private String epConfigName;
+
+ private String epConfigFile;
+
@Override
public void customize(Object beanInstance)
{
@@ -106,22 +110,34 @@
{
endpoint.setInvoker(new JBossWSInvoker());
}
- EndpointConfig epConfig =
implementor.getClass().getAnnotation(EndpointConfig.class);
+ // ** Endpoint configuration setup **
+ // 1) default values
String configName =
org.jboss.wsf.spi.metadata.config.EndpointConfig.STANDARD_ENDPOINT_CONFIG;
String configFile = null;
- if (epConfig != null)
+ // 2) annotation contribution
+ EndpointConfig epConfigAnn =
implementor.getClass().getAnnotation(EndpointConfig.class);
+ if (epConfigAnn != null)
{
- if (!epConfig.configName().isEmpty())
+ if (!epConfigAnn.configName().isEmpty())
{
- configName = epConfig.configName();
+ configName = epConfigAnn.configName();
}
- if (!epConfig.configFile().isEmpty())
+ if (!epConfigAnn.configFile().isEmpty())
{
- configFile = epConfig.configFile();
+ configFile = epConfigAnn.configFile();
}
}
-
+ // 3) descriptor overrides (jboss-webservices.xml or web.xml)
+ if (epConfigName != null && !epConfigName.isEmpty())
+ {
+ configName = epConfigName;
+ }
+ if (epConfigFile != null && !epConfigFile.isEmpty())
+ {
+ configFile = epConfigFile;
+ }
+ // 4) setup of configuration
if (configFile == null)
{
//use endpoint configs from AS domain
@@ -177,4 +193,15 @@
{
this.depEndpoints = endpoints;
}
+
+ public void setEpConfigName(String epConfigName)
+ {
+ this.epConfigName = epConfigName;
+ }
+
+ public void setEpConfigFile(String epConfigFile)
+ {
+ this.epConfigFile = epConfigFile;
+ }
+
}
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2012-05-25
16:20:22 UTC (rev 16319)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2012-05-25
17:09:13 UTC (rev 16320)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -166,7 +166,7 @@
@Override
public Configurer createServerConfigurer(BindingCustomization customization,
WSDLFilePublisher wsdlPublisher,
- List<Endpoint> depEndpoints, UnifiedVirtualFile root)
+ List<Endpoint> depEndpoints, UnifiedVirtualFile root, String epConfigName,
String epConfigFile)
{
ApplicationContext ctx = bus.getExtension(BusApplicationContext.class);
ServerBeanCustomizer customizer = new ServerBeanCustomizer();
@@ -174,6 +174,8 @@
customizer.setWsdlPublisher(wsdlPublisher);
customizer.setDeploymentEndpoints(depEndpoints);
customizer.setDeploymentRoot(root);
+ customizer.setEpConfigFile(epConfigFile);
+ customizer.setEpConfigName(epConfigName);
Configurer orig = bus.getExtension(Configurer.class);
JBossWSSpringConfigurer serverConfigurer = (orig instanceof
JBossWSSpringConfigurer) ? (JBossWSSpringConfigurer)orig : new
JBossWSSpringConfigurer(orig);
serverConfigurer.setApplicationContext(ctx);
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2012-05-25
16:20:22 UTC (rev 16319)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2012-05-25
17:09:13 UTC (rev 16320)
@@ -36,6 +36,7 @@
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.ResourceResolver;
+import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
@@ -109,9 +110,23 @@
DDBeans metadata = dep.getAttachment(DDBeans.class);
holder = new NonSpringBusHolder(metadata);
}
+
+ String epConfigName = null;
+ String epConfigFile = null;
+ JSEArchiveMetaData jsemd = dep.getAttachment(JSEArchiveMetaData.class);
+ JBossWebservicesMetaData wsmd =
dep.getAttachment(JBossWebservicesMetaData.class);
+ //first check JSEArchiveMetaData as that has the actual merged value for POJO
deployments
+ if (jsemd != null) {
+ epConfigName = jsemd.getConfigName();
+ epConfigFile = jsemd.getConfigFile();
+ } else if (wsmd != null) {
+ epConfigName = wsmd.getConfigName();
+ epConfigFile = wsmd.getConfigFile();
+ }
+
Configurer configurer =
holder.createServerConfigurer(dep.getAttachment(BindingCustomization.class),
- new WSDLFilePublisher(aDep), dep.getService().getEndpoints(),
aDep.getRootFile());
- holder.configure(new SoapTransportFactoryExt(), resolver, configurer,
dep.getAttachment(JBossWebservicesMetaData.class));
+ new WSDLFilePublisher(aDep), dep.getService().getEndpoints(),
aDep.getRootFile(), epConfigName, epConfigFile);
+ holder.configure(new SoapTransportFactoryExt(), resolver, configurer, wsmd);
dep.addAttachment(BusHolder.class, holder);
}
finally