Java Global Instance

Shared Configuration

The Java Global Instance shared configuration resource allows you to specify a Java object that can be shared across all process instances in a Java Virtual Machine (JVM). When the process engine is started, an instance of the specified Java class is constructed. When the process engine is shut down, if specified, a cleanup method is invoked on the object and the object is released before the engine shuts down. Any Java Method activity can be configured to access the shared Java Global Instance when the process engine runs. Any Java Code activity can access the shared Java Global Instance by invoking the static methods of the configured Java class.

If multiple process instances access the shared Java Global Instance, you may want to ensure that only one process instance can access the object at a time. You can accomplish this by either declaring the methods of the configured class as synchronous or by using a critical section group. For more information about using critical section groups, see TIBCO ActiveMatrix BusinessWorks™ Process Design.

Note: Java class files or archives referenced by this resource must be available to the Java VM in which TIBCO Designer and the ActiveMatrix BusinessWorks process engine are running. This is done either by adding the correct path to the classpath in the designer.tra and bwengine.tra files (For more information about modifying the classpath, see the comments in the .tra files ) or by using an Alias Library resource. If you add the path to the classpath, the system class loader loads the class into the Java VM. If you use an Alias Library resource, the ActiveMatrix BusinessWorks application class loader loads the class into the Java VM. If both techniques are used, the class loaded by the system class loader takes precedence.
Objects created from classes loaded by different class loaders are not able to interact. For example, an Alias Library resource points to the location of Java ClassA and a Java Method activity references ClassA. Java class ClassB is placed in the classpath and referenced by a Java Code activity. The Java Method activity can pass the ClassA object to the Java Code activity, but the ClassB object in the Java Code activity may not be able to interact with the ClassA object. If you want objects to interact correctly, ensure that the activities use the same class loader.