4.0

Table Of Contents
Manage Plug-In Events
The plug-in adapter manages the events that occur in the plugged-in technology by defining event generators
and event publishers.
Prerequisites
n
Create a public constructor that implements the IPluginAdaptor interface.
n
Instantiate the plug-in factory.
Procedure
1 Define the method to generate plug-in events.
You can define the events to manage directly in the adapter implementation. However, the solar system
plug-in implementation defines the events in a separate class, SolarSystemEventGenerator.
SolarSystemAdapter defines the following getEventGenerator() method to obtain an instance of the
SolarSystemEventGenerator class.
private SolarSystemEventGenerator getEventGenerator() {
return SolarSystemEventGenerator._solarSystemEventGenerator;
}
2 (Optional) If Orchestrator monitors the plugged-in application for events, you can register an instance of
the IPluginEventPublisher interface with the Orchestrator policy engine by calling the
IPluginAdaptor.registerEventPublisher() method.
The solar system example adapter creates the following IPluginEventPublisher instance and registers it
with the Orchestrator policy engine by calling the SolarSystemEventGenerator.addPolicyElement()
method.
public void registerEventPublisher(
String type, String id, IPluginEventPublisher publisher) {
getEventGenerator().addPolicyElement(type, id, publisher);
}
3 (Optional) Unregister an IPluginEventPublisher from the Orchestrator policy engine.
The solar system example adapter unregisters an IPluginEventPublisher instance and removes it from
the Orchestrator policy engine by calling the SolarSystemEventGenerator.removePolicyElement()
method.
public void unregisterEventPublisher(
String type, String id, IPluginEventPublisher publisher) {
getEventGenerator().removePolicyElement(type, id, publisher);
}
You instantiated an event generator and optionally defined methods to register and unregister an event
publisher with the Orchestrator policy engine.
What to do next
Add and remove watchers that monitor workflow triggers. When the events that the workflow triggers define
occur, Orchestrator notifies any workflows that are waiting for that event.
Chapter 7 Developing Plug-Ins
VMware, Inc. 189