4.0

Table Of Contents
Procedure
1 Create one or more instances of the PluginWatcher class with which to register the workflow triggers to
monitor.
The SolarSystemWatchersManager class creates a hashtable to contain all of the PluginWatcher instances.
private final Map<String, PluginWatcher> watchers = new Hashtable<String, PluginWatcher>();
2 Obtain watcher instances by calling the PluginWatcher.getId() method.
The SolarSystemWatchersManager class defines a method that adds a PluginWatcher instance to the
hashtable of PluginWatcher instances.
public void addWatcher(PluginWatcher watcher) {
synchronized (watchers) {
watchers.put(watcher.getId(), watcher);
}
}
3 (Optional) Remove watcher instances after an event occurs.
The SolarSystemWatchersManager class defines a method that removes a PluginWatcher instance from the
hashtable of PluginWatcher instances.
public void removeWatcher(String watcherId) {
synchronized (watchers) {
watchers.remove(watcherId);
}
}
You created instances of the PluginWatcher class to watch workflow triggers for events.
What to do next
Register the watcher instances with IPluginPublisher instances to publish the watchers to the Orchestrator
notification mechanism.
Publish Plug-In Watchers
You implement the IPluginPublisher interface to publish plug-in watchers to the Orchestrator notification
mechanism.
When a workflow trigger starts an event in the plugged-in technology, a plug-in watcher that watches that
trigger and that is registered with an IPluginPublisher instance notifies any waiting workflows that the event
has occurred.
Prerequisites
n
Set up the plug-in watcher implementation class.
n
Declare a public constructor to instantiate the plug-in watcher implementation.
n
Create instances of the PluginWatcher class.
vCenter Orchestrator Developer's Guide
182 VMware, Inc.