public static DCache getConfiguredCache ( String cacheName ) { final String methodName = "getConfiguredCache()" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , methodName + " input cacheName=" + cacheName ) ; } DCache cacheOut = null ; if ( coreCacheEnabled == false ) { // DYNA1003E=DYNA1003E: WebSphere Dynamic Cache instance named {0} can not be initialized because of error // {1}. Tr . error ( tc , "DYNA1003E" , new Object [ ] { cacheName , "Core Cache Service has not been started." } ) ; } else { cacheOut = getCache ( cacheName ) ; if ( cacheOut == null ) { CacheConfig config = getCacheService ( ) . getCacheInstanceConfig ( cacheName ) ; if ( config == null ) { // DYNA1004E=DYNA1004E: WebSphere Dynamic Cache instance named {0} can not be initialized because it // is not configured. // DYNA1004E.explanation=This message indicates the named WebSphere Dynamic Cache instance can not // be initialized. The named instance is not avaliable. // DYNA1004E.useraction=Use the WebSphere Administrative Console to configure a cache instance // resource named {0}. Tr . error ( tc , "DYNA1004E" , new Object [ ] { cacheName } ) ; cacheOut = null ; } else { cacheOut = createCache ( config . cacheName , config ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , methodName + " output cacheName=" + ( cacheOut != null ? cacheOut . getCacheName ( ) : "null" ) ) ; } return cacheOut ; }
Get a configured named cache .