public class ClassLoaderCache extends Object implements SelfCleaningTable.ICleanerListener<Long>
Modifier | Constructor and Description |
---|---|
protected |
ClassLoaderCache(long removedRelevantWindow) |
Modifier and Type | Method and Description |
---|---|
static ClassLoaderCache |
getCache()
Gets the singleton cache instance
|
ClassLoader |
getClassLoader(Long key)
Gets class loader by key
|
Long |
getClassLoaderKey(ClassLoader classLoader)
Gets the key for the specified class loader
|
Long |
putClassLoader(ClassLoader classLoader)
Add new class loader to the cache, if the class loader is already present, the existing key
will be returned
|
void |
registerCacheStateListener(IClassLoaderCacheStateListener listener)
Register for cache state changed events, the listener is kept as weak reference, all
subscribers must keep a strong reference to the listener to keep this notification active,
this will trigger history events of at most last 100 removed class loader
|
boolean |
registerClassLoaderStateListener(Long classLoaderKey,
IClassLoaderCacheStateListener listener)
Register for a specified class loader key state events, the listener is kept as weak
reference, all subscribers must keep a strong reference to the listener to keep this
notification active
|
void |
removeClassLoader(ClassLoader classLoader)
Remove the specified class loader
|
void |
removeClassLoaderStateListener(Long classLoaderKey,
IClassLoaderCacheStateListener listener)
Remove a specific listener from a specific class listener
|
void |
shutdown() |
void |
weakEntryRemoved(Long value) |
public static ClassLoaderCache getCache()
public void shutdown()
public Long putClassLoader(ClassLoader classLoader)
public ClassLoader getClassLoader(Long key)
public void removeClassLoader(ClassLoader classLoader)
public void weakEntryRemoved(Long value)
weakEntryRemoved
in interface SelfCleaningTable.ICleanerListener<Long>
public Long getClassLoaderKey(ClassLoader classLoader)
public void registerCacheStateListener(IClassLoaderCacheStateListener listener)
public boolean registerClassLoaderStateListener(Long classLoaderKey, IClassLoaderCacheStateListener listener)
public void removeClassLoaderStateListener(Long classLoaderKey, IClassLoaderCacheStateListener listener)
Copyright © GigaSpaces.