jst j2ee

By:

Chuck Bridgham (cbridgha@us.ibm.com)
Neeraj Agrawal (nagrawal@us.ibm.com)
Vijay Bhadriraju(vbhadrir@us.ibm.com)

Introduction


This document describes the requirements and design of the proposed enhancements to the validation framework including Job integration. Most of these changes are performance related, and pushing the validation processing to the background. We also include additional enhancements to the framework.


Requirements


Performance


  1. Executing validators asynchronously (Jobs)


  2. Collect status for each validation execution.


  3. Synchronous validator support using Jobs


Required Enhancements
  1. Integration of Facet filters (facet regristration)


  2. Product/Plugin configuration

UI Requirements


  • There should be two checkboxes per validator. One that controls whether the validator runs during a manual validation and one that control whether it runs during a build (either manual or incremental). If both check boxes are unchecked the validator never runs. By default the more expensive validators will have their build time checkbox unchecked.


  • Bugzillas


  • Background Validaton
  • Post Validator
  • Facet enabled Validator
  • Preference Configuration


  • Design


    Client changes

    1. New Interface: A new interface will be added to the framework, and will need to be implemented by all client Validator authors.

      Existing IValidator api will be used if not implemented, and will not use Jobs.

      public interface IValidatorJob extends IValidator {
       
       public IStatus validateInJon(IValidationContext helper, IReporter reporter) throws ValidationException;
       public ISchedulingRule getSchedulingRule(IValidationContext helper);
       
      }				
      				

    2. Several new rules are suggested or enforced:


      Framework Changes

    1. ValidationOperation will create Job for each Validator(implementer of IValidatorJob) and start them.
      On manual invocation of validation, the ValidationOperation will execute as a Job and the existing IValidator implementors will run on the same job as ValidationOperation.

      Example displaying a Validation operation running as a job:

      			    
      where op is of type ValidationOperation, 
      ValidationJobAdapter extends Job and EmptyRule is defined above in the document.
      			    
              ValidationJobAdapter jobAdapter = new ValidationJobAdapter(op);
              EmptyRule rule = new EmptyRule(); 
              jobAdapter.setRule(rule);
              jobAdapter.setUser(true);
              jobAdapter.schedule();	
      		    
      			    
      Example of a validator job running from the framework:

      		
              Job validationJob = new Job(validator.getClass().getName())
              {
                 
                 protected IStatus run(IProgressMonitor monitor)
                 {
                      IStatus status =  validator.validate(helper, reporter, monitor);
                 
                 }
              };
              validationJob.setRule(validator.getSchedulingRule());
              validationJob.schedule();			
      		

    2. Framework changes required to support synchronous dependent validators

      The framework will schedule dependent validators as shown in the following example:

      Job validatorA = new Job("Validator A"); validatorA.schedule(); Job validatorB = new Job("Validator B"); validatorB.setProperty("ParentValidator", validatorA); validatorB.schedule();

      Validator B wont start until A finishes

      protectded IStatus run(IProgressMonitor monitor){ try{ //ValidatorB waiting on ValidatorA Job validatorA = (Job)getProperty("ParentValidator"); validatorA.join(); if( validatorA.getResult() == IStatus.OK){ //validatorA done, can continue } }catch(InterruptedException e){ } }