Author: richard.opalka(a)jboss.com
Date: 2009-07-02 02:34:39 -0400 (Thu, 02 Jul 2009)
New Revision: 10275
Removed:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/DeployerHook.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/DeployerHookImpl.java
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/WSDeploymentAspectDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-jboss-beans.xml
Log:
[JBWS-2332][JBWS-2382] refactoring - removing deployer hooks notion (WIP)
Deleted:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/DeployerHook.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/DeployerHook.java 2009-07-01
15:00:55 UTC (rev 10274)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/DeployerHook.java 2009-07-02
06:34:39 UTC (rev 10275)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.wsf.container.jboss50.deployer;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-
-/**
- * An interface for all web service deployer hooks
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 24-Apr-2007
- */
-public interface DeployerHook
-{
- void deploy(DeploymentUnit unit) throws DeploymentException;
-
- void undeploy(DeploymentUnit unit);
-}
Deleted:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/DeployerHookImpl.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/DeployerHookImpl.java 2009-07-01
15:00:55 UTC (rev 10274)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/DeployerHookImpl.java 2009-07-02
06:34:39 UTC (rev 10275)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.wsf.container.jboss50.deployer;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.deployment.*;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
-
-/**
- * An abstract web service deployer.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Heiko.Braun(a)jboss.com
- * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
- */
-public final class DeployerHookImpl implements DeployerHook
-{
-
- protected final Logger log = Logger.getLogger(getClass());
-
- private DeploymentAspectManager deploymentAspectManager;
-
- protected String deploymentManagerName;
-
- /** MC provided property **/
- public void setDeploymentManagerName(String deploymentManagerName)
- {
- this.deploymentManagerName = deploymentManagerName;
- }
-
- public DeploymentAspectManager getDeploymentAspectManager()
- {
- if(null == deploymentAspectManager)
- {
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- deploymentAspectManager =
spiProvider.getSPI(DeploymentAspectManagerFactory.class).getDeploymentAspectManager(
deploymentManagerName );
- }
-
- return deploymentAspectManager;
- }
-
- public void deploy( final DeploymentUnit unit ) throws DeploymentException
- {
- if ( this.isWebServiceDeployment( unit ) )
- {
- log.debug( "deploy: " + unit.getName() );
- final Deployment dep = unit.getAttachment( Deployment.class );
- unit.addAttachment( Deployment.class, dep );
- this.getDeploymentAspectManager().deploy( dep );
- }
- }
-
- public void undeploy( final DeploymentUnit unit )
- {
- final Deployment dep = unit.getAttachment( Deployment.class );
- if ( dep != null )
- {
- log.debug( "undeploy: " + unit.getName() );
- this.getDeploymentAspectManager().undeploy( dep );
- }
- }
-
- private boolean isWebServiceDeployment( final DeploymentUnit unit )
- {
- return unit.getAttachment( DeploymentType.class ) != null;
- }
-
-}
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/WSDeploymentAspectDeployer.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/WSDeploymentAspectDeployer.java 2009-07-01
15:00:55 UTC (rev 10274)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/WSDeploymentAspectDeployer.java 2009-07-02
06:34:39 UTC (rev 10275)
@@ -21,66 +21,85 @@
*/
package org.jboss.wsf.container.jboss50.deployer;
-import java.util.LinkedList;
-import java.util.List;
+import java.util.Set;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.logging.Logger;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
/**
- * The phase one web service deployer.
+ * A deployer that delegates to JBossWS deployment aspect.
*
- * @author Thomas.Diesler(a)jboss.org
* @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
*/
public class WSDeploymentAspectDeployer extends AbstractRealDeployer
{
- private static final Logger log = Logger.getLogger(WSDeploymentAspectDeployer.class);
+ private static final String JBOSSWS_ATTACHMENT_PREFIX = "jbossws.";
+ private final DeploymentAspect aspect;
- private List<DeployerHook> deployerHooks = new
LinkedList<DeployerHook>();
-
/**
* Constructor.
*/
- public WSDeploymentAspectDeployer()
+ public WSDeploymentAspectDeployer( DeploymentAspect aspect )
{
super();
+
+ this.aspect = aspect;
// inputs
this.addInput( JBossWebMetaData.class );
this.addInput( Deployment.class );
+ // propagate DA requirements and map them to deployer inputs
+ final Set< String > inputs = aspect.getRequiresAsSet();
+ for ( String input : inputs )
+ {
+ this.addInput( JBOSSWS_ATTACHMENT_PREFIX + input );
+ }
+
// outputs
this.addOutput( JBossWebMetaData.class );
- }
- public void addDeployerHook(DeployerHook deployer)
- {
- log.debug("Add deployer hook: " + deployer);
- deployerHooks.add(deployer);
+ // propagate DA provides and map them to deployer outputs
+ final Set< String > outputs = aspect.getProvidesAsSet();
+ for ( String output : outputs )
+ {
+ this.addOutput( JBOSSWS_ATTACHMENT_PREFIX + output );
+ }
}
- public void removeDeployerHook(DeployerHook deployer)
- {
- log.debug("Remove deployer hook: " + deployer);
- deployerHooks.remove(deployer);
- }
-
@Override
public void internalDeploy(DeploymentUnit unit) throws DeploymentException
{
- for (DeployerHook deployer : deployerHooks) deployer.deploy(unit);
+ if ( this.isWebServiceDeployment( unit ) )
+ {
+ log.debug( this.aspect.getClass() + " deploy: " + unit.getName() );
+ final Deployment dep = unit.getAttachment( Deployment.class );
+ this.aspect.create( dep );
+ this.aspect.start( dep );
+ }
}
@Override
public void internalUndeploy(DeploymentUnit unit)
{
- for (DeployerHook deployer : deployerHooks) deployer.undeploy(unit);
+ if ( this.isWebServiceDeployment( unit ) )
+ {
+ log.debug( this.aspect.getClass() + " undeploy: " + unit.getName() );
+ final Deployment dep = unit.getAttachment( Deployment.class );
+ this.aspect.stop( dep );
+ this.aspect.destroy( dep );
+ }
}
+ private boolean isWebServiceDeployment( final DeploymentUnit unit )
+ {
+ return unit.getAttachment( DeploymentType.class ) != null;
+ }
+
}
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-jboss-beans.xml
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-jboss-beans.xml 2009-07-01
15:00:55 UTC (rev 10274)
+++
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-jboss-beans.xml 2009-07-02
06:34:39 UTC (rev 10275)
@@ -53,91 +53,180 @@
<property name="relativeOrder">2</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
- <bean name="WSDeploymentAspectsDeployer"
class="org.jboss.wsf.container.jboss50.deployer.WSDeploymentAspectDeployer">
- <property name="relativeOrder">3</property> <!--
[JBDEPLOY-201] workaround -->
+ <!-- The AS deployment aspects wrapped in deployers -->
+ <bean name="WSContainerMetaDataDeploymentAspect"
class="org.jboss.wsf.container.jboss50.deployment.metadata.ContainerMetaDataDeploymentAspect">
+ <property name="provides">ContainerMetaData,
VFSRoot</property>
</bean>
- <!-- Register DeployerHooks with JBoss deployers -->
- <bean name="WSDeployerHook"
class="org.jboss.wsf.container.jboss50.deployer.DeployerHookImpl">
- <property
name="deploymentManagerName">WSDeploymentAspectManager</property>
- <install bean="WSDeploymentAspectsDeployer"
method="addDeployerHook">
+ <bean name="WSContainerMetaDataDeployer"
class="org.jboss.wsf.container.jboss50.deployer.WSDeploymentAspectDeployer">
+ <constructor>
<parameter>
- <this/>
+ <inject bean="WSContainerMetaDataDeploymentAspect"/>
</parameter>
- </install>
- <uninstall bean="WSDeploymentAspectsDeployer"
method="removeDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </uninstall>
- <depends>WSDeploymentAspectsDeployer</depends>
+ </constructor>
+ <property name="relativeOrder">12</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
- <!-- Each DeploymentAspectManger maintains a list of DeploymentAspects -->
- <bean name="WSDeploymentAspectManager"
class="org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl">
- <property name="name">WSDeploymentAspectManager</property>
- </bean>
-
- <!-- The container deployment aspects -->
- <bean name="WSContainerMetaDataDeploymentAspect"
class="org.jboss.wsf.container.jboss50.deployment.metadata.ContainerMetaDataDeploymentAspect">
- <property name="provides">ContainerMetaData,
VFSRoot</property>
- </bean>
-
<bean name="WSInjectionMetaDataDeploymentAspect"
class="org.jboss.wsf.container.jboss50.deployment.metadata.InjectionMetaDataDeploymentAspect">
<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.wsf.container.jboss50.deployer.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.wsf.container.jboss50.deployer.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.wsf.container.jboss50.deployer.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.wsf.container.jboss50.deployer.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="requires">LAST_DEPLOYMENT_ASPECT</property>
+ <property name="requires">
+ ContainerMetaData, ContextProperties, ContextRoot, EndpointAddress,
+ EndpointMetrics, EndpointName, EndpointRecordProcessors, InjectionMetaData,
+ RegisteredEndpoint, RuntimeLoader, URLPattern, StackEndpointHandler,
+ StackDescriptor, VirtualHosts, VFSRoot, WebMetaData, StackSpecificMetaData
+ </property>
+ <property name="provides">LifecycleHandler</property>
</bean>
+ <bean name="WSEndpointLifecycleDeployer"
class="org.jboss.wsf.container.jboss50.deployer.WSDeploymentAspectDeployer">
+ <constructor>
+ <parameter>
+ <inject bean="WSEndpointLifecycleDeploymentAspect"/>
+ </parameter>
+ </constructor>
+ <property name="relativeOrder">37</property> <!--
[JBDEPLOY-201] workaround -->
+ </bean>
+
<bean name="WSEndpointMetricsDeploymentAspect"
class="org.jboss.wsf.framework.deployment.EndpointMetricsDeploymentAspect">
<property name="provides">EndpointMetrics</property>
</bean>
+ <bean name="WSEndpointMetricsDeployer"
class="org.jboss.wsf.container.jboss50.deployer.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.wsf.container.jboss50.deployer.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.wsf.container.jboss50.deployer.WSDeploymentAspectDeployer">
+ <constructor>
+ <parameter>
+ <inject bean="WSEndpointRegistryDeploymentAspect"/>
+ </parameter>
+ </constructor>
+ <property name="relativeOrder">35</property> <!--
[JBDEPLOY-201] workaround -->
+ </bean>
+
<bean name="WSRuntimeLoaderDeploymentAspect"
class="org.jboss.wsf.container.jboss50.deployment.RuntimeLoaderDeploymentAspect">
<property name="requires">ContainerMetaData</property>
<property name="provides">RuntimeLoader</property>
</bean>
+ <bean name="WSRuntimeLoaderDeployer"
class="org.jboss.wsf.container.jboss50.deployer.WSDeploymentAspectDeployer">
+ <constructor>
+ <parameter>
+ <inject bean="WSRuntimeLoaderDeploymentAspect"/>
+ </parameter>
+ </constructor>
+ <property name="relativeOrder">19</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.wsf.container.jboss50.deployer.WSDeploymentAspectDeployer">
+ <constructor>
+ <parameter>
+ <inject bean="WSURLPatternDeploymentAspect"/>
+ </parameter>
+ </constructor>
+ <property name="relativeOrder">15</property> <!--
[JBDEPLOY-201] workaround -->
+ </bean>
+
<bean name="WSWebAppDeploymentAspect"
class="org.jboss.wsf.container.jboss50.transport.WebAppDeploymentAspect">
<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.wsf.container.jboss50.deployer.WSDeploymentAspectDeployer">
+ <constructor>
+ <parameter>
+ <inject bean="WSWebAppDeploymentAspect"/>
+ </parameter>
+ </constructor>
+ <property name="relativeOrder">33</property> <!--
[JBDEPLOY-201] workaround -->
+ </bean>
+
<bean name="WSWebAppGeneratorDeploymentAspect"
class="org.jboss.wsf.container.jboss50.transport.WebAppGeneratorDeploymentAspect">
<property name="requires">VirtualHosts,URLPattern</property>
<property name="provides">WebMetaData</property>
@@ -145,32 +234,18 @@
<property name="securityHandlerEJB3"><inject
bean="WSSecurityHandlerEJB3"/></property>
</bean>
+ <bean name="WSWebAppGeneratorDeployer"
class="org.jboss.wsf.container.jboss50.deployer.WSDeploymentAspectDeployer">
+ <constructor>
+ <parameter>
+ <inject bean="WSWebAppGeneratorDeploymentAspect"/>
+ </parameter>
+ </constructor>
+ <property name="relativeOrder">32</property> <!--
[JBDEPLOY-201] workaround -->
+ </bean>
+
<!-- Deployment aspect helper beans -->
<bean name="WSSecurityHandlerEJB21"
class="org.jboss.wsf.container.jboss50.deployment.tomcat.SecurityHandlerEJB21"/>
<bean name="WSSecurityHandlerEJB3"
class="org.jboss.wsf.container.jboss50.deployment.tomcat.SecurityHandlerEJB3"/>
<bean name="WSWebMetaDataModifier"
class="org.jboss.wsf.container.jboss50.deployment.tomcat.WebMetaDataModifierImpl"/>
- <!-- Deployment aspect installers -->
- <bean name="WSDeploymentAspectInstaller"
class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller">
- <property name="manager"><inject
bean="WSDeploymentAspectManager"/></property>
- <property name="sortAspectsOnCreate">false</property>
- <property name="aspects">
- <set class="java.util.HashSet"
elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect">
- <inject bean="WSContainerMetaDataDeploymentAspect"/>
- <inject bean="WSVirtualHostDeploymentAspect"/>
- <inject bean="WSInjectionMetaDataDeploymentAspect"/>
- <inject bean="WSContextRootDeploymentAspect"/>
- <inject bean="WSEndpointAddressDeploymentAspect"/>
- <inject bean="WSEndpointMetricsDeploymentAspect"/>
- <inject bean="WSEndpointNameDeploymentAspect"/>
- <inject bean="WSEndpointRegistryDeploymentAspect"/>
- <inject bean="WSURLPatternDeploymentAspect"/>
- <inject bean="WSWebAppDeploymentAspect"/>
- <inject bean="WSWebAppGeneratorDeploymentAspect"/>
- <inject bean="WSEndpointLifecycleDeploymentAspect"/>
- <inject bean="WSRuntimeLoaderDeploymentAspect"/>
- </set>
- </property>
- </bean>
-
</deployment>