4.0

Table Of Contents
Procedure
1 Set up logging so that Orchestrator can record in the logs the events that occur in the plugged-in
technology.
The solar system example uses an instance of org.apache.log4j.Logger to log events.
public class SolarSystemFactory implements IPluginFactory {
private Logger log = Logger.getLogger(this.getClass());
}
2 Set up a notification handler by implementing the IPluginNotificationHandler interface from the
Orchestrator API.
The SolarSystemFactory constructor gets an instance of IPluginNotificationHandler named
notificationHandler.
public class SolarSystemFactory implements IPluginFactory {
private Logger log = Logger.getLogger(this.getClass());
public SolarSystemFactory(IPluginNotificationHandler notificationHandler) {
}
}
3 Create an instance of an event listener that implements the java.util.EventListener class.
The solar system plug-in factory creates an instance of the SolarSystemEventListener class. The
SolarSystemEventListener instance monitors an instance of the SolarSystemRepository class from the
solar system application.
public class SolarSystemFactory implements IPluginFactory {
private Logger log = Logger.getLogger(this.getClass());
public SolarSystemFactory(IPluginNotificationHandler notificationHandler) {
super();
new SolarSystemEventListener(
SolarSystemRepository.getUniqueInstance(), notificationHandler);
}
}
NOTE The SolarSystemEventListener class is an implementation of the ISolarSystemListener listener
that the solar system application defines. ISolarSystemListener implements java.util.EventListener.
For information about the implementation of SolarSystemEventListener, see “Create a Plug-In Event
Listener,” on page 166.
You set up the event listeners and notification handlers in the plug-in factory, to listen for events in the plugged-
in technology and to send notifications about the events.
What to do next
Define methods in the plug-in factory to find objects in the plugged-in technology by name, type, and by their
relation to other objects.
Find Objects By Identifier in the Plugged-In Technology
You can find objects by their identifier in the plugged-in technology by using the IPluginFactory.find()
method.
All instances of objects in the plugged-in technology must have a unique name or identifier for Orchestrator
to find them. The IPluginFactory.find() method uses the type and identifier to find an object in the plugged-
in technology and returns objects of the type java.lang.Object.
vCenter Orchestrator Developer's Guide
160 VMware, Inc.