static void terminateClient ( IMessagingClient client , String errorMessage , Logger logger ) { try { logger . fine ( "The reconfigurable client is requesting its internal connection to be closed." ) ; if ( client != null ) client . closeConnection ( ) ; } catch ( Exception e ) { logger . warning ( errorMessage + " " + e . getMessage ( ) ) ; Utils . logException ( logger , e ) ; } finally { // "unregisterService" was not merged with "closeConnection" // on purpose. What is specific to JMX is restricted to this class // and this bundle. Sub-classes may use "closeConnection" without // any side effect on the JMX part. if ( client instanceof JmxWrapperForMessagingClient ) ( ( JmxWrapperForMessagingClient ) client ) . unregisterService ( ) ; } }
Closes the connection of a messaging client and terminates it properly .