Created by: David Requena on 14-05-2013 12:36:33 PM I seem to be unable to properly shutdown my provider. There always remain a couple dangling threads running ([LogFileTraceWriteThread] and [Thread-10]). I'm shutting down the provider this way:
public void shutdownProvider() {
try {
conditionShutdown = new Condition();
ProviderObserver observer = new ProviderObserver() { @Override public void providerChangedEvent(ProvEv[] eventList) { if (eventList != null) { for (ProvEv event : eventList) { if (event instanceof ProvShutdownEv) { conditionShutdown.set(); } } } } };
} catch (ResourceUnavailableException | MethodNotSupportedException e) { LOGGER.log(Level.SEVERE, "jTAPI exception while shutting down", e); } I'm receiving ProvShutdownEv, the condition is being set and this method exists normally without any exceptions. Neverteless those damned 2 threads remain running. As this is being used in a webapp System.exit() is not an option and consequently the application cannot be reloaded nor the server stopped:-( JTAPI ver is 8.6, CUCM is the same. Anything obvious I'm missing? Thanksin advance! David
Subject: RE: How to properly shutdown Provider? Replied by: David Requena on 14-05-2013 01:00:48 PM
David Staudt:
The 'observers' are implemented via threads - Provider/Address/Call/Terminal observer - make sure these are all removed/disposed before shutdown.
Thanks for your reply
At this point I've removed all jTAPI functionality from the app in an attempt to isolate the problem so it is just getting a Provider on launch and shutting it down on unload. The only providers in place are the one shown in the code above and another used for waiting for ProvInServiceEv an launch time (which I also remove after event reception).
Also, why the TraceFileWriteThread thread if I'm not doing any tracing whatsoever? I'm clueless..
Subject: RE: How to properly shutdown Provider? Replied by: David Staudt on 14-05-2013 12:49:20 PM The 'observers' are implemented via threads - Provider/Address/Call/Terminal observer - make sure these are all removed/disposed before shutdown.
Subject: RE: How to properly shutdown Provider? Replied by: Tohru Ohzono on 14-05-2013 09:09:25 PM Hi David, TraceFileWriteThread thread will be created to output jtapi traces from dedicated thread. This is by design from Unified CM 8.6(2). For now, jtapi has not a reference counter for multiple provider, so the thread will remain. (may be fixed in the future.) You can prevent jtapi from creating this thread by jtapi.ini. Please edit or add "UseLogFileTraceWriteThread=0" in jtapi.ini. Please note that traces are output on the same thread as jtapi processing thread if you set this property. This will have a little disadvantage for performance, but similar performance as Unified CM 8.6(1) or older. Thanks & Regards, Tohru
Subject: RE: How to properly shutdown Provider? Replied by: David Requena on 21-05-2013 02:54:12 PM Many thanks for your insights. Although not optimum a solution the jtapi.ini parameter does somewhat solve the issue.
My questions is: is there a way to identify which one has been shut down, like we can tell which one has gone out of service or in-service?
My application needs to switch from one to the other when one of them goes out of service or shutdown (for some reason).
Thanks for your help Regards
Getting Started
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: