Class FileBasedWorkflowRepository

  • All Implemented Interfaces:
    WorkflowRepository, org.copperengine.management.FileBasedWorkflowRepositoryMXBean, org.copperengine.management.WorkflowRepositoryMXBean

    public class FileBasedWorkflowRepository
    extends AbstractWorkflowRepository
    implements WorkflowRepository, org.copperengine.management.FileBasedWorkflowRepositoryMXBean
    A file system based workflow repository for COPPER. Workflow classes have to be deployed as Java files. They have to reside in one ore more directories or/and in one or more jarfiles. On system startup these Java files are automatically compiled and instrumented by this repository. It offers hot deployment by observing the Java files in the configured directories. In case of modifications, all Java files are compiled and instrumented again.
    • Constructor Detail

      • FileBasedWorkflowRepository

        public FileBasedWorkflowRepository()
    • Method Detail

      • setSourceArchiveUrls

        public void setSourceArchiveUrls​(java.util.List<java.lang.String> sourceArchiveUrls)
        Sets the list of source archive URLs. The source archives must be ZIP compressed archives, containing COPPER workflows as .java files.
        Parameters:
        sourceArchiveUrls - urls where workflow class sources reside in
      • addSourceArchiveUrl

        public void addSourceArchiveUrl​(java.lang.String url)
        Adds a source archive URL.
        Parameters:
        url - url to be added
      • getSourceArchiveUrls

        public java.util.List<java.lang.String> getSourceArchiveUrls()
        Specified by:
        getSourceArchiveUrls in interface org.copperengine.management.FileBasedWorkflowRepositoryMXBean
        Returns:
        the configured source archive URL(s).
      • setCompilerOptionsProviders

        public void setCompilerOptionsProviders​(java.util.List<CompilerOptionsProvider> compilerOptionsProviders)
        Sets the list of CompilerOptionsProviders. They are called before compiling the workflow files to append compiler options.
        Parameters:
        compilerOptionsProviders - Options from those providers are used for compilation.
      • addCompilerOptionsProvider

        public void addCompilerOptionsProvider​(CompilerOptionsProvider cop)
        Add a CompilerOptionsProvider. They are called before compiling the workflow files to append compiler options.
        Parameters:
        cop - Options from this provider are used for compilation.
      • getCompilerOptionsProviders

        public java.util.List<CompilerOptionsProvider> getCompilerOptionsProviders()
        Returns:
        the currently configured compiler options providers.
      • setCheckIntervalMSec

        public void setCheckIntervalMSec​(int checkIntervalMSec)
        The repository will check the source directory every checkIntervalMSec milliseconds for changed workflow files. If it finds a changed file, all contained workflows are recompiled. The default is 15 seconds.
        Parameters:
        checkIntervalMSec - check interval in milliseconds
      • setSourceDirs

        public void setSourceDirs​(java.util.List<java.lang.String> sourceDirs)
        Configures the local directory/directories that contain the COPPER workflows as .java files.
        Parameters:
        sourceDirs - List of those source directories
      • setSourceDirs

        public void setSourceDirs​(java.lang.String... sourceDirs)
        Configures the local directory/directories that contain the COPPER workflows as .java files.
        Parameters:
        sourceDirs - List of those source directories
      • getSourceDirs

        public java.util.List<java.lang.String> getSourceDirs()
        Specified by:
        getSourceDirs in interface org.copperengine.management.FileBasedWorkflowRepositoryMXBean
        Returns:
        the configured local directory/directories
      • setLoadNonWorkflowClasses

        public void setLoadNonWorkflowClasses​(boolean loadNonWorkflowClasses)
        Parameters:
        loadNonWorkflowClasses - If true (which is the default), this workflow repository's class loader will also load non-workflow classes, e.g. inner classes or helper classes. As this is maybe not always useful, use this property to enable or disable this feature.
      • setTargetDir

        public void setTargetDir​(java.lang.String targetDir)
        The target directory where COPPER will store the compiled workflow classes (mandatory). Must point to a local directory with read/write privileges. Note: On repository startup, this directory will be deleted and created freshly. So make sure, there are no other files in there but only compilation results from COPPER.
        Parameters:
        targetDir - the target dir.
      • getTargetDir

        public java.lang.String getTargetDir()
      • setPreprocessors

        public void setPreprocessors​(java.util.List<java.lang.Runnable> preprocessors)
      • addSourceDir

        public void addSourceDir​(java.lang.String dir)
      • getClassLoader

        protected java.lang.ClassLoader getClassLoader()
      • getDescription

        public java.lang.String getDescription()
        Specified by:
        getDescription in interface org.copperengine.management.WorkflowRepositoryMXBean
      • setCompilerOptions

        public void setCompilerOptions​(java.lang.String... options)
        Sets the list of compiler options. They are called before compiling the workflow files to append compiler options (internally invokes setCompilerOptionsProviders(List).
        Parameters:
        options - list of options to be set for the compiler.
      • getLastBuildResults

        public java.lang.String getLastBuildResults()
        Specified by:
        getLastBuildResults in interface org.copperengine.management.FileBasedWorkflowRepositoryMXBean