Startable plugins

A startable plugin is registered custom code that begins executing when a specified server run level is reached during server startup. Unlike a standard plugin, which executes only when it is invoked by other code, a startable plugin can be started and stopped as required.

A startable plugin can be used for various purposes.

  • As a daemon, such as a listener-type plugin to a JMS queue.
  • Periodic batch processing. For example, a batch process plugin to delete expired files from the file system.
  • To initialize data, such as a plugin to load configuration data into the application database.

A listener-type startable plugin is similar to a message reply plugin which processes a reply acknowledgment for a sent message. The difference between the two types of plugins is that a startable plugin begins executing during server startup, while a message reply plugin is implemented as a callback method.

Two types of startable plugins are supported.

  • A Singleton startable plugin runs in a single instance on a single server in the cluster. The server must have the startable server role. A Singleton startable plugin can begin executing at either the DAEMONS or MULTIUSER server run levels.
  • A Distributed startable plugin runs on all servers in the cluster. A Distributed startable plugin can begin executing at any server run level. For example, a Distributed startable plugin can be used to perform early configuration validation by beginning execution at the STARTING run level.

A Distributed startable plugin is defined by specifying the @Distributed annotation on the plugin’s class declaration. If the @Distributed annotation is not specified, the defined plugin is a Singleton startable plugin.