private void editCachedServiceInstance ( ProvidedServiceInstance instance ) { try { write . lock ( ) ; ServiceInstanceId id = new ServiceInstanceId ( instance . getServiceName ( ) , instance . getProviderId ( ) ) ; CachedProviderServiceInstance cachedInstance = getCacheServiceInstances ( ) . get ( id ) ; if ( cachedInstance != null ) { cachedInstance . setMonitorEnabled ( instance . isMonitorEnabled ( ) ) ; cachedInstance . setStatus ( instance . getStatus ( ) ) ; } LOGGER . debug ( "update cached ProvidedServiceInstance: {}." , cachedInstance . toString ( ) ) ; } finally { write . unlock ( ) ; } }
Edit the Cached ProvidedServiceInstance when updateService is called .