<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">

<chapter id="deployment">
  <title>Bean Deployment - deploying beans</title>
  <authorblurb>
    <simpara>
      <author>
        <firstname>Scott</firstname>
        <surname>Stark</surname>
      </author>
    </simpara>
  </authorblurb>

  <para>The bean deployer provides routines for deploying beans. TODO:
    translate/expand the wiki into this doc.
    <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss5DeploymentFramework">JBoss5DeploymentFramework</ulink>
  </para>
  
  <sect1>
    <title>Design Overview</title>
    <para>
    The JBoss5 virtual deployemnt framework takes the aspect oriented design of
    many of the earlier JBoss containers and applies it to the deployment layer.
    It is also based on the POJO microntainer rather than JMX as in previous
    releases. For an overview of the classes as a UML diagram see
    JBoss5DeploymentFrameworkClasses. The key classes in that diagram are:
    <variablelist>
      <varlistentry>
        <term>MainDeployer</term>
        <listitem><para>this interface defines the contract for the MainDeployer.
        The MainDeployer handles parsing of deployment archives into Deployment
        instances and deployment of those instances into the microcontainer.
        This in is an update of the JMX based MainDeployer from earlier versions
        to a one based on the Microcontainer, JBoss5VirtualFileSystem, and
        Virtual Deployment Framework(VDF). Deployers are registered with the
        MainDeployer as an ordered list of deployers. MainDeployer contains two
        sets of deployers:
          <itemizedlist>
            <listitem><para>StructureDeployers : used to analyze the structure
            of a DeploymentContext when addDeploymentContext(DeploymentContext)
            is invoked. For each StructureDeployer the
            determineStructure(DeploymentContext) method is invoked to analyze
            the deployment. A StructureDeployer? returns true to indicate that
            the deployment was recognized and no further StructureDeployer
            should analyze the DeploymentContext.
            </para></listitem>
            <listitem><para>Deployers used to translate a DeploymentUnit into a
            runtime kernel beans when the MainDeployer.process is run. The
            Deployer methods are:
            
            <itemizedlist>
              <listitem><para>boolean isRelevant() :does the deployer want to process the unit</para></listitem>
              <listitem><para>prepareDeploy() : take the new deployment to the ready stage</para></listitem>
              <listitem><para>prepareUndeploy() : get ready to undeploy</para></listitem>
              <listitem><para>handoff(new, old) : handover control from new to old</para></listitem>
              <listitem><para>commitDeploy() : new deployment is now in control</para></listitem>
              <listitem><para>commitUndeploy() : old deployment is out of here</para></listitem>
              <listitem><para>getRelativeOrder() : specify the relative order of the deployer in a chain</para></listitem>            
            </itemizedlist>
              </para></listitem>
            </itemizedlist>
        </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>DeploymentUnit</term>
        <listitem><para>a representation of a runtime unit of work a Deployer operates on.</para></listitem>
      </varlistentry>
      <varlistentry>
        <term>DeploymentContext</term>
        <listitem><para>a representation of structural aspects of deployable content.</para></listitem>
      </varlistentry>
      <varlistentry>
        <term>ManagedObject</term>
        <listitem><para>a representation of the manageable properties for a deployment.</para></listitem>
      </varlistentry>
      <varlistentry>
        <term>VFS</term>
        <listitem><para>the api for representing the read-only file system of the deployment.</para></listitem>
      </varlistentry>
      <varlistentry>
        <term>VirtualFile</term>
        <listitem><para>the api for a file in the deployment.</para></listitem>
      </varlistentry>
      <varlistentry>
        <term>DomainClassLoader</term>
        <listitem><para>A generalization of the legacy JMX based unified class loading model. This is still in progress. The org.jboss.vfs.classloding.</para></listitem>
      </varlistentry>
    </variablelist>
    </para>      
  </sect1>

  <sect1>
    <title>Current StructureDeployers
      <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss5StructureDeployerClasses">JBoss5StructureDeployerClasses</ulink></title>

    <para>
      <itemizedlist>
        <listitem><para>org.jboss.deployers.plugins.structure.vfs.AbstractStructureDeployer</para></listitem>
        <listitem><para>org.jboss.deployers.plugins.structure.vfs.explicit.DeclaredStructure</para></listitem>
        <listitem><para>org.jboss.deployers.plugins.structure.vfs.file.FileStructure</para></listitem>
        <listitem><para>org.jboss.deployers.plugins.structure.vfs.jar.JARStructure</para></listitem>
        <listitem><para>org.jboss.deployers.plugins.structure.vfs.war.WARStructure</para></listitem>
        <listitem><para>org.jboss.deployment.EARStructure</para></listitem>
      </itemizedlist>        
    </para>      
  </sect1>

  <sect1>
    <title>Current Deployers</title>
    
      <para>
        <itemizedlist>
          <listitem><para>org.jboss.deployers.plugins.deployers.kernel.BeanDeployer</para></listitem>
          <listitem><para>org.jboss.deployers.plugins.deployers.kernel.KernelDeploymentDeployer</para></listitem>
          <listitem><para>org.jboss.deployers.plugins.deployers.kernel.BeanMetaDataDeployer</para></listitem>
          <listitem><para>org.jboss.deployers.plugins.deployers.kernel.BeanMetaDataDeployer</para></listitem>
          <listitem><para><ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=ServiceDeployments">ServiceDeployments</ulink>
            <itemizedlist>
              <listitem><para>org.jboss.system.deployers.SARDeployer</para></listitem>
              <listitem><para>org.jboss.system.deployers.ServiceClassLoaderDeployer</para></listitem>
              <listitem><para>org.jboss.system.deployers.ServiceDeploymentDeployer</para></listitem>
              <listitem><para>org.jboss.system.deployers.ServiceDeployer</para></listitem>
            </itemizedlist>
            </para>
            </listitem>
            <listitem><para><ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss5WebDeployments">JBoss5WebDeployments</ulink>
              <itemizedlist>
                <listitem><para>org.jboss.deployment.WebAppParsingDeployer</para></listitem>
                <listitem><para>org.jboss.deployment.JBossWebAppParsingDeployer</para></listitem>
                <listitem><para>org.jboss.web.tomcat.tc6.deployers.TomcatDeployer</para></listitem>
              </itemizedlist>
              </para>
              </listitem>
              <listitem><para>org.jboss.resource.deployers.RARDeployer</para></listitem>
              <listitem><para>org.jboss.resource.deployers.RARParserDeploye</para></listitem>              
      </itemizedlist>
      </para>
  </sect1>
  
  <sect1>
    <title> Deployer Helper/Base Classes JBoss5BaseDeployerClasses</title>

    <para></para>
    <sect2>
      <title>AbstractDeployer</title>
      <para></para>
    </sect2>
  </sect1>
</chapter>
