/** * This method clears the JNDI DS cache. The need exists because after a JNDI connection edit the old DS must be * removed from the cache. * */ public void clearCache() { cacheManager.removeRegionCache( IDBDatasourceService.JDBC_DATASOURCE ); }
public void shutdown() { ICacheManager cacheManager = PentahoSystem.getCacheManager( null ); Logger.debug( this, "DatasourceSystemListener: Called for shutdown ..." ); //$NON-NLS-1$ cacheManager.removeRegionCache( IDBDatasourceService.JDBC_DATASOURCE ); Logger.debug( this, "DatasourceSystemListener: Completed shutdown." ); //$NON-NLS-1$ }
@SuppressWarnings( "unchecked" ) public void shutdown() { ICacheManager cacheManager = PentahoSystem.getCacheManager( null ); List<ObjectPool> objectPools = null; objectPools = (List<ObjectPool>) cacheManager.getAllValuesFromRegionCache( IDBDatasourceService.JDBC_POOL ); Logger.debug( this, "DatasourceSystemListener: Called for shutdown ..." ); //$NON-NLS-1$ try { if ( objectPools != null ) { for ( ObjectPool objectPool : objectPools ) { if ( null != objectPool ) { objectPool.clear(); } } } } catch ( Throwable ignored ) { Logger.error( this, "Failed to clear connection pool: " + ignored.getMessage(), ignored ); //$NON-NLS-1$ } cacheManager.removeRegionCache( IDBDatasourceService.JDBC_POOL ); cacheManager.removeRegionCache( IDBDatasourceService.JDBC_DATASOURCE ); Logger.debug( this, "DatasourceSystemListener: Completed shutdown." ); //$NON-NLS-1$ }
@Override public void onReload() { if ( !loaded ) { setAuthorizationActions( PentahoSystem.getAll( IAuthorizationAction.class ) ); updateImmutableRoleBindingNames(); // when immutableRoleBindingNames gets updated, we should ensure no stale logical roles remain cached if ( cacheManager.cacheEnabled( LOGICAL_ROLE_BINDINGS_REGION ) ) { cacheManager.removeRegionCache( LOGICAL_ROLE_BINDINGS_REGION ); } loaded = true; } } } );