Author: richard.opalka(a)jboss.com
Date: 2009-07-03 05:24:42 -0400 (Fri, 03 Jul 2009)
New Revision: 10304
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/ContextPropertiesDeploymentAspect.java
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DefaultLifecycleHandler.java
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectManagerImpl.java
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointAPIDeploymentAspect.java
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointLifecycleDeploymentAspect.java
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointMetricsDeploymentAspect.java
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointNameDeploymentAspect.java
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointRegistryDeploymentAspect.java
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/VirtualHostDeploymentAspect.java
Log:
[JBWS-2332][JBWS-2382] refactoring - removing CREATED, DESTROYED states - these are
useless (WIP)
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/ContextPropertiesDeploymentAspect.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/ContextPropertiesDeploymentAspect.java 2009-07-03
09:17:03 UTC (rev 10303)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/ContextPropertiesDeploymentAspect.java 2009-07-03
09:24:42 UTC (rev 10304)
@@ -49,7 +49,7 @@
}
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
if (contextProperties != null)
{
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java 2009-07-03
09:17:03 UTC (rev 10303)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java 2009-07-03
09:24:42 UTC (rev 10304)
@@ -40,7 +40,7 @@
public class ContextRootDeploymentAspect extends DeploymentAspect
{
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
String contextRoot = dep.getService().getContextRoot();
if (contextRoot == null)
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DefaultLifecycleHandler.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DefaultLifecycleHandler.java 2009-07-03
09:17:03 UTC (rev 10303)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DefaultLifecycleHandler.java 2009-07-03
09:24:42 UTC (rev 10304)
@@ -38,25 +38,12 @@
// provide logging
protected final Logger log = Logger.getLogger(getClass());
- public void create(Endpoint ep)
- {
- log.debug("Create: " + ep.getName());
-
- InvocationHandler invHandler = ep.getInvocationHandler();
- if (invHandler == null)
- throw new IllegalStateException("Invocation handler not available");
-
- invHandler.init(ep);
-
- ep.setState(EndpointState.CREATED);
- }
-
public void start(Endpoint ep)
{
log.debug("Start: " + ep.getName());
EndpointState state = ep.getState();
- if (state == EndpointState.UNDEFINED || state == EndpointState.DESTROYED)
+ if (state != EndpointState.UNDEFINED)
{
log.error("Cannot start endpoint in state: " + state);
}
@@ -65,6 +52,11 @@
if (ep.getEndpointMetrics() != null)
ep.getEndpointMetrics().start();
+ InvocationHandler invHandler = ep.getInvocationHandler();
+ if (invHandler == null)
+ throw new IllegalStateException("Invocation handler not
available");
+ invHandler.init(ep);
+
ep.setState(EndpointState.STARTED);
}
}
@@ -87,10 +79,4 @@
}
}
- public void destroy(Endpoint ep)
- {
- log.debug("Destroy: " + ep.getName());
-
- ep.setState(EndpointState.DESTROYED);
- }
}
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectManagerImpl.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectManagerImpl.java 2009-07-03
09:17:03 UTC (rev 10303)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectManagerImpl.java 2009-07-03
09:24:42 UTC (rev 10304)
@@ -111,14 +111,9 @@
throw new IllegalStateException("Required conditions '" +
aspect.getRequires() + "' not satisfied by '" + providedConditions +
"' for: " + aspect);
*/
- logInvocation(aspect, "Create");
- aspect.create(dep);
-
providedConditions.addAll(aspect.getProvidesAsSet());
}
- dep.setState(DeploymentState.CREATED);
-
// start the deployment
for (int i = 0; i < getDeploymentAspects().size(); i++)
{
@@ -133,7 +128,7 @@
while (i-- >= 0)
{
// destroy the deployment
- failsafeDestroy(aspect, dep);
+ failsafeStop(aspect, dep);
}
throw rte;
}
@@ -144,7 +139,6 @@
public void undeploy(Deployment dep)
{
- // stop the deployment
for (int i = getDeploymentAspects().size(); 0 < i; i--)
{
DeploymentAspect aspect = getDeploymentAspects().get(i - 1);
@@ -152,15 +146,6 @@
}
dep.setState(DeploymentState.STOPPED);
-
- // destroy the deployment
- for (int i = getDeploymentAspects().size(); 0 < i; i--)
- {
- DeploymentAspect aspect = getDeploymentAspects().get(i - 1);
- failsafeDestroy(aspect, dep);
- }
-
- dep.setState(DeploymentState.DESTROYED);
}
private void failsafeStop(DeploymentAspect aspect, Deployment dep)
@@ -176,23 +161,11 @@
}
}
- private void failsafeDestroy(DeploymentAspect aspect, Deployment dep)
- {
- try
- {
- logInvocation(aspect, "Destroy");
- aspect.destroy(dep);
- }
- catch (RuntimeException rte)
- {
- WSFDeploymentException.rethrow(rte);
- }
- }
-
private void logInvocation(DeploymentAspect aspect, String method)
{
String name = aspect.getClass().getName();
name = name.substring(name.lastIndexOf(".") + 1);
log.debug("[" + this.name + "]" + name + ":" +
method);
}
+
}
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointAPIDeploymentAspect.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointAPIDeploymentAspect.java 2009-07-03
09:17:03 UTC (rev 10303)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointAPIDeploymentAspect.java 2009-07-03
09:24:42 UTC (rev 10304)
@@ -39,7 +39,7 @@
public class EndpointAPIDeploymentAspect extends DeploymentAspect
{
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
dep.setType(DeploymentType.JAXWS_JSE);
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java 2009-07-03
09:17:03 UTC (rev 10303)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java 2009-07-03
09:24:42 UTC (rev 10304)
@@ -38,7 +38,7 @@
public class EndpointAddressDeploymentAspect extends DeploymentAspect
{
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
String contextRoot = dep.getService().getContextRoot();
if (contextRoot == null)
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java 2009-07-03
09:17:03 UTC (rev 10303)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java 2009-07-03
09:24:42 UTC (rev 10304)
@@ -54,7 +54,7 @@
}
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
for (Endpoint ep : dep.getService().getEndpoints())
{
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointLifecycleDeploymentAspect.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointLifecycleDeploymentAspect.java 2009-07-03
09:17:03 UTC (rev 10303)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointLifecycleDeploymentAspect.java 2009-07-03
09:24:42 UTC (rev 10304)
@@ -31,14 +31,6 @@
*/
public class EndpointLifecycleDeploymentAspect extends DeploymentAspect
{
- @Override
- public void create(Deployment dep)
- {
- for (Endpoint ep : dep.getService().getEndpoints())
- {
- getLifecycleHandler(ep, true).create(ep);
- }
- }
@Override
public void start(Deployment dep)
@@ -64,21 +56,6 @@
}
}
- @Override
- public void destroy(Deployment dep)
- {
- Service service = dep.getService();
- if (service != null)
- {
- for (Endpoint ep : service.getEndpoints())
- {
- LifecycleHandler lifecycleHandler = getLifecycleHandler(ep, false);
- if (lifecycleHandler != null)
- lifecycleHandler.destroy(ep);
- }
- }
- }
-
private LifecycleHandler getLifecycleHandler(Endpoint ep, boolean assertHandler)
{
LifecycleHandler lifecycleHandler = ep.getLifecycleHandler();
@@ -87,4 +64,5 @@
return lifecycleHandler;
}
+
}
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointMetricsDeploymentAspect.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointMetricsDeploymentAspect.java 2009-07-03
09:17:03 UTC (rev 10303)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointMetricsDeploymentAspect.java 2009-07-03
09:24:42 UTC (rev 10304)
@@ -38,7 +38,7 @@
public class EndpointMetricsDeploymentAspect extends DeploymentAspect
{
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
SPIProvider provider = SPIProviderResolver.getInstance().getProvider();
EndpointMetricsFactory factory = provider.getSPI(EndpointMetricsFactory.class);
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointNameDeploymentAspect.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointNameDeploymentAspect.java 2009-07-03
09:17:03 UTC (rev 10303)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointNameDeploymentAspect.java 2009-07-03
09:24:42 UTC (rev 10304)
@@ -38,7 +38,7 @@
public class EndpointNameDeploymentAspect extends DeploymentAspect
{
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
String contextRoot = dep.getService().getContextRoot();
if (contextRoot == null || contextRoot.startsWith("/") == false)
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java 2009-07-03
09:17:03 UTC (rev 10303)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java 2009-07-03
09:24:42 UTC (rev 10304)
@@ -77,7 +77,7 @@
}
@Override
- public void destroy(Deployment dep)
+ public void stop(Deployment dep)
{
for (Endpoint ep : dep.getService().getEndpoints())
{
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointRegistryDeploymentAspect.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointRegistryDeploymentAspect.java 2009-07-03
09:17:03 UTC (rev 10303)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/EndpointRegistryDeploymentAspect.java 2009-07-03
09:24:42 UTC (rev 10304)
@@ -38,7 +38,7 @@
{
private EndpointRegistry registry;
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
if (registry == null)
@@ -49,7 +49,7 @@
}
}
- public void destroy(Deployment dep)
+ public void stop(Deployment dep)
{
SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
if (registry == null)
@@ -59,4 +59,5 @@
registry.unregister(ep);
}
}
+
}
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java 2009-07-03
09:17:03 UTC (rev 10303)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java 2009-07-03
09:24:42 UTC (rev 10304)
@@ -38,7 +38,7 @@
public class URLPatternDeploymentAspect extends DeploymentAspect
{
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
for (Endpoint ep : dep.getService().getEndpoints())
{
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/VirtualHostDeploymentAspect.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/VirtualHostDeploymentAspect.java 2009-07-03
09:17:03 UTC (rev 10303)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/VirtualHostDeploymentAspect.java 2009-07-03
09:24:42 UTC (rev 10304)
@@ -40,7 +40,7 @@
{
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
if ( DeploymentType.JAXWS_EJB3.equals(dep.getType()))
{