Developing Sun Master Indexes

Implementing Master Index Custom Plug-ins

Custom plug-ins allow you to incorporate custom code into your master index application. When you create a custom plug-in for a master index application, you define the package and class names. To incorporate the plug-ins into the master index application, you then specify the fully qualified class name of the class in the appropriate configuration file. For example, if you create a custom plug-in named MergePolicy in the package com.sun.mdm.index.update, the value to enter for the class in update.xml is com.sun.mdm.index.update.MergePolicy.


Note –

You can create custom plug-ins that define custom processing or that define custom components. For additional information about how to implement specific custom-plug ins, see the following topics:


You create a custom plug-in by composing Java code in a source file using the NetBeans editor. Create the file in the Source Package folder of the EJB project associated with the master index application. Before you begin, determine the name of the package and class for the plug-in.

ProcedureTo Create Custom Plug-ins

  1. In the NetBeans Projects window, expand project_name-ejb (where project_name is the name of the main master index project.

  2. To create a new package for the custom plug-in files, do the following:

    1. Right-click Source Packages, point to New, and then click Java Package.

    2. Enter the package name and location, and then click Finish.

  3. To create the plug-in, do the following for each source file:

    1. Under Source Packages, right-click the name of the package to which the new class will belong.

    2. Point to New, and then click Java Class.

    3. Enter the class name, verify the remaining fields, and then click Finish.

      The new file appears in the NetBeans editor.

    4. Create the custom processing rules using Java code.

    5. When you are finished coding, save and close the file.

    6. In the Projects window, right-click the file and then click Compile.

      The output and status of the compiling process appears in the bottom panel.


      Note –

      If you do not compile a custom plug-in file, building the master index project will compile the files.


  4. Specify the name of the custom plug-in in the appropriate master index configuration file.


    Note –

    If you modify a custom plug-in, be sure to recompile the file and regenerate the application to incorporate the changes. If the project has already been built, rebuild the project to add the custom plug-in to the EJB .jar file.