Author: richard.opalka(a)jboss.com
Date: 2009-07-03 05:26:59 -0400 (Fri, 03 Jul 2009)
New Revision: 10305
Added:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeployersFactory.java
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/aspects/ContainerMetaDataDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/aspects/InjectionMetaDataDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/aspects/WebAppDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/aspects/WebAppGeneratorDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml
Log:
[JBWS-2332][JBWS-2382] refactoring - removing notion of CREATED,STARTED states, providing
Deployers factory - fixing beans file to use that factory
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/aspects/ContainerMetaDataDeploymentAspect.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/aspects/ContainerMetaDataDeploymentAspect.java 2009-07-03
09:24:42 UTC (rev 10304)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/aspects/ContainerMetaDataDeploymentAspect.java 2009-07-03
09:26:59 UTC (rev 10305)
@@ -42,7 +42,7 @@
}
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
DeploymentUnit unit = dep.getAttachment(DeploymentUnit.class);
if (unit == null)
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/aspects/InjectionMetaDataDeploymentAspect.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/aspects/InjectionMetaDataDeploymentAspect.java 2009-07-03
09:24:42 UTC (rev 10304)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/aspects/InjectionMetaDataDeploymentAspect.java 2009-07-03
09:26:59 UTC (rev 10305)
@@ -70,9 +70,9 @@
private EjbReferenceResolver ejbReferenceResolver;
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
- super.create(dep);
+ super.start(dep);
DeploymentUnit unit = dep.getAttachment(DeploymentUnit.class);
if (unit == null)
@@ -128,11 +128,11 @@
}
@Override
- public void destroy(Deployment dep)
+ public void stop(Deployment dep)
{
dep.getService().removeAttachment(InjectionMetaData.class);
- super.destroy(dep);
+ super.stop(dep);
}
/**
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/aspects/WebAppDeploymentAspect.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/aspects/WebAppDeploymentAspect.java 2009-07-03
09:24:42 UTC (rev 10304)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/aspects/WebAppDeploymentAspect.java 2009-07-03
09:26:59 UTC (rev 10305)
@@ -49,7 +49,7 @@
this.webMetaDataModifier = webMetaDataModifier;
}
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
JBossWebMetaData jbwmd = dep.getAttachment(JBossWebMetaData.class);
if (jbwmd == null)
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/aspects/WebAppGeneratorDeploymentAspect.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/aspects/WebAppGeneratorDeploymentAspect.java 2009-07-03
09:24:42 UTC (rev 10304)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/aspects/WebAppGeneratorDeploymentAspect.java 2009-07-03
09:26:59 UTC (rev 10305)
@@ -70,7 +70,7 @@
}
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
final DeploymentType deploymentType = dep.getType();
Added:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeployersFactory.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeployersFactory.java
(rev 0)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeployersFactory.java 2009-07-03
09:26:59 UTC (rev 10305)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.deployers;
+
+import org.jboss.deployers.plugins.deployers.DeployersImpl;
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+
+/**
+ * WSDeploymentAspectDeployer factory.
+ *
+ * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
+ */
+public final class WSDeployersFactory
+{
+
+ /** Real deployers registry. */
+ private final DeployersImpl delegee;
+
+ /**
+ * Constructor.
+ *
+ * @param realDeployers real deployers registry
+ */
+ public WSDeployersFactory( final DeployersImpl realDeployers )
+ {
+ this.delegee = realDeployers;
+ }
+
+ /**
+ * MC incallback method. It will be called each time DeploymentAspect bean will reach
INSTALLED state.
+ *
+ * @param aspect to create real WS deployer for
+ */
+ public void newDeployer( final DeploymentAspect aspect )
+ {
+ this.delegee.addDeployer( new WSDeploymentAspectDeployer( aspect ) );
+ }
+
+}
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java 2009-07-03
09:24:42 UTC (rev 10304)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java 2009-07-03
09:26:59 UTC (rev 10305)
@@ -53,22 +53,12 @@
*/
public WSDeploymentAspectDeployer( final DeploymentAspect aspect )
{
- this( aspect, false );
- }
- /**
- * Constructor.
- *
- * @param aspect deployment aspect
- * @param lastAspect if this is the last JBossWS aspect in deployers chain
- */
- public WSDeploymentAspectDeployer( final DeploymentAspect aspect, final boolean
lastAspect )
- {
super();
// inputs
this.addInput( JBossWebMetaData.class );
this.addInput( Deployment.class );
- if ( lastAspect )
+ if ( aspect.isLast() )
{
this.addInput( WSDeploymentAspectDeployer.JBOSSWS_METADATA );
}
@@ -82,7 +72,7 @@
// outputs
this.addOutput( JBossWebMetaData.class );
- if ( !lastAspect )
+ if ( !aspect.isLast() )
{
this.addOutput( WSDeploymentAspectDeployer.JBOSSWS_METADATA );
}
@@ -94,6 +84,7 @@
this.addOutput( WSDeploymentAspectDeployer.JBOSSWS_ATTACHMENT_PREFIX + output
);
}
+ this.setRelativeOrder( aspect.getRelativeOrder() );
this.aspect = aspect;
}
@@ -111,7 +102,6 @@
{
log.debug( this.aspect.getClass() + " deploy: " + unit.getName() );
final Deployment dep = unit.getAttachment( Deployment.class );
- this.aspect.create( dep );
this.aspect.start( dep );
}
}
@@ -130,7 +120,6 @@
log.debug( this.aspect.getClass() + " undeploy: " + unit.getName() );
final Deployment dep = unit.getAttachment( Deployment.class );
this.aspect.stop( dep );
- this.aspect.destroy( dep );
}
}
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-07-03
09:24:42 UTC (rev 10304)
+++
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-07-03
09:26:59 UTC (rev 10305)
@@ -53,17 +53,9 @@
<property name="relativeOrder">2</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
- <!-- The AS deployment aspects wrapped in deployers -->
+ <!-- The AS specific deployment aspects -->
<bean name="WSContainerMetaDataDeploymentAspect"
class="org.jboss.webservices.integration.aspects.ContainerMetaDataDeploymentAspect">
<property name="provides">ContainerMetaData,
VFSRoot</property>
- </bean>
-
- <bean name="WSContainerMetaDataDeployer"
class="org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer">
- <constructor>
- <parameter>
- <inject bean="WSContainerMetaDataDeploymentAspect"/>
- </parameter>
- </constructor>
<property name="relativeOrder">12</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
@@ -71,125 +63,53 @@
<property name="requires">WebMetaData</property>
<property name="provides">InjectionMetaData</property>
<property name="ejbReferenceResolver"><inject
bean="org.jboss.ejb3.EjbReferenceResolver"/></property>
- </bean>
-
- <bean name="WSInjectionMetaDataDeployer"
class="org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer">
- <constructor>
- <parameter>
- <inject bean="WSInjectionMetaDataDeploymentAspect"/>
- </parameter>
- </constructor>
<property name="relativeOrder">34</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
<bean name="WSContextRootDeploymentAspect"
class="org.jboss.wsf.framework.deployment.BackwardCompatibleContextRootDeploymentAspect">
<property name="requires">ContainerMetaData</property>
<property name="provides">ContextRoot</property>
- </bean>
-
- <bean name="WSContextRootDeployer"
class="org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer">
- <constructor>
- <parameter>
- <inject bean="WSContextRootDeploymentAspect"/>
- </parameter>
- </constructor>
<property name="relativeOrder">14</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
<bean name="WSVirtualHostDeploymentAspect"
class="org.jboss.wsf.framework.deployment.VirtualHostDeploymentAspect">
<property name="requires">ContainerMetaData</property>
<property name="provides">VirtualHosts</property>
- </bean>
-
- <bean name="WSVirtualHostDeployer"
class="org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer">
- <constructor>
- <parameter>
- <inject bean="WSVirtualHostDeploymentAspect"/>
- </parameter>
- </constructor>
<property name="relativeOrder">18</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
<bean name="WSEndpointAddressDeploymentAspect"
class="org.jboss.wsf.framework.deployment.EndpointAddressDeploymentAspect">
<property name="requires">URLPattern</property>
<property name="provides">EndpointAddress</property>
- </bean>
-
- <bean name="WSEndpointAddressDeployer"
class="org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer">
- <constructor>
- <parameter>
- <inject bean="WSEndpointAddressDeploymentAspect"/>
- </parameter>
- </constructor>
<property name="relativeOrder">16</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
<bean name="WSEndpointLifecycleDeploymentAspect"
class="org.jboss.wsf.framework.deployment.EndpointLifecycleDeploymentAspect">
<property name="provides">LifecycleHandler</property>
- </bean>
-
- <bean name="WSEndpointLifecycleDeployer"
class="org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer">
- <constructor>
- <parameter>
- <inject bean="WSEndpointLifecycleDeploymentAspect"/>
- </parameter>
- <parameter>true</parameter>
- </constructor>
<property name="relativeOrder">37</property> <!--
[JBDEPLOY-201] workaround -->
+ <property name="last">true</property>
</bean>
<bean name="WSEndpointMetricsDeploymentAspect"
class="org.jboss.wsf.framework.deployment.EndpointMetricsDeploymentAspect">
<property name="provides">EndpointMetrics</property>
- </bean>
-
- <bean name="WSEndpointMetricsDeployer"
class="org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer">
- <constructor>
- <parameter>
- <inject bean="WSEndpointMetricsDeploymentAspect"/>
- </parameter>
- </constructor>
<property name="relativeOrder">11</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
<bean name="WSEndpointNameDeploymentAspect"
class="org.jboss.wsf.framework.deployment.EndpointNameDeploymentAspect">
<property name="requires">URLPattern</property>
<property name="provides">EndpointName</property>
- </bean>
-
- <bean name="WSEndpointNameDeployer"
class="org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer">
- <constructor>
- <parameter>
- <inject bean="WSEndpointNameDeploymentAspect"/>
- </parameter>
- </constructor>
<property name="relativeOrder">17</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
<bean name="WSEndpointRegistryDeploymentAspect"
class="org.jboss.wsf.framework.deployment.EndpointRegistryDeploymentAspect">
<property name="requires">EndpointName</property>
<property name="provides">RegisteredEndpoint</property>
- </bean>
-
- <bean name="WSEndpointRegistryDeployer"
class="org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer">
- <constructor>
- <parameter>
- <inject bean="WSEndpointRegistryDeploymentAspect"/>
- </parameter>
- </constructor>
<property name="relativeOrder">35</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
<bean name="WSURLPatternDeploymentAspect"
class="org.jboss.wsf.framework.deployment.BackwardCompatibleURLPatternDeploymentAspect">
<property name="requires">ContextRoot,
ContainerMetaData</property>
<property name="provides">URLPattern</property>
- </bean>
-
- <bean name="WSURLPatternDeployer"
class="org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer">
- <constructor>
- <parameter>
- <inject bean="WSURLPatternDeploymentAspect"/>
- </parameter>
- </constructor>
<property name="relativeOrder">15</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
@@ -197,14 +117,6 @@
<property name="requires">WebMetaData, ContextProperties,
StackDescriptor</property>
<property name="provides">WebMetaData</property>
<property name="webMetaDataModifier"><inject
bean="WSWebMetaDataModifier"/></property>
- </bean>
-
- <bean name="WSWebAppDeployer"
class="org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer">
- <constructor>
- <parameter>
- <inject bean="WSWebAppDeploymentAspect"/>
- </parameter>
- </constructor>
<property name="relativeOrder">33</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
@@ -213,15 +125,17 @@
<property name="provides">WebMetaData</property>
<property name="securityHandlerEJB21"><inject
bean="WSSecurityHandlerEJB21"/></property>
<property name="securityHandlerEJB3"><inject
bean="WSSecurityHandlerEJB3"/></property>
+ <property name="relativeOrder">32</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
- <bean name="WSWebAppGeneratorDeployer"
class="org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer">
+ <!-- WSDeploymentAspectDeployers factory -->
+ <bean name="WSDeployersFactory"
class="org.jboss.webservices.integration.deployers.WSDeployersFactory">
<constructor>
- <parameter>
- <inject bean="WSWebAppGeneratorDeploymentAspect"/>
+ <parameter
class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+ <inject bean="Deployers"/>
</parameter>
</constructor>
- <property name="relativeOrder">32</property> <!--
[JBDEPLOY-201] workaround -->
+ <incallback method="newDeployer"/>
</bean>
<!-- Deployment aspect helper beans -->