4.0

Table Of Contents
2 Create Instances of the PluginWatcher Class on page 181
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.
3 Publish Plug-In Watchers on page 182
You implement the IPluginPublisher interface to publish plug-in watchers to the Orchestrator
notification mechanism.
Set Up the Watcher Implementation
You can create PluginWatcher instances and methods to generate events directly in the plug-in adaptor.
However, the solar system example creates the watcher instances in a separate class named
SolarSystemWatchersManager.
Prerequisites
n
Download the bundle of Orchestrator examples.
n
Unzip the examples bundle to an appropriate location.
Procedure
1 Create and save a Java file for the plug-in watcher class.
In the solar system example, the watcher class is named SolarSystemWatchersManager.java.
2 Declare the package that contains the Java classes of the plug-in implementation.
The solar system example declares the following package:
package com.vmware.orchestrator.api.sample.solarsystem;
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;
vCenter Orchestrator Developer's Guide
180 VMware, Inc.