0 Replies Latest reply on Apr 15, 2010 9:56 PM by alrubinger

    ShrinkWrapDeployer: A MainDeployer adaptor for Archives

    alrubinger

      The next step forward in getting an Arquillian Container for Reloaded is to support deployment of ShrinkWrap archives into MainDeployer.  Bailey's provided us with an ArchiveFileSystem such that archives can be read directly by VFS.  All that's missing is a cute adaptor to do the mounting and unmounting as necessary, along with a pretty API for end users.

       

      JIRA:

       

      https://jira.jboss.org/jira/browse/RELOADED-14

       

      Usage:

       

      http://anonsvn.jboss.org/repos/jbossas/projects/reloaded/trunk/vdf-bootstrap-minimal/src/test/java/org/jboss/reloaded/api/ShrinkWrapDeployerUnitTest.java

       

      So we now have:

      /**
       * Deployer for ShrinkWrap {@link Archive} types.  End-user
       * view to adapt archives directly into the Virtual Deployment
       * Framework.
       *
       * @author <a href="mailto:andrew.rubinger@jboss.org">ALR</a>
       * @version $Revision: $
       */
      public interface ShrinkWrapDeployer
      {
         //-------------------------------------------------------------------------------------||
         // Contracts --------------------------------------------------------------------------||
         //-------------------------------------------------------------------------------------||
      
         /**
          * Deploys the specified archives into the Virtual Deployment Framework
          * as an atomic operation.  
          * 
          * @param archives The archives to deploy
          * @throws IllegalArgumentException If the archives are not specified (null)
          * @throws DeploymentException If an error occurred in deployment
          */
         void deploy(Archive<?>... archives) throws IllegalArgumentException, DeploymentException;
      
         /**
          * Undeploys the specified archives from the Virtual Deployment Framework.  Each
          * archive must have been previously deployed in via this {@link ShrinkWrapDeployer}
          * instance, else it will be ignored and logged as a warning.
          * 
          * @param archives The archives to undeploy
          * @throws IllegalArgumentException If the archives are not specified
          * @throws DeploymentException If an error occurred during undeployment
          */
         void undeploy(Archive<?>... archives) throws IllegalArgumentException, DeploymentException;
      
      }
      

       

      I did the prototyping under Reloaded's vdf-bootstrap-minimal module.  Could use some more tests and a proper home.

       

      S,

      ALR