Write a Java plug-in


Perform the steps described in the following sections to write a Java program for your plug-in:

Before you begin

Make sure your programming environment is set up correctly. You need:

Writing a Java plug-in

  1. Create a Java project in your IDE.
  2. Include the arpluginsvrVerNum.jar file in the AR System server.
  3.  API library directory in the CLASSPATH.
    For the directory location, see Installed-plug-in-components.
  4. Create a new class that will implement one of the interfaces listed in Creating-Java-plug-ins, or extend one of the abstract classes listed in that section.
  5. Import the com.bmc.arsys.pluginsvr.plugins and com.bmc.arsys.api.* packages and other packages, such as java.util.List, into your program.
  6. Implement the methods of the interface or abstract class you are using. 
    See the Java plug-in API online documentation located at ARSystemServerInstallDir\ARserver\api\javaplugins\arpluginsdocVerNum.jar for details, and consider these tips:

    Best Practices

    • When implementing the init() and initialize() methods, do not put the plug-in into a long loop to wait to connect to the AR System server or another server. Such loops prevent the Java plug-in server from finishing its initialization. To determine whether the plug-in has been instantiated inside the plug-in server, the plug-in server must receive a return from init() or initialize(), or an exception. If the plug-in server learns that the method failed to instantiate the plug-in, it can still instantiate its other plug-ins and complete its initialization. The failed plug-in, however, will be unable to receive calls.
    • If a plug-in must perform a long process, such as establishing a database connection, before the plug-in can accept a call, create a separate thread for the process so that the init() and initialize() methods are not blocked. If the plug-in receives any call other than init() and initialize() before it completes the process, the plug-in can generate an ARException to notify the caller that it is not ready and to tell the caller its current state. When it is ready, it can process the call.
    • To enable the Java plug-in server to load and instantiate all plug-ins inside the plug-in server, a plug-in should not throw a runtime exception or an ARException from the init() and initialize() methods for non-fatal errors.
  7. Add an entry that identifies the plug-in to the plug-in server configuration file. For more information, see Configuring-the-Java-plug-in-server.
  8. If the Java plug-in uses native libraries, perform one of the following actions:
    • Include the native libraries in the PATH variable. On UNIX, include the native libraries in the LD_LIBRARY_PATH (Solaris and Linux) or LIBPATH (AIX) environment variable.
    • If the libraries need to know the remote host character set, call the getRemoteHostCharSet() method of the ARPluginContext object. For more information, see the Java plug-in API online documentation located at ARSystemServerInstallDir\ARserver\api\javaplugins\arpluginsdocVerNum.jar.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*