com.ibm.streams.toolkit.model

Annotation Type ToolkitLibraries



  • @Target(value=TYPE)
     @Retention(value=RUNTIME)
     @Documented
     @Inherited
    public @interface ToolkitLibraries
    Declare a set of Java class library paths to be added at execution time to the toolkit's class loader. The toolkit's class loader is used for loading SPL Java native functions declared with the Function annotation.

    A path may be one of:

    • A valid URL referring to a jar file or directory .
    • An absolute file path.
    • A file path relative to the root directory of the SPL toolkit.

    Environment variables in the path are not suppored.

    If a file path ends with "/* " then all the files in the specified directory with the extension .jar or .JAR will be added to the toolkit's class loader. The expansion occurs at execution time.
    Otherwise the file path is assumed to refer to a jar file or a directory.

    Example of including all the jar files in $DERBY_INSTALL/lib .

     
     @ToolkitLibraries({"@DERBY_INSTALL@/lib/*"})
     public class DerbyFunctions
     
     
    Note that this annotation can be inherited i.e. if specified on a class, this annotation will be inherited by any subclasses unless the subclass provides its own version of the annotation.

    The search order for classes referenced from an SPL Java native function is:

    1. The classes provided by the virtual machine's Java runtime.
    2. The Java Operator API classes and the dependent jars provided by the SPL Java runtime.
    3. The jar or directory containing the method annotated with Function, including any dependent classes from the jar's manifest Class-Path entry.
    4. The classes specified by the containing class's @ToolkitLibraries annotation. Order within value() is preserved, with the path listed first being earliest in the search order.

    When a path defined by @ToolkitLibraries ends with '/*' then all jar files in that directory are included in the search order. The order within the set of jars loaded though this mechanism is not defined, but they remain ordered with respect to the path that included them. For example: @ToolkitLibraries({"opt/a/*", "opt/b/*"}) will include all the jars in opt/a and opt/b, and all jars in opt/a are earlier in the search path than those in opt/b.

    Since:
    IBM Streams Version 4.2
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element and Description
      java.lang.String[] value
      The paths to be added to the toolkit's class loader at execution time to be used when searching for referenced Java classes.
    • Element Detail

      • value

        public abstract java.lang.String[] value
        The paths to be added to the toolkit's class loader at execution time to be used when searching for referenced Java classes.