4.1

Table Of Contents
What to do next
Create an event listener object to allow Orchestrator to monitor events in the plugged-in technology.
Create a Plug-In Event Listener
Plug-in event listeners allow Orchestrator to monitor events that occur in the plugged-in technology. To create
a plug-in event listener, you create a Java class that implements the IPluginNotificationHandler interface from
the Orchestrator plug-in API.
These procedures present the steps involved in creating a plug-in event listener. To illustrate the process, they
present code from the SolarSystemEventListener class from the solar system example application.
You can download the Orchestrator examples ZIP file from the Orchestrator documentation home page to
obtain the sources of the solar system example application and plug-in.
For a description of the role of plug-in event listeners and the other components of a plug-in, see “Overview
of Plug-Ins,” on page 139. For information about all the methods and parameters of the
IPluginNotificationHandler interface, see “IPluginNotificationHandler Interface,” on page 213.
Procedure
1 Set Up the Event Listener Implementation on page 163
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.
2 Register the Event Listener with the Plugged-In Technology on page 164
To monitor events in a plugged-in technology, you must register the event listener from the plug-in with
the plugged-in technology and implement a notification handler.
3 Notify Orchestrator of Events in the Plugged-In Technology on page 165
Event listeners implement the IPluginNotificationHandler interface from the Orchestrator plug-in API
to notify Orchestrator of events in the plugged-in technology.
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;
Chapter 7 Developing Plug-Ins
VMware, Inc. 163