4.1

Table Of Contents
3 Import the Orchestrator plug-in API classes with a Java import statement.
In the solar system example, the event watcher requires the following classes:
import ch.dunes.vso.sdk.api.IPluginPublisher;
import ch.dunes.vso.sdk.api.PluginWatcher;
4 Import any classes that the plug-in implementation or plugged-in technology defines.
In the solar system example, the watcher requires the following class that the
SolarSystemEventGenerator class defines:
import com.vmware.orchestrator.api.sample.solarsystem.
SolarSystemEventGenerator.StarFlareEventListener;
5 Import any other classes that the watcher implementation requires.
In the solar system example, the event watcher requires the following classes:
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Vector;
import org.apache.log4j.Logger;
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.
vCenter Orchestrator Developer's Guide
176 VMware, Inc.