I'm trying to capture the moment when a vSphere client session ends so I can perform some cleanup on my services, but my sessionEnded method is still not being called when I log out of vSphere.
I found the related thread that suggests looking at the vsphere views sample for an example.
I implemented the ClientSessionEndListener interface on one of my service beans, added method sessionEnded, and passed in the UserSessionService to the same bean in bundle-context.xml. However, sessionEnded is still not getting called.
What might I be missing?
E
Ok, I figured things out and got the ClientSessionEndListener to work. In addition to implementing the listener in your local Java class, I learned I had to update the related bundle-context-osgi.xml config file to export the service. Here is the related bit from the xml file:
<!--
Exported services
-->
<osgi:service id="VmDataProvider" ref="VmDataProviderImpl">
<osgi:interfaces>
<value>com.vmware.vise.data.query.PropertyProviderAdapter</value>
<value>com.vmware.vise.security.ClientSessionEndListener</value>
</osgi:interfaces>
</osgi:service>
Sorry for the late reply but in cases like that it's very useful to search all SDK code sample directories for particular APIs.
Glad things are working for you now.