Author: richard.opalka(a)jboss.com
Date: 2008-05-16 19:30:27 -0400 (Fri, 16 May 2008)
New Revision: 7082
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/EJBHttpTransportManager.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/EndpointAPIHttpTransportManager.java
Log:
don't forget to destroy deployment factory
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/EJBHttpTransportManager.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/EJBHttpTransportManager.java 2008-05-16
23:22:56 UTC (rev 7081)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/EJBHttpTransportManager.java 2008-05-16
23:30:27 UTC (rev 7082)
@@ -36,6 +36,8 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
/**
* Creates a webapp dpeloyment and pushes it into the deployment framework
@@ -46,10 +48,10 @@
{
private WebAppDeploymentFactory deploymentFactory;
private WebAppGenerator generator;
-
+ private Map<String, Deployment> deploymentRegistry = new HashMap<String,
Deployment>();
+
public ListenerRef createListener(Endpoint endpoint, TransportSpec transportSpec)
{
-
assert deploymentFactory!=null;
assert generator!=null;
@@ -75,27 +77,38 @@
int port = serverConfig.getWebServicePort();
String hostAndPort = host + (port > 0 ? ":" + port : "");
+ ListenerRef listenerRef = null;
try
{
String ctx = httpSpec.getWebContext();
String pattern = httpSpec.getUrlPattern();
- ListenerRef ref = new HttpListenerRef(
- ctx, pattern,
- new URI("http://"+hostAndPort+ctx+pattern)
- );
-
- return ref;
-
- } catch (URISyntaxException e)
+ listenerRef = new HttpListenerRef( ctx, pattern, new
URI("http://"+hostAndPort+ctx+pattern) );
+ }
+ catch (URISyntaxException e)
{
throw new RuntimeException("Failed to create ListenerRef", e);
}
-
+
+ // Map listenerRef for destroy phase
+ deploymentRegistry.put( listenerRef.getUUID(), topLevelDeployment );
+
+ return listenerRef;
}
public void destroyListener(ListenerRef ref)
{
- // noop
+ Deployment dep = deploymentRegistry.get(ref.getUUID());
+ if(null==dep)
+ throw new IllegalArgumentException("Unknown ListenerRef " + ref);
+
+ try
+ {
+ deploymentFactory.destroy(dep);
+ }
+ finally
+ {
+ deploymentRegistry.remove(ref.getUUID());
+ }
}
public void setDeploymentFactory(WebAppDeploymentFactory deploymentFactory)
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-16
23:22:56 UTC (rev 7081)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/wsf/container/jboss50/transport/EndpointAPIHttpTransportManager.java 2008-05-16
23:30:27 UTC (rev 7082)
@@ -88,7 +88,6 @@
deploymentRegistry.put( listenerRef.getUUID(), topLevelDeployment );
return listenerRef;
-
}
public void destroyListener(ListenerRef ref)
Show replies by date