class ContextCache
extends java.lang.Object
The ContextCache
supports event (CacheEvent
)
listeners. These can be used to find out what is going on inside the
cache as an application is running. The purpose of this is for debugging
the cache and object creation/destruction. This is quite lightweight
and should have negligable performance impact if it is not used.
CacheEvent
,
CacheListener
Modifier and Type | Field and Description |
---|---|
protected java.util.Vector |
m_listeners
List of cache listeners.
|
protected long |
m_pd2fctx
This is the d2fctx pointer in the C ifjapi70.
|
Modifier | Constructor and Description |
---|---|
protected |
ContextCache(long pd2fctx)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addCacheListener(CacheListener l)
Add a cache listener.
|
protected void |
addObject(BaseFormsObject obj)
Adds an object to the cache.
|
void |
dump(java.io.PrintWriter out)
Dumps the contents of the cache.
|
protected BaseFormsObject |
getObject(long pd2fob)
Get a Java instance of an existing Forms object defined by a given
C pointer.
|
protected BaseFormsObject |
getObject(long pd2fob,
java.lang.reflect.Constructor construct)
Get a Java instance of an existing Forms object defined by a given
C pointer and a constructor for it's Java type.
|
protected BaseFormsObject |
getObject(long pd2fob,
long d2ffox)
Get a Java instance of an existing Forms object defined by a given
C pointer and a specified (by Forms object id) object type.
|
protected void |
processCacheEvent(CacheEvent e)
Processes cache events by dispatching them to any registered
CacheListener objects. |
void |
purge(boolean destroy)
Purge the cache.
|
void |
purgeModules(boolean destroy)
Purge any module objects from the cache.
|
void |
removeCacheListener(CacheListener l)
Remove a cache listener.
|
protected void |
removeObject(long pd2fob)
Removes an object from the cache and flags it invalid.
|
protected transient long m_pd2fctx
protected java.util.Vector m_listeners
protected ContextCache(long pd2fctx)
protected void addObject(BaseFormsObject obj)
obj
- Object to add to cacheprotected BaseFormsObject getObject(long pd2fob)
pd2fob
- C pointer to existing Forms object you want a Java
instanciation ofprotected BaseFormsObject getObject(long pd2fob, long d2ffox)
pd2fob
- C pointer to existing Forms object you want a Java
instanciation ofd2ffox
- C Forms API object type (D2FFO_x constant)protected BaseFormsObject getObject(long pd2fob, java.lang.reflect.Constructor construct)
pd2fob
- C pointer to existing Forms object you want a Java
instanciation ofconstruct
- Constructor used to create new instancesprotected void removeObject(long pd2fob)
pd2fob
- Pointer to object to removepublic void dump(java.io.PrintWriter out)
out
- Stream to print output topublic void purge(boolean destroy)
You should only use this if you really know what's going on in the cache. In very few circumstances is it advisable to use this method.
destroy
- Delete the object in Forms memory as well as Javapublic void purgeModules(boolean destroy)
You should only use this if you really know what's going on in the cache. In very few circumstances is it advisable to use this method. You may find this useful if you have an application that processes many modules. Between processing each module, call this method to clean up memory and release any auto-loaded modules you may not want. You don't have to do this, it just reduces memory usage.
destroy
- Delete the object in Forms memory as well as Javapublic void addCacheListener(CacheListener l)
l
- Listener to addpublic void removeCacheListener(CacheListener l)
l
- Listener to removeprotected void processCacheEvent(CacheEvent e)
CacheListener
objects. e
- Event to dispatch