VMware {code} Community
sujeetmkalaskar
Enthusiast
Enthusiast

Perform some cleanup before plugin unregister

Hi _vladi_​ and laurentsd​,

Is there any way to get an indication that plugin is going to be unregistered before, so that we can do some clean up?

Suppose, we have a logs created for the plugin which we have registered.

During unregister we want to clean the plugin's log directory.

Note: Register/Unregister is done using the extension-registration script provided in SDK.

Can you please help?

Thanks

Sujeet Kalaskar

0 Kudos
1 Reply
_vladi_
VMware Employee
VMware Employee

Hi Sujeet,

For local plugins you can define a destroy-method for any of your Spring beans and handle cleanup there.

For remote plugins there is nothing deployed on the vCenter anyway.

If you want to do cleanup on the plugin backend side you can use the ExtensionManager vCenter API to check the state of any extensions that have been registered/unregistered. You can also use the PropertyCollector vCenter API to get updates about such changes.

Cheers,

Vladi

0 Kudos