IBM InfoSphere Streams Version 4.1.0
Creating Java native functions
You create Java™ native
functions by adding Java annotations
that describe Java public static
methods as native functions to the SPL compiler.
Native functions can be invoked from SPL by using the same syntax that is used for an SPL function. For more information about creating a Java native function, see the API documentation for the com.ibm.streams.function.model package.
To create a Java native function
that can be called from an application that you create by using IBM® InfoSphere® Streams Studio,
the typical high-level steps are:
- Annotate a public static Java method by adding the @Function annotation.
- Compile the Java class that contains the method.
- Package the class and its nested classes in a .jar file in the lib or impl/lib subdirectory of the toolkit directory.
- Build the SPL project that contains the annotated Java method. When the project is built, it generates the SPL artifacts that are necessary to call the Java method from an SPL operator.
- Edit the operator to call the Java method that you added the @Function annotation to.
- Launch the build of the main composite that contains the operator.