public static CommandCache getCommandCache ( String cacheName ) { final String methodName = "getCommandCache()" ; CommandCache cacheOut = null ; if ( servletCacheEnabled == false ) { // DYNA1059W=DYNA1059W: WebSphere Dynamic Cache instance named {0} cannot be used because of Dynamic Servlet // cache service has not be started. Tr . error ( tc , "DYNA1059W" , new Object [ ] { cacheName } ) ; } else { if ( cacheName != null ) { try { cacheOut = cacheUnit . getCommandCache ( cacheName ) ; } catch ( Exception e ) { // DYNA1003E=DYNA1003E: WebSphere Dynamic Cache instance named {0} can not be initialized because of // error {1}. Tr . error ( tc , "DYNA1003E" , new Object [ ] { cacheName , e } ) ; } } else { cacheOut = ServerCache . commandCache ; } } if ( cacheOut == null && TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " could not find CommandCache for cacheName=" + cacheName ) ; } return cacheOut ; }
Get a named Command cache .