Package org.silverpeas.core.process

Provides an API for executing one or several processes that implement SilverpeasProcess @see SilverpeasProcess. This API has been created for chaining within a single applicative transaction different processes (processes dealing with database and file systems together for example) and applying global validations (@see ProcessCheck) on output (if any) of processes (Quota disk for example). SilverpeasProcess is an interface which has to be implemented by each process (or task in other words) that has to be taken in charge by this API. It offers methods whose the following three : For now, it exists two types of SilverpeasProcess : @see ProcessType The execution of processes is done by the 'execute' methods of ProcessManagement class. (@see ProcessManagement) Two abstractions of SilverpeasProcess interface exists for now. One is oriented on data manipulations such as database registring. An other one is oriented on file system manipulations. This last abstraction implements definitively the 'process' method and offers a new abstract method 'processFile' with FileHandler parameter (@see FileHandler). As concrete API using example, let's taken the photo creation functionnality of the Gallery application. In a first time, create the transactional service which will contain all directives of photo data registering (createMedia as example). In a second time, create the different Silverpeas processes :
  • one process to register the photo in database
  • one process to register the photo on file system
  • ...
  • one process to handle photo indexes
Be sure all data that have to be persisted in database and all files that have to be saved on file system are handled by Silverpeas processes. Finally, chaining the different processes previously created (@see ProcessList) and executing the resulting chain with services of ProcessManagement @see ProcessManagement.