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 with SharedLoader with value=true share a ClassLoader 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 with SharedLoader or annotated with SharedLoader with value=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
    • 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.
    • Element Detail

      • value

        public abstract boolean value
        Share a class loader between invocations of the annotated operator class.
        Returns:
        True to shared a class loader across invocations. False to have a single class loader per invocation.
        Default:
        true