Author: richard.opalka(a)jboss.com
Date: 2008-05-22 10:56:13 -0400 (Thu, 22 May 2008)
New Revision: 7138
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/EndpointAPIHttpTransportManager.java
Log:
[JBWS-2188] call deploymentFactory only once per whole deployment - not for each endpoint
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/EndpointAPIHttpTransportManager.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/EndpointAPIHttpTransportManager.java 2008-05-22
14:43:57 UTC (rev 7137)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/EndpointAPIHttpTransportManager.java 2008-05-22
14:56:13 UTC (rev 7138)
@@ -43,6 +43,7 @@
*/
public class EndpointAPIHttpTransportManager implements TransportManager
{
+ private static final String PROCESSED_BY_DEPLOYMENT_FACTORY =
"processed.by.deployment.factory";
private WebAppGenerator generator;
private Map<String, Deployment> deploymentRegistry = new HashMap<String,
Deployment>();
@@ -57,7 +58,14 @@
// Create jboss web app data and attach it to the Deployment
Deployment topLevelDeployment = endpoint.getService().getDeployment();
- generator.create(topLevelDeployment);
+
+ // TODO: JBWS-2188
+ Boolean alreadyDeployed =
(Boolean)topLevelDeployment.getProperty(PROCESSED_BY_DEPLOYMENT_FACTORY);
+ if ((alreadyDeployed == null) || (false == alreadyDeployed))
+ {
+ generator.create(topLevelDeployment);
+ topLevelDeployment.setProperty(PROCESSED_BY_DEPLOYMENT_FACTORY, Boolean.TRUE);
+ }
// Server config
SPIProvider provider = SPIProviderResolver.getInstance().getProvider();
@@ -88,10 +96,23 @@
public void destroyListener(ListenerRef ref)
{
Deployment dep = deploymentRegistry.get(ref.getUUID());
- if(null==dep)
- throw new IllegalArgumentException("Unknown ListenerRef " + ref);
-
- deploymentRegistry.remove(ref.getUUID());
+ if (dep != null)
+ {
+ // TODO: JBWS-2188
+ Boolean alreadyDeployed =
(Boolean)dep.getProperty(PROCESSED_BY_DEPLOYMENT_FACTORY);
+ if ((alreadyDeployed != null) && (true == alreadyDeployed))
+ {
+ try
+ {
+ deploymentFactory.destroy(dep);
+ }
+ finally
+ {
+ deploymentRegistry.remove(ref.getUUID());
+ }
+ dep.removeProperty(PROCESSED_BY_DEPLOYMENT_FACTORY);
+ }
+ }
}
public void setGenerator(WebAppGenerator generator)
Show replies by date