Author: richard.opalka(a)jboss.com
Date: 2009-06-30 05:21:16 -0400 (Tue, 30 Jun 2009)
New Revision: 10256
Added:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/WSDeploymentAspectDeployer.java
Removed:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractWebServiceDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/WSPhaseOneDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/WSPhaseTwoDeployer.java
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/RuntimeLoaderDeploymentAspect.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 the notion of two phase deployers (WIP)
Deleted:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractWebServiceDeployer.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractWebServiceDeployer.java 2009-06-30
09:12:54 UTC (rev 10255)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/AbstractWebServiceDeployer.java 2009-06-30
09:21:16 UTC (rev 10256)
@@ -1,68 +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.spi.deployer.helpers.AbstractComponentDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.logging.Logger;
-
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * This is the deployer that calls the registered DeployerHooks
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 24-Apr-2007
- */
-public abstract class AbstractWebServiceDeployer<T> extends
AbstractComponentDeployer
-{
- // provide logging
- private static final Logger log = Logger.getLogger(AbstractWebServiceDeployer.class);
-
- private List<DeployerHook> deployerHooks = new
LinkedList<DeployerHook>();
-
- public void addDeployerHook(DeployerHook deployer)
- {
- log.debug("Add deployer hook: " + deployer);
- deployerHooks.add(deployer);
- }
-
- 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);
- }
-
- @Override
- public void internalUndeploy(DeploymentUnit unit)
- {
- for (DeployerHook deployer : deployerHooks) deployer.undeploy(unit);
- }
-}
Added:
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
(rev 0)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/WSDeploymentAspectDeployer.java 2009-06-30
09:21:16 UTC (rev 10256)
@@ -0,0 +1,86 @@
+/*
+ * 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 java.util.LinkedList;
+import java.util.List;
+
+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;
+
+/**
+ * The phase one web service deployer.
+ *
+ * @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 List<DeployerHook> deployerHooks = new
LinkedList<DeployerHook>();
+
+ /**
+ * Constructor.
+ */
+ public WSDeploymentAspectDeployer()
+ {
+ super();
+
+ // inputs
+ this.addInput( JBossWebMetaData.class );
+ this.addInput( Deployment.class );
+
+ // outputs
+ this.addOutput( JBossWebMetaData.class );
+ }
+
+ public void addDeployerHook(DeployerHook deployer)
+ {
+ log.debug("Add deployer hook: " + deployer);
+ deployerHooks.add(deployer);
+ }
+
+ 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);
+ }
+
+ @Override
+ public void internalUndeploy(DeploymentUnit unit)
+ {
+ for (DeployerHook deployer : deployerHooks) deployer.undeploy(unit);
+ }
+
+}
Deleted:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/WSPhaseOneDeployer.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/WSPhaseOneDeployer.java 2009-06-30
09:12:54 UTC (rev 10255)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/WSPhaseOneDeployer.java 2009-06-30
09:21:16 UTC (rev 10256)
@@ -1,52 +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.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.wsf.spi.deployment.Deployment;
-
-/**
- * The phase one web service deployer.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
- */
-@SuppressWarnings("unchecked")
-public class WSPhaseOneDeployer extends AbstractWebServiceDeployer
-{
-
- /**
- * Constructor.
- */
- public WSPhaseOneDeployer()
- {
- super();
-
- // inputs
- this.addInput( JBossWebMetaData.class );
- this.addInput( Deployment.class );
-
- // outputs
- this.addOutput( JBossWebMetaData.class );
- }
-
-}
Deleted:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/WSPhaseTwoDeployer.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/WSPhaseTwoDeployer.java 2009-06-30
09:12:54 UTC (rev 10255)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployer/WSPhaseTwoDeployer.java 2009-06-30
09:21:16 UTC (rev 10256)
@@ -1,49 +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.web.deployers.WarDeployment;
-import org.jboss.wsf.spi.deployment.Deployment;
-
-/**
- * The phase two web service deployer.
- *
- * @author Heiko.Braun(a)jboss.com
- * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
- */
-@SuppressWarnings("unchecked")
-public class WSPhaseTwoDeployer extends AbstractWebServiceDeployer
-{
-
- /**
- * Constructor.
- */
- public WSPhaseTwoDeployer()
- {
- super();
-
- // inputs
- this.addInput( Deployment.class );
- this.addInput( WarDeployment.class );
- }
-
-}
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/RuntimeLoaderDeploymentAspect.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/RuntimeLoaderDeploymentAspect.java 2009-06-30
09:12:54 UTC (rev 10255)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/RuntimeLoaderDeploymentAspect.java 2009-06-30
09:21:16 UTC (rev 10256)
@@ -21,48 +21,21 @@
*/
package org.jboss.wsf.container.jboss50.deployment;
-import org.jboss.metadata.ejb.jboss.JBossMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
-import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
/**
- * Determines the correct runtime loader for per deployment type
- * and makes it available through the {@link Deployment}.
+ * Determines the correct runtime loader and makes it available through the {@link
Deployment}.
*
* @author Heiko.Braun(a)jboss.com
+ * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
*/
public class RuntimeLoaderDeploymentAspect extends DeploymentAspect
{
- public void create(Deployment dep)
+
+ public void create( final Deployment dep )
{
- // EJB3 endpoints
- if (dep.getAttachment(WebServiceDeployment.class) != null)
- {
- dep.setRuntimeClassLoader(dep.getInitialClassLoader());
- }
- // EJB21 endpoints
- else if (dep.getAttachment(JBossMetaData.class) != null)
- {
- dep.setRuntimeClassLoader(dep.getInitialClassLoader());
- }
- // JSE endpoints
- else if (dep.getAttachment(JBossWebMetaData.class) != null)
- {
- JBossWebMetaData webMetaData = dep.getAttachment(JBossWebMetaData.class);
- ClassLoader classLoader = webMetaData.getContextLoader();
- if (classLoader == null)
- {
- // [JBWS-2246] hack for .sar deployments incorporating web services
deployments on AS bootstrap.
- classLoader = dep.getInitialClassLoader();
- }
- dep.setRuntimeClassLoader(classLoader);
- }
- else
- {
- throw new IllegalArgumentException("Unable to determine runtime
loader");
- }
+ dep.setRuntimeClassLoader( dep.getInitialClassLoader() );
}
+
}
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-06-30
09:12:54 UTC (rev 10255)
+++
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-jboss-beans.xml 2009-06-30
09:21:16 UTC (rev 10256)
@@ -53,57 +53,36 @@
<property name="relativeOrder">2</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
- <bean name="WSPhaseOneDeployer"
class="org.jboss.wsf.container.jboss50.deployer.WSPhaseOneDeployer">
+ <bean name="WSDeploymentAspectsDeployer"
class="org.jboss.wsf.container.jboss50.deployer.WSDeploymentAspectDeployer">
<property name="relativeOrder">3</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
- <bean name="WSPhaseTwoDeployer"
class="org.jboss.wsf.container.jboss50.deployer.WSPhaseTwoDeployer"/>
-
<!--
Register DeployerHooks with JBoss deployers
-->
<!-- Phase 1 deployer hook -->
- <bean name="WSPhaseOneDeployerHook"
class="org.jboss.wsf.container.jboss50.deployer.DeployerHookImpl">
- <property
name="deploymentManagerName">WSPhaseOneDeploymentAspectManager</property>
- <install bean="WSPhaseOneDeployer"
method="addDeployerHook">
+ <bean name="WSDeployerHook"
class="org.jboss.wsf.container.jboss50.deployer.DeployerHookImpl">
+ <property
name="deploymentManagerName">WSDeploymentAspectManager</property>
+ <install bean="WSDeploymentAspectsDeployer"
method="addDeployerHook">
<parameter>
<this/>
</parameter>
</install>
- <uninstall bean="WSPhaseOneDeployer"
method="removeDeployerHook">
+ <uninstall bean="WSDeploymentAspectsDeployer"
method="removeDeployerHook">
<parameter>
<this/>
</parameter>
</uninstall>
- <depends>WSPhaseOneDeployer</depends>
+ <depends>WSDeploymentAspectsDeployer</depends>
</bean>
- <!-- Phase 2 deployer hook -->
- <bean name="WSPhaseTwoDeployerHook"
class="org.jboss.wsf.container.jboss50.deployer.DeployerHookImpl">
- <property
name="deploymentManagerName">WSPhaseTwoDeploymentAspectManager</property>
- <install bean="WSPhaseTwoDeployer"
method="addDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </install>
- <uninstall bean="WSPhaseTwoDeployer"
method="removeDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </uninstall>
- <depends>WSPhaseTwoDeployer</depends>
- </bean>
<!--
Each DeploymentAspectManger maintains a list of DeploymentAspects
-->
- <bean name="WSPhaseOneDeploymentAspectManager"
class="org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl">
- <property
name="name">WSPhaseOneDeploymentAspectManager</property>
+ <bean name="WSDeploymentAspectManager"
class="org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl">
+ <property name="name">WSDeploymentAspectManager</property>
</bean>
- <bean name="WSPhaseTwoDeploymentAspectManager"
class="org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl">
- <property name="parent"><inject
bean="WSPhaseOneDeploymentAspectManager"/></property>
- <property
name="name">WSPhaseTwoDeploymentAspectManager</property>
- </bean>
<!--
The container deployment aspects
@@ -186,9 +165,8 @@
<!-- Deployment aspect installers -->
- <!-- Phase 1 -->
- <bean name="WSPhaseOneDeploymentAspectInstaller"
class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller">
- <property name="manager"><inject
bean="WSPhaseOneDeploymentAspectManager"/></property>
+ <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">
@@ -204,20 +182,10 @@
<inject bean="WSURLPatternDeploymentAspect"/>
<inject bean="WSWebAppDeploymentAspect"/>
<inject bean="WSWebAppGeneratorDeploymentAspect"/>
- </set>
- </property>
- </bean>
-
- <!-- Phase 2 -->
- <bean name="WSPhaseTwoDeploymentAspectInstaller"
class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller">
- <property name="manager"><inject
bean="WSPhaseTwoDeploymentAspectManager"/></property>
- <property name="sortAspectsOnCreate">false</property>
- <property name="aspects">
- <set class="java.util.HashSet"
elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect">
<inject bean="WSEndpointLifecycleDeploymentAspect"/>
<inject bean="WSRuntimeLoaderDeploymentAspect"/>
</set>
</property>
</bean>
-
+
</deployment>