Sun GlassFish Mobility Platform 1.1 Developer's Guide for Enterprise Connectors

Using NetBeans IDE To Create an ECBO Enterprise Connector

The simplest way to create an ECBO Enterprise Connector is to use NetBeans IDE 6.5 with the Maven plugin.

ProcedureTo Create a Maven Project for an ECBO Enterprise Connector

Before You Begin

Follow the instructions in To Install the Maven Plugin to set up NetBeans IDE.

  1. In NetBeans IDE, click the Projects tab.

  2. Choose File->New Project.

  3. In the New Project dialog, select Maven from the Categories tree.

  4. Select Maven Project from the Projects list, then click Next.

  5. On the Maven Archetype page, expand Archetypes from the remote Maven Repositories node.

  6. From the list, select MEP Connector Archetype (RAR), then click Next.

  7. On the Name and Location page, accept all the default values, then click Finish.

    The new project, mavenproject2 (rar), appears in the Projects tab.

  8. Under mavenproject2, expand the Source Packages node.

  9. Expand the com.mycompany.mavenproject2 node.

    The following class files appear:

    • MyBusinessObject.java

    • MyBusinessObjectProvider.java

    • MyBusinessObjectDeleteCommand.java

    • MyBusinessObjectInsertCommand.java

    • MyBusinessObjectUpdateCommand.java

    These files provide the required classes for an ECBO Enterprise Connector.

  10. Expand the com.mycompany.mavenproject2.rar node.

    The following class files appear:

    • Adapter.java

    • InitializationJob.java

    • ManagedConnection.java

    • ManagedConnectionFactory.java

    • Metadata.java

    These classes implement the resource adapter. The ManagedConnectionFactory.java code contains a reference to the MyBusinessObjectProvider class.

  11. Rename the classes so that they are specific to your Enterprise Connector.

  12. In the ManagedConnectionFactory.java file, provide a unique ID for the serialVersionUID field to replace the value in the file.

    This step is not required, but it is recommended.

  13. Add code to the ECBO Enterprise Connector files.

    No changes to the resource adapter files are needed other than the name and unique ID changes.

  14. Build the project.

    When you build the project, all the class files are bundled together in a RAR file.