4.0

Table Of Contents
Set Up the Event Listener Implementation
To create a plug-in event listener, you implement the java.util.Eventlistener interface and create an instance
of the IPluginNotification interface from the Orchestrator plug-in API.
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 event listener implementation named
<YourApplicationName>
EventListener.java.
In the solar system example, the event listener class is named SolarSystemEventListener.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 listener requires the following class:
import ch.dunes.vso.sdk.api.IPluginNotificationHandler;
4 Import any other classes that the event listener implementation requires.
In the solar system example, the event listener requires the following classes from the solar system
application:
import com.vmware.solarsystem.ISolarSystemListener;
import com.vmware.solarsystem.Planet;
import com.vmware.solarsystem.SolarSystemRepository;
5 Declare a public class for the event listener that implements the java.util.Eventlistener interface.
In the solar system example, the event listener declares the following class:
public class SolarSystemEventListener implements ISolarSystemListener {
}
The ISolarSystemListener class from the solar system application is a subclass of
java.util.Eventlistener.
6 Create an instance of the IPluginNotificationHandler interface.
The solar system event listener creates an IPluginNotificationHandler instance named
notficationHandler.
public class SolarSystemEventListener implements ISolarSystemListener {
IPluginNotificationHandler notficationHandler;
}
You set up the plug-in event listener class.
What to do next
Register the plug-in event listener with the plugged-in technology.
Chapter 7 Developing Plug-Ins
VMware, Inc. 167