org.ow2.petals.jbi.management.task
Class AbstractCheckPackageTask

java.lang.Object
  extended by org.ow2.petals.jbi.management.task.AbstractLoggableTask
      extended by org.ow2.petals.jbi.management.task.AbstractCheckPackageTask
All Implemented Interfaces:
Task
Direct Known Subclasses:
ComponentCheckPackageTask, SACheckPackageTask, SLCheckPackageTask

public abstract class AbstractCheckPackageTask
extends AbstractLoggableTask

This task checks the validity of a package to install.
Inputs : unzipped package root File
Outputs : Entity name (String), Jbi
The task has got a non-robust approach : it stops at the first subtask failed
and have the undo capability.

Author:
ofabre, Frederic Gardes - eBM Websourcing

Field Summary
 
Fields inherited from class org.ow2.petals.jbi.management.task.AbstractLoggableTask
log
 
Constructor Summary
AbstractCheckPackageTask(org.ow2.petals.util.LoggingUtil log)
           
 
Method Summary
protected abstract  void checkPackage(org.ow2.petals.jbi.descriptor.original.generated.Jbi descriptor, java.io.File packageFile)
           
 void execute(Context context)
          Launch the task with the given context.
protected abstract  java.lang.String extractEntityName(org.ow2.petals.jbi.descriptor.original.generated.Jbi descriptor)
           
protected  java.lang.String extractEntityVersion(org.ow2.petals.jbi.descriptor.original.generated.Jbi descriptor)
           
 void undo(Context context)
          Reverse the task in order to retrieve the environ state before execution of this task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCheckPackageTask

public AbstractCheckPackageTask(org.ow2.petals.util.LoggingUtil log)
Method Detail

execute

public void execute(Context context)
             throws java.lang.Exception
Description copied from interface: Task
Launch the task with the given context. Task can modify information included in this context during execution.

Parameters:
context - the execution context handling input and output information
Throws:
java.lang.Exception - if an error occurs during Task processing

extractEntityName

protected abstract java.lang.String extractEntityName(org.ow2.petals.jbi.descriptor.original.generated.Jbi descriptor)

extractEntityVersion

protected java.lang.String extractEntityVersion(org.ow2.petals.jbi.descriptor.original.generated.Jbi descriptor)

checkPackage

protected abstract void checkPackage(org.ow2.petals.jbi.descriptor.original.generated.Jbi descriptor,
                                     java.io.File packageFile)
                              throws org.ow2.petals.kernel.api.server.PetalsException
Throws:
org.ow2.petals.kernel.api.server.PetalsException

undo

public void undo(Context context)
          throws java.lang.Exception
Description copied from interface: Task
Reverse the task in order to retrieve the environ state before execution of this task.

Parameters:
context - the execution context handling input and output information
Throws:
java.lang.Exception - if an error occurs during Task unprocessing


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.