com.ibm.oti.shared

Class SharedClassUtilities

  1. java.lang.Object
  2. extended bycom.ibm.oti.shared.SharedClassUtilities

  1. public class SharedClassUtilities
  2. extends java.lang.Object
Shared Class Utilities APIs to get information about all shared class caches in a directory and to destroy a particular shared class cache.

See Also:
SharedClassCacheInfo

Field Summary

Modifier and Type Field and Description
  1. static
  2. int
DESTROY_FAILED_CURRENT_GEN_CACHE
Returned by destroySharedCache(java.lang.String, int, java.lang.String, boolean) to indicate the method has failed to destroy the current generation cache.
  1. static
  2. int
DESTROY_FAILED_OLDER_GEN_CACHE
Returned by destroySharedCache(java.lang.String, int, java.lang.String, boolean) to indicate the method has failed to destroy one or more older generation cache, and either a current generation cache does not exist or is successfully destroyed.
  1. static
  2. int
DESTROYED_ALL_CACHE
Returned by destroySharedCache(java.lang.String, int, java.lang.String, boolean) to indicate either no cache exists or the method has successfully destroyed caches of all generations.
  1. static
  2. int
DESTROYED_NONE
Returned by destroySharedCache(java.lang.String, int, java.lang.String, boolean) to indicate the method failed to destroy any cache.
  1. static
  2. int
NO_FLAGS
Value to be passed to flags parameter of getSharedCacheInfo(java.lang.String, int, boolean) method.
  1. static
  2. int
NONPERSISTENT
Specifies a non-persistent cache.
  1. static
  2. int
PERSISTENCE_DEFAULT
Use the platform dependent default value as the cache type.
  1. static
  2. int
PERSISTENT
Specifies a persistent cache.

Constructor Summary

Constructor and Description
SharedClassUtilities()

Method Summary

Modifier and Type Method and Description
  1. static
  2. int
destroySharedCache(java.lang.String cacheDir,int persistence,java.lang.String cacheName,boolean useCommandLineValues)
Destroy a named shared class cache of a given type in a given directory.
  1. static
  2. java.util.List<SharedClassCacheInfo>
getSharedCacheInfo(java.lang.String cacheDir,int flags,boolean useCommandLineValues)
Iterate through all shared class caches present in the given directory and return their information in a List.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

NO_FLAGS

  1. public static final int NO_FLAGS
Value to be passed to flags parameter of getSharedCacheInfo(java.lang.String, int, boolean) method.
See Also:

PERSISTENCE_DEFAULT

  1. public static final int PERSISTENCE_DEFAULT
Use the platform dependent default value as the cache type.
See Also:

PERSISTENT

  1. public static final int PERSISTENT
Specifies a persistent cache.
See Also:

NONPERSISTENT

  1. public static final int NONPERSISTENT
Specifies a non-persistent cache.
See Also:

DESTROYED_ALL_CACHE

  1. public static final int DESTROYED_ALL_CACHE
Returned by destroySharedCache(java.lang.String, int, java.lang.String, boolean) to indicate either no cache exists or the method has successfully destroyed caches of all generations.
See Also:

DESTROYED_NONE

  1. public static final int DESTROYED_NONE
Returned by destroySharedCache(java.lang.String, int, java.lang.String, boolean) to indicate the method failed to destroy any cache.
See Also:

DESTROY_FAILED_CURRENT_GEN_CACHE

  1. public static final int DESTROY_FAILED_CURRENT_GEN_CACHE
Returned by destroySharedCache(java.lang.String, int, java.lang.String, boolean) to indicate the method has failed to destroy the current generation cache.
See Also:

DESTROY_FAILED_OLDER_GEN_CACHE

  1. public static final int DESTROY_FAILED_OLDER_GEN_CACHE
Returned by destroySharedCache(java.lang.String, int, java.lang.String, boolean) to indicate the method has failed to destroy one or more older generation cache, and either a current generation cache does not exist or is successfully destroyed.
See Also:

Constructor Detail

SharedClassUtilities

  1. public SharedClassUtilities()

Method Detail

getSharedCacheInfo

  1. public static java.util.List<SharedClassCacheInfo> getSharedCacheInfo( java.lang.String cacheDir,
  2. int flags,
  3. boolean useCommandLineValues)
Iterate through all shared class caches present in the given directory and return their information in a List.

If useCommandLineValues is true then use the command line value as the directory to search in. If the command line value is not available, use the platform dependent default value. If useCommandLineValues is false, then use cacheDir as the directory to search in. cacheDir can be null. In such case, use the platform dependent default value.

Parameters:
cacheDir - Absolute path of the directory to look for the shared class caches
flags - Reserved for future use. Always pass NO_FLAGS
useCommandLineValues - Use command line values instead of using parameter values
Returns:
List of SharedClassCacheInfo corresponding to shared class caches which are present in the specified directory, null on failure.
Throws:
java.lang.IllegalStateException - if shared classes is disabled for this JVM (i.e. -Xshareclasses:none is present). IllegalArgumentException if flags is not a valid value.

destroySharedCache

  1. public static int destroySharedCache( java.lang.String cacheDir,
  2. int persistence,
  3. java.lang.String cacheName,
  4. boolean useCommandLineValues)
Destroy a named shared class cache of a given type in a given directory.

If useCommandLineValues is true then use the command line value to get the shared class cache name, its type and its directory. If any of these is not available, then use the default value. If useCommandLineValues is false, then use cacheDir, persistence and cacheName to identify the cache to be destroyed. To accept the default value for cacheDir or cacheName, specify the parameter with a null value.

Return value of this method depends on the status of existing current and older generation caches.

  • If it fails to destroy any existing cache with the given name, it returns DESTROYED_NONE.
  • If no cache exists or it is able to destroy all existing caches of all generations, it returns DESTROYED_ALL_CACHE.
  • If it fails to destroy an existing current generation cache, irrespective of the state of older generation cache(s), it returns DESTROY_FAILED_CURRENT_GEN_CACHE.
  • If it fails to destroy one or more older generation cache and either a current generation cache does not exist or is successfully destroyed, it returns DESTROY_FAILED_OLDER_GEN_CACHE.
Parameters:
cacheDir - Absolute path of the directory where the shared class cache is present
persistence - Type of the cache. One of:
cacheName - Name of the cache to be deleted
useCommandLineValues - Use command line values instead of using parameter values
Returns:
Throws:
java.lang.IllegalStateException - if shared classes is disabled for this JVM (i.e. -Xshareclasses:none is present). IllegalArgumentException if persistence is not a valid value.