Author: alessio.soldano(a)jboss.com
Date: 2012-05-25 12:20:22 -0400 (Fri, 25 May 2012)
New Revision: 16319
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/SpringBusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java
Log:
[JBWS-3405] Keep spi Deployment out of BusHolder
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
15:02:51 UTC (rev 16318)
+++
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)
@@ -40,7 +40,6 @@
import org.apache.cxf.ws.policy.PolicyEngine;
import org.apache.cxf.ws.policy.selector.MaximalAlternativeSelector;
import org.jboss.ws.api.binding.BindingCustomization;
-import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
@@ -80,9 +79,9 @@
* @param soapTransportFactory The SoapTransportFactory to configure, if any
* @param resolver The ResourceResolver to configure, if any
* @param configurer The JBossWSCXFConfigurer to install in the bus, if
any
- * @param dep The current JBossWS-SPI Deployment
+ * @param wsmd The current JBossWebservicesMetaData, if any
*/
- public void configure(SoapTransportFactory soapTransportFactory, ResourceResolver
resolver, Configurer configurer, Deployment dep)
+ public void configure(SoapTransportFactory soapTransportFactory, ResourceResolver
resolver, Configurer configurer, JBossWebservicesMetaData wsmd)
{
bus.setProperty(org.jboss.wsf.stack.cxf.client.Constants.DEPLOYMENT_BUS, true);
busHolderListener = new BusHolderLifeCycleListener();
@@ -96,7 +95,7 @@
setSoapTransportFactory(bus, soapTransportFactory);
setResourceResolver(bus, resolver);
- Map<String, String> props = getJBossWebservicesMetaDataProperties(dep);
+ Map<String, String> props = (wsmd == null) ? null : wsmd.getProperties();
if (bus.getExtension(PolicyEngine.class) != null)
{
@@ -216,16 +215,6 @@
return selector;
}
- private static Map<String, String>
getJBossWebservicesMetaDataProperties(Deployment dep) {
- if (dep != null) {
- JBossWebservicesMetaData wsmd =
dep.getAttachment(JBossWebservicesMetaData.class);
- if (wsmd != null) {
- return wsmd.getProperties();
- }
- }
- return null;
- }
-
private static AutomaticWorkQueue createWorkQueue(String name, Map<String,
String> props) {
int mqs = parseInt(props.get(Constants.CXF_QUEUE_MAX_QUEUE_SIZE_PROP), 256);
int initialThreads = parseInt(props.get(Constants.CXF_QUEUE_INITIAL_THREADS_PROP),
0);
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
15:02:51 UTC (rev 16318)
+++
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)
@@ -40,9 +40,9 @@
import org.apache.cxf.ws.rm.RMManager;
import org.jboss.ws.api.binding.BindingCustomization;
import org.jboss.ws.api.util.BundleUtils;
-import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSNonSpringBusFactory;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSNonSpringConfigurer;
import org.jboss.wsf.stack.cxf.deployment.EndpointImpl;
@@ -82,15 +82,16 @@
* @param soapTransportFactory The SoapTransportFactory to configure, if any
* @param resolver The ResourceResolver to configure, if any
* @param configurer The JBossWSCXFConfigurer to install in the bus, if
any
+ * @param wsmd The current JBossWebservicesMetaData, if any
*/
@Override
- public void configure(SoapTransportFactory soapTransportFactory, ResourceResolver
resolver, Configurer configurer, Deployment dep)
+ public void configure(SoapTransportFactory soapTransportFactory, ResourceResolver
resolver, Configurer configurer, JBossWebservicesMetaData wsmd)
{
if (configured)
{
throw new IllegalStateException(BundleUtils.getMessage(bundle,
"BUS_IS_ALREADY_CONFIGURED"));
}
- super.configure(soapTransportFactory, resolver, configurer, dep);
+ super.configure(soapTransportFactory, resolver, configurer, wsmd);
for (DDEndpoint dde : metadata.getEndpoints())
{
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
15:02:51 UTC (rev 16318)
+++
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)
@@ -41,9 +41,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.api.binding.BindingCustomization;
import org.jboss.ws.api.util.BundleUtils;
-import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringConfigurer;
import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
@@ -123,15 +123,16 @@
* @param resolver The ResourceResolver to configure, if any
* @param configurer The JBossWSCXFConfigurer to install in the bus, if
any
* @param dep The current JBossWS-SPI Deployment
+ * @param wsmd The current JBossWebservicesMetaData, if any
*/
@Override
- public void configure(SoapTransportFactory soapTransportFactory, ResourceResolver
resolver, Configurer configurer, Deployment dep)
+ public void configure(SoapTransportFactory soapTransportFactory, ResourceResolver
resolver, Configurer configurer, JBossWebservicesMetaData wsmd)
{
if (configured)
{
throw new IllegalStateException(BundleUtils.getMessage(bundle,
"BUS_IS_ALREADY_CONFIGURED"));
}
- super.configure(soapTransportFactory, resolver, configurer, dep);
+ super.configure(soapTransportFactory, resolver, configurer, wsmd);
if (additionalLocations != null)
{
for (URL jbossCxfXml : additionalLocations)
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
15:02:51 UTC (rev 16318)
+++
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)
@@ -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.webservices.JBossWebservicesMetaData;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
import org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder;
@@ -110,7 +111,7 @@
}
Configurer configurer =
holder.createServerConfigurer(dep.getAttachment(BindingCustomization.class),
new WSDLFilePublisher(aDep), dep.getService().getEndpoints(),
aDep.getRootFile());
- holder.configure(new SoapTransportFactoryExt(), resolver, configurer, dep);
+ holder.configure(new SoapTransportFactoryExt(), resolver, configurer,
dep.getAttachment(JBossWebservicesMetaData.class));
dep.addAttachment(BusHolder.class, holder);
}
finally
Modified:
stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java
===================================================================
---
stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java 2012-05-25
15:02:51 UTC (rev 16318)
+++
stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java 2012-05-25
16:20:22 UTC (rev 16319)
@@ -26,11 +26,6 @@
import org.apache.cxf.ws.policy.PolicyEngine;
import org.apache.cxf.ws.policy.selector.FirstAlternativeSelector;
import org.apache.cxf.ws.policy.selector.MaximalAlternativeSelector;
-import org.jboss.wsf.spi.deployment.AbstractExtensible;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.DeploymentState;
-import org.jboss.wsf.spi.deployment.DeploymentType;
-import org.jboss.wsf.spi.deployment.Service;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
import org.jboss.wsf.stack.cxf.client.Constants;
import org.jboss.wsf.stack.cxf.metadata.services.DDBeans;
@@ -62,89 +57,18 @@
}
private static String setupPropertyAndGetAlternativeSelector(String alternative) {
- Deployment dep = new TestDeployment();
+ JBossWebservicesMetaData wsmd = null;
if (alternative != null) {
- JBossWebservicesMetaData wsmd = new JBossWebservicesMetaData(null);
+ wsmd = new JBossWebservicesMetaData(null);
wsmd.setProperty(Constants.CXF_POLICY_ALTERNATIVE_SELECTOR_PROP, alternative);
- dep.addAttachment(JBossWebservicesMetaData.class, wsmd);
}
BusHolder holder = new NonSpringBusHolder(new DDBeans());
try {
- holder.configure(null, null, null, dep);
+ holder.configure(null, null, null, wsmd);
return
holder.getBus().getExtension(PolicyEngine.class).getAlternativeSelector().getClass().getName();
} finally {
holder.close();
}
}
-
- private static class TestDeployment extends AbstractExtensible implements Deployment
{
- @Override
- public String getSimpleName()
- {
- return null;
- }
-
- @Override
- public void setSimpleName(String name)
- {
- }
-
- @Override
- public ClassLoader getInitialClassLoader()
- {
- return null;
- }
-
- @Override
- public void setInitialClassLoader(ClassLoader loader)
- {
- }
-
- @Override
- public ClassLoader getRuntimeClassLoader()
- {
- return null;
- }
-
- @Override
- public void setRuntimeClassLoader(ClassLoader loader)
- {
- }
-
- @Override
- public DeploymentType getType()
- {
- return null;
- }
-
- @Override
- public void setType(DeploymentType type)
- {
- }
-
- @Override
- public DeploymentState getState()
- {
- return null;
- }
-
- @Override
- public void setState(DeploymentState type)
- {
- }
-
- @Override
- public Service getService()
- {
- return null;
- }
-
- @Override
- public void setService(Service service)
- {
- }
-
- }
-
}