Developing Apama Applications > Developing Adapters > Using the IAF > The IAF configuration file > Java configuration (optional)
Java configuration (optional)
Transport and codec plug-ins written in Java are executed by the IAF inside an embedded Java Virtual Machine (JVM). The optional <java> element allows the environment of this JVM to be configured.
The <java> element may contain zero or more of the following nested elements:
*<classpath> – This element adds a single entry onto the JVM classpath, which is the list of paths used by Java to locate classes. Each <classpath> element has a single path attribute that specifies a directory or Java Archive file (.jar) to add to the classpath.
The full classpath used by the IAF’s JVM is made up by concatenating (in order):
1. the contents of the APAMA_IAF_CLASSPATH environment variable if one is defined,
2. each of the path entries specified by <classpath> elements, in the order they appear in the configuration file, OR if there are none, the contents of the CLASSPATH environment variable,
3. the path of the lib/JPlugin_internal.jar file used internally by the IAF.
Additionally, if a jarName attribute is used in the <codec> or <transport> element that defines a plug-in (as in Transport and codec plug-in configuration), the plug-in will be loaded using a new classloader with access to the specified Java Archive in addition to the JVM classpath.
You should make sure that all shared classes are in a separate jar that is specified by a <classpath> element. The shared classes are then loaded by the parent classloader. This ensures that when a codec or transport references a shared class, they both agree it is the same class.
*<jvm-option> - This element allows arbitrary JVM command line options to be specified. The JVM option should be placed between the start and end jvm-option tags, e.g.
<jvm-option>-Xmx256m</jvm-option>
See the usage screen of the JVM’s Java executable for a full list of supported options.
*<property> - This element specifies a Java system property that should be passed to the JVM. It has name and value attributes, such that using:
<property name="propName" value="propValue"/>
is a shorthand equivalent to:
<jvm-option>-DpropName=propValue</jvm-option>
See The IAF runtime for a description of how the IAF selects the JVM library to use.
The properties specified in the <java> element cannot be changed once the JVM has been loaded by the IAF. This will occur when the IAF reads a configuration file that specifies a Java transport or codec plug-in. If the same IAF process is later reconfigured to use only C/C++ transports, the JVM will not be unloaded. The IAF will log a warning message if a reconfiguration of the IAF process attempts to change the previously configured JVM properties.
Copyright © Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its Subsidiaries and or/its Affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.