Annotation Type Libraries
-
@Target(value=TYPE) @Retention(value=RUNTIME) @Documented @Inherited public @interface Libraries
Declare a set of Java class libraries to be added to the operator's class loader at execution time. 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 of the SPL
toolkit containing the primitive operator
A path may contain an environment variable delimited by
@
characters, e.g.@DERBY_INSTALL@/lib/derby.jar
. The environment variable is evaluated during SPL compilation when the SPL application invokes aPrimitiveOperator
with this annotation. This means that the resultant path must be available on any resource (host) where the operator will execute.If a file path ends with
/*
then all the files in the specified directory with the extension.jar
or.JAR
will added to the operator'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
.@PrimitiveOperator @Libraries({"@DERBY_INSTALL@/lib/*"}) public class DerbyOp extends AbstractOperator
The search order for classes for a Java primitive operator is:
- The classes provided by the virtual machine's Java runtime (Java 6 or Java 7).
- The classes provided by the SPL Java runtime, including:
- Java Operator samples and patterns -
com.ibm.streams.operator.samples.jar
- Java Operator API -
com.ibm.streams.operator.jar
- Apache Common Math 2.2
- Apache Logging 1.2
- IBM JSON for Java
- Java Operator samples and patterns -
- The jar or directory containing the operator class annotated with
PrimitiveOperator
, including any dependent classes from the jar's manifestClass-Path
entry. - The classes specified by the operator class's
Libraries
annotation. Order withinvalue()
is preserved, with the path listed first being earliest in the search order. - Any classes added by
OperatorContext.addClassLibraries(String[])
@Libraries
oraddClassLibraries
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:@Libraries({"opt/a/*", "opt/b/*"})
will include all the jars inopt/a
andopt/b
, and all jars inopt/a
are earlier in the search path than those inopt/b
.- Since:
- InfoSphere® Streams Version 3.2
-
-
Required Element Summary
Required Elements Modifier and Type Required Element and Description java.lang.String[]
value
-