public synchronized static JMX reconnect ( ) { try { ClientCache cache = null ; cache = ClientCacheFactory . getAnyInstance ( ) ; if ( cache != null && ! cache . isClosed ( ) ) { cache . close ( ) ; } } catch ( Exception e ) { System . out . println ( "Cache was closed" ) ; } if ( jmx != null ) { jmx . dispose ( ) ; jmx = null ; } return getJmx ( ) ; }
Close and recreate the JMX connect