Coding classes, interfaces, and JavaBeans for import

Before using the importer for the first time, you should read this section to understand how Java methods are mapped to EAServer component methods.

Determining eligible methods

Each method in a class or interface (including those inherited from a base class or interface) is inspected to see if they use allowable parameter and return types. Suitable methods are added to the component’s IDL interface. EAServer Manager displays warning dialog boxes describing any methods that are not imported. The importer accepts methods that use the following datatypes:

The method can throw any exception, but only exceptions that extend org.omg.CORBA.UserException are added to the IDL method’s raises clause.

Holders for user-defined classes and arrays For an inout parameter declared as a user-defined class or a single-dimension array, the Java method definition must use a holder class that you have created. For a user-defined class, the template for the holder class is as follows:

package comp-package;
class TypeHolder {
    Type value;
    // Default constructor:
    TypeHolder(); 
    // Initial-value constructor:
    TypeHolder(Type value); 
}

where

For an array, the template for the holder class is as follows:

package comp-package;
class TypenameHolder {
    BaseType value;
    // Default constructor:
    TypenameHolder(); 
    // Initial-value constructor:
    TypnameHolder(BaseType[] value); 
}

where:

Importing Java interfaces

Methods to be imported from a Java interface must adhere to the restrictions described in “Determining eligible methods”. In addition, the interface cannot contain any fields.

You must specify a class that implements the interface before you can run the component. Specify the implementation class name in the Component Properties window (see “Component properties: General”). Make sure that the class has a default constructor (that is, a constructor with no arguments). EAServer calls the default constructor to create new component instances.

Importing Java classes

Methods to be imported from a Java class must adhere to the restrictions described in “Determining eligible methods”. In addition, the class must have a constructor method with zero parameters. Other constructors are not called by EAServer.

NoteClasses that implement the ServerBean interface can be imported. The ServerBean methods are not added to the component’s IDL interface.

Importing JavaBeans components

To import method definitions from a JavaBeans component, you choose the Java Class option on the import screen, then specify the name of the class that implements the component.

Methods to be imported from a JavaBeans component must adhere to the restrictions described in “Determining eligible methods”. In addition, the class must have a constructor method with zero parameters. Other constructors are not imported.

The add and remove methods for the JavaBeans event listeners are not imported.