When you develop an extension, the best practice is to provide a means of unregistering the extension from vCenter Server.

You unregister an extension from vCenter Server by calling the ExtensionManager.unregisterExtension() method. To unregister an extension, you pass to unregisterExtension() the ManagedObjectReference instance that identifies the ExtensionManager for the vCenter Server and the extension key for the extension.

Download the vSphere ESX Agent Manager SDK.

Verify that you have set up and started the EAM Sample Solution in an application server.

Verify that you have opened eam_work_folder\src\com\vmware\eam\sample\solution\Manager.java in an editor.

Define a method that unregisters the extension by calling ExtensionManager.unregisterExtension().

Manager.java defines a method named cleanup() that unregisters the EAM Sample Solution from vCenter Server. In the EAM Sample Solution, the VimConnection.java class defines the connection to vCenter Server. Manager.java creates an instance of VimConnection, _vimConnection, with which it connects to vCenter Server. The VimConnection.getStub() method obtains the port on which the vCenter Server is running.

public void cleanup() 
  throws NotFoundFaultMsg, RuntimeFaultFaultMsg {
    [...]
    _vimConnection.getStub().unregisterExtension(
                                    _vimConnection.getExtensionManager(), 
                                    EXTENSION_KEY);
}

You defined a method to unregister an extension from vCenter Server.