com.ibm.streams.operator.model
Annotation Type SharedLoader
-
@Target(value=TYPE) @Retention(value=RUNTIME) @Documented @Inherited public @interface SharedLoader
Declare if the class loader for a Java primitive operator is shared within an processing element.
Invocations of operators with classes annotated withSharedLoader
withvalue=true
share aClassLoader
with other operator invocations with an identical set of library dependencies. This is typically the same operator kind or operator kinds from the same toolkit, that depend on the same set of jar files.
Operator classes not annotated withSharedLoader
or annotated withSharedLoader
withvalue=false
result in each operator invocation have its own class loader.
Operator classes must be annotated to have a shared class loader:
- If they load a dynamic library, see
Runtime.loadLibrary
. - If they depend on a class or jar file that loads a dynamic library.
Using a shared class loader reduces overhead for a Java primitive operator when multiple invocations are fused into a single processing element.This annotation is inherited so if any parent class is annotated simply
@SharedLoader
then the operator's invocations will use a shared class loader. A specific operator class can force a class loader for each invocation by annotating itself@SharedLoader(false)
. Note the default without any annotation is to have a class loader for each invocation.- Since:
- InfoSphere® Streams Version 3.2.1
- See Also:
Libraries
- If they load a dynamic library, see
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element and Description boolean
value
Share a class loader between invocations of the annotated operator class.
-