4.1

Table Of Contents
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.
Add Plug-In Watchers
Plug-in watchers monitor the events that workflow triggers define. When an event occurs, Orchestrator notifies
any workflows that are waiting for that event.
Prerequisites
n
Create a public constructor that implements the IPluginAdaptor interface.
n
Instantiate the plug-in factory.
n
Create event generators and publishers.
vCenter Orchestrator Developer's Guide
184 VMware, Inc.