Write the Java source file

In the component implementation, create a Java method for each IDL operation in the component’s client interfaces. When you code the parameters for each method, use the Java types that correspond to the IDL operation parameters. See “Java IDL datatype mappings”.

In the Java component, component interface methods must be public and cannot be declared static. If the IDL definition of the method has a non-empty raises clause, the Java method must throw equivalent Java exceptions for the IDL exceptions listed in the raises clause.

The component implementation class must be in a Java package. You cannot define components implemented by classes in the default package.

StepsImplementing the component

  1. Generate Java interface files for IDL types – If your IDL uses types that are not predefined in EAServer, generate Java types from the IDL interface files.

  2. Add package import statements – Import the packages that contain the classes that you need to use in your Java class.

  3. Code the constructor – Provide a default constructor to be called when EAServer loads the implementation class.

  4. Add error handling code – Add code that gracefully handles errors by logging status messages and sending meaningful messages to the client.

  5. To finish up, you can use these advanced technique to polish your component implementation:

    1. Manage database connections – Connect to databases through connection caches using the Connection Management API.

    2. Return result sets – Return result sets using the EAServer Result Sets API.

    3. Issue intercomponent calls – Instantiate a Java stub to make intercomponent calls.