We did something similar recently using webMethods Portal. We needed to create a portlet that used a BrokerClient object to communicate to the webMethods Broker, but didn’t want to reconnect each time the portlet was instantiated (in fact that would have defeated the purpose of connecting to the Broker in our case).
The solution was to create a simple portlet that subscribed to the Portal event associated with user logins. That portlet created the BrokerClient object and stored it in the Portal user’s session object using an API command.
The portlet that actually needed to communicate with the Broker retrieved the BrokerClient object from the session in it’s init() method and did its work.
The BrokerClient cleanup was performed by a portlet that subscribed to the Portal event associated with user logout or session timeout events.
I know you’re working with an app server rather than with Portal and are creating IS Context objects rather than BrokerClient’s, but it seemed relevant. You should be able to do what you need with pooling in an app server or by storing your Context objects in the user’s session object.
Mark
#Flow-and-Java-services#Integration-Server-and-ESB#webMethods