public static DistributedObjectCache getMap ( String name , Properties properties ) { final String methodName = "getMap()" ; if ( tc . isEntryEnabled ( ) ) { Tr . entry ( tc , methodName + " name: (" + name + ") properties:" + properties ) ; } if ( name == null || name . trim ( ) . length ( ) == 0 ) { throw new IllegalStateException ( "Map name can not be null or empty" ) ; } if ( ServerCache . objectCacheEnabled == false ) { // display debug statement instead of warning message because the security tries to create object instance // before object cache service is started. if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " WebSphere Dynamic Cache instance named " + name + " cannot be used because of Dynamic Object cache service has not be started." ) ; } return null ; } DistributedObjectCache distributedObjectCache = null ; synchronized ( distributedMapsSynchronizeObject ) { distributedObjectCache = distributedMaps . get ( name ) ; if ( distributedObjectCache == null ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " Existing DistributedObjectCache not found for " + name ) ; } distributedObjectCache = createDistributedObjectCache ( name , properties ) ; distributedMaps . put ( name , distributedObjectCache ) ; } else { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " Existing DistributedObjectCache found for " + name + " " + distributedObjectCache ) ; } } } if ( tc . isEntryEnabled ( ) ) { Tr . exit ( tc , methodName + " map:" + distributedObjectCache ) ; } return distributedObjectCache ; }
Returns the DistributedMap or DistributedNioMap instance specified by the given id using the the parameters specified in properties . If the given instance has not yet been created then a new instance is created using the parameters specified in the properties object . Use the various KEY_xxx and VALUE_xxx constants to populate the passed properties object .