About Java Export Object Examples

An IDL object can wrapped for use in a Java application using the Export Bridge Assistant. For valuable information on the theory and architecture of a wrapper object created by the Export Bridge Assistant, see Using the Export Bridge Assistant.

This chapter provides several Java examples that incorporate the use of Java export objects. These include:

The general process for each of these examples involves the following:

  1. Create the object in IDL.
  2. Export the object using the Export Bridge Assistant, which creates the files associated with the IDL object that is now wrapped in a Java export object wrapper.
  3. Access the object in a Java application.This functionality automatically includes stock methods (described in Using Exported Java Objects) in addition to custom methods you have chosen to export.
  4. Compile and execute the application with a classpath reference to javaidlb.jar.
  5. Note
    See Writing IDL Objects for Exporting for information on how to create custom IDL objects that can be successfully exported using the Export Bridge Assistant. There are important object method and data type requirements that must be met.

    Note
    When you distribute an application, you will also need to share:
         – the executable (.class) file(s) including those generated by the Assistant
         – the .pro or .sav file that contains the custom IDL object definition
    Any .pro or .sav files included with your application must be located in the IDL path. Also, IDL_DIR/resource/bridges/export/java/javaidlb.jar must be in the Java classpath.

Note on Running the Java Examples

Examples in this section provide Windows-style compile javac (compile) and java (run) commands. If you are running on a platform other than Windows, use your platform's path and directory separators and see Java Requirements for information about the bridge_setup file, which sets additional information.

Debugging Applications Using Export Objects

It can be challenging to determine what is happening in the IDL process associated with a wrapper object without the debugging features of the IDL Workbench. For access to valuable debug information, consider using the IDL_BRIDGE_DEBUG environment variable, described in Debugging Java Wrapper Objects.