Version 2

    Ordering of VDF Deployers

    An element of the aspectization of the deployer layer in jboss5 is that deployers need to be run in the correct order for the aspects to be constructed correctly. Currently deployers express their order by a relativeOrder property from the org.jboss.deployers.spi.OrderedDeployer interface. There are constants in the org.jboss.deployers.spi.Deployer interface that define categories of deployers for reference.

     

       /** The parser order */
       public static final int PARSER_DEPLOYER = 2000;
    
       /** The class loader order */
       public static final int CLASSLOADER_DEPLOYER = 4000;
    
       /** The postprocessing class loader order (usage: AOP) */
       public static final int POSTPROCESS_CLASSLOADING_DEPLOYER = 5000;
       
       /** The component order */
       public static final int COMPONENT_DEPLOYER = 7000; 
    
       /** The real order */
       public static final int REAL_DEPLOYER = 10000;
    
    

     

    The one clear choice you need to make for you deployer is whether you need to interact with the deployment class loader. If you do, then you need to be after the CLASSLOADER_DEPLOYER level. Note that needing to scan for annotations does not really require a class loader. The VFS+Javassist can be used for this purpose. However, until we better integrate annotations into the metadata handling framework, its easier to use the deployment class loader, or create a temporary class loader based on the deployment classpath. If you are creating temporary class loaders its critical that you do not leak them.

     

    Alternate ordering

    A future approach to ordering deployers is to use the expected input/outputs in terms of deployment attachments as a way to allow the MainDeployer to order deployers. This is still a discussion topic.

     

    Referenced by: