Contact Us 1-800-596-4880

Java Module 2.0 Reference

Java Module is used to invoke Java code.

Release Notes: Java Module Release Notes

Configurations


Default Configuration

Default configuration

Parameters

Name Type Description Default Value Required

Name

String

The name for this configuration. Connectors reference the configuration with this name.

x

Name

String

The identifier of this element used to reference it in other components.

x

Operations

Invoke

<java:invoke>

Invoke methods with the provided arguments in an instance. The identifier of the method to invoke includes the class and method names, being the method a full description of its signature including the types of each parameter.

For example, to invoke the echo method with the signature public String echo(String msg) that belongs to Class org.bar.Me, then the identifier of the method is echo(String).

Parameters

Name Type Description Default Value Required

Instance

Any

The instance on which the method is invoked.

x

Args

Object

The arguments used to invoke a method.

This field must be a map where the keys are the names of the method arguments and the values are the corresponding argument values.

For example, if there is a method echo with the signature public String echo(String msg, String volume), a possible value for Args is [{ msg : 'This is a message to echo', volume : 'Loud' }]. To use those argument names, the Java class must be compiled with -parameters. If not, you must use the canonical names for the arguments: [{ arg0 : 'This is a message to echo', arg1 : 'Loud' }]. You can always use the canonical name for the arguments, even if the source code is compiled with -parameters.

Output Mime Type

String

MIME type of the payload that this invocation outputs.

Output Encoding

String

Encoding of the payload that this invocation outputs.

Class

String

Represents the fully qualified name of the class containing the referenced method.

x

Method

String

Represents the method signature containing the method name and its argument types. For example, for the method with signature, public String log(String msg, boolean verbose), then the identifier of the method is log(String, boolean)

x

Target Variable

String

The name of a variable in which to place the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output, and to store the outcome of that expression in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

Output

Type

Any

Throws

  • JAVA:ARGUMENTS_MISMATCH

  • JAVA:CLASS_NOT_FOUND

  • JAVA:INVOCATION

  • JAVA:NO_SUCH_METHOD

  • JAVA:WRONG_INSTANCE_CLASS

Invoke Static

<java:invoke-static>

Operation that allows the user to invoke static methods with the provided arguments. The identifier of the method to be invoked includes the class and method names, being the method a full description of its signature including the types of each parameter.

For example, to invoke the static method echo with signature public static String echo(String msg) that belongs to Class org.bar.Me, then the identifier of the method is echo(String).

Parameters

Name Type Description Default Value Required

Args

Object

The arguments used to invoke a method.

This field must be a map where the keys are the names of the method arguments and the values are the corresponding argument values.

For example, if there is a method echo with the signature public String echo(String msg, String volume), a possible value for Args is [{ msg : 'This is a message to echo', volume : 'Loud' }]. To use those argument names, the Java class must be compiled with -parameters. If not, you must use the canonical names for the arguments: [{ arg0 : 'This is a message to echo', arg1 : 'Loud' }]. You can always use the canonical name for the arguments, even if the source code is compiled with -parameters.

Output Mime Type

String

MIME type of the payload that this invocation outputs.

Output Encoding

String

Encoding of the payload that this invocation outputs.

Class

String

Represents the fully qualified name of the Class containing the referenced Method.

x

Method

String

Represents the Method signature containing the method name and its argument types. For example, for the method with signature public static String log(String msg, boolean verbose), then the identifier of the method is log(String, boolean).

x

Target Variable

String

The name of a variable in which to place the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output, and to store the outcome of that expression in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

Output

Type

Any

Throws

  • JAVA:CLASS_NOT_FOUND

  • JAVA:ARGUMENTS_MISMATCH

  • JAVA:INVOCATION

  • JAVA:NO_SUCH_METHOD

New

<java:new>

Create a new instance of a class.

The identifier of a Constructor includes the class and constructor names, and the constructor has a full description of its signature including the types of each parameter.

For example, to invoke the constructor Me(String name, int age) which belongs to the org.bar.Me class, then the identifier of the method is Me(String,int).

Parameters

Name Type Description Default Value Required

Args

Object

The arguments used to invoke the given Constructor

Class

String

Represents the fully qualified name of the Class containing the referenced Method.

x

Constructor

String

Represents the Constructor signature that contains the name and its argument types. For example, for the Constructor with the public Me(String name, Integer age) signature, then the identifier of the method is Me(String, Integer).

x

Target Variable

String

The name of a variable in which to place the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output, and to store the outcome of that expression in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

Output

Type

Any

Throws

  • JAVA:ARGUMENTS_MISMATCH

  • JAVA:CLASS_NOT_FOUND

  • JAVA:NO_SUCH_CONSTRUCTOR

  • JAVA:NOT_INSTANTIABLE_TYPE

Validate Type

<java:validate-type>

Validate that an instance is an instanceof a class.

Parameters

Name Type Description Default Value Required

Class

String

Instance

Any

The object whose type is expected to be an instanceof of a class.

x

Accept Subtypes

Boolean

Whether or not to accept subtypes of a class, or if the instance has to be of the exact same class.

true

Error Mappings

Array of Error Mapping

Set of error mappings.

Throws

  • JAVA:CLASS_NOT_FOUND

  • JAVA:WRONG_INSTANCE_CLASS

Types

Error Mapping

Field Type Description Default Value Required

Source

Enumeration, one of:

  • ANY

  • REDELIVERY_EXHAUSTED

  • TRANSFORMATION

  • EXPRESSION

  • SECURITY

  • CLIENT_SECURITY

  • SERVER_SECURITY

  • ROUTING

  • CONNECTIVITY

  • RETRY_EXHAUSTED

  • TIMEOUT

Source of the error mapping.

Target

String

Target of the error mapping.

x

View on GitHub