4.0

Table Of Contents
6 Declare a public class for the event generator implementation.
The solar system example watcher declares the SolarSystemWatchersManager class, that implements the
StarFlareEventListener class.
public class SolarSystemWatchersManager implements StarFlareEventListener {
}
The StarFlareEventListener class listens for solar flare events of a certain magnitude.
7 Set up logging so that Orchestrator can record in the logs the events that the watcher observes.
The solar system example uses an instance of org.apache.log4j.Logger to log events.
public class SolarSystemWatchersManager implements StarFlareEventListener {
private static final Logger log = Logger.getLogger(SolarSystemWatchersManager.class);
}
8 Declare a public constructor to create instances of the watcher implementation class.
The SolarSystemWatchersManager class creates a constructor that creates instances of
SolarSystemWatchersManager. The SolarSystemWatchersManager instances contain the
starFlareEventListener event listener that the SolarSystemEventGenerator class defines.
public SolarSystemWatchersManager() {
SolarSystemEventGenerator._solarSystemEventGenerator.
addStarFlareUniqueEventListener(this);
}
You set up a plug-in event watcher class to create watcher instances to watch for events from triggers.
What to do next
Create instances of the PluginWatcher class.
Create Instances of the PluginWatcher Class
You create a plug-in watcher to watch a workflow trigger by instantiating the PluginWatcher class. When the
event that the workflow trigger defines occurs, the plug-in watcher notifies any workflows that are waiting
for that event.
The PluginWatcher class defines a constructor that you can use to create plug-in watcher instances. The
PluginWatcher class defines methods to obtain or set the name of the workflow trigger to watch and a timeout
period.
Prerequisites
n
Set up the plug-in watcher implementation class.
n
Declare a public constructor to instantiate the plug-in watcher implementation.
Chapter 7 Developing Plug-Ins
VMware, Inc. 181