public abstract class ROT
extends java.lang.Object
The clearObjects method is used to release all the COM objects created by Jacob in the current thread prior to uninitializing COM for that thread.
Prior to 1.9, manual garbage collection was the only option in Jacob, but from 1.9 onward, setting the com.jacob.autogc system property allows the objects referenced by the ROT to be automatically GCed. Automatic GC may be preferable in systems with heavy event callbacks.
Is [ 1116101 ] jacob-msg 0284 relevant???
Modifier and Type | Field and Description |
---|---|
protected static java.lang.Boolean |
INCLUDE_ALL_CLASSES_IN_ROT
If the code is ran from an applet that is called from javascript the Java
Plugin does not give full permissions to the code and thus System
properties cannot be accessed.
|
protected static java.lang.String |
PUT_IN_ROT_SUFFIX
Suffix added to class name to make up property name that determines if
this object should be stored in the ROT.
|
protected static boolean |
USE_AUTOMATIC_GARBAGE_COLLECTION
Manual garbage collection was the only option pre 1.9 Can staticly cache
the results because only one value and we don't let it change during a
run
|
Constructor and Description |
---|
ROT() |
Modifier and Type | Method and Description |
---|---|
protected static void |
addObject(JacobObject o)
Adds an object to the HashMap for the current thread.
|
protected static java.util.Map<JacobObject,java.lang.String> |
addThread()
adds a new thread storage area to rot
|
protected static void |
clearObjects()
Iterates across all of the entries in the Hashmap in the rot that
corresponds to this thread.
|
protected static java.util.Map<JacobObject,java.lang.String> |
getThreadObjects(boolean createIfDoesNotExist)
Returns the pool for this thread if it exists.
|
protected static void |
removeObject(JacobObject o)
Deprecated.
the java model leave the responsibility of clearing up
objects to the Garbage Collector. Our programming model
should not require that the user specifically remove object
from the thread.
This will remove an object from the ROT This does not need to be synchronized because only the rot modification related methods need to synchronized. Each individual map is only modified in a single thread. |
protected static final boolean USE_AUTOMATIC_GARBAGE_COLLECTION
protected static final java.lang.Boolean INCLUDE_ALL_CLASSES_IN_ROT
protected static java.lang.String PUT_IN_ROT_SUFFIX
We don't have a static for the actual property because there is a different property for each class that may make use of this feature.
protected static java.util.Map<JacobObject,java.lang.String> addThread()
protected static java.util.Map<JacobObject,java.lang.String> getThreadObjects(boolean createIfDoesNotExist)
createIfDoesNotExist
- protected static void clearObjects()
@Deprecated protected static void removeObject(JacobObject o)
o
- protected static void addObject(JacobObject o)
This method does not need to be threaded because the only concurrent modification risk is on the hash map that contains all of the thread related hash maps. The individual thread related maps are only used on a per thread basis so there isn't a locking issue.
In addition, this method cannot be threaded because it calls ComThread.InitMTA. The ComThread object has some methods that call ROT so we could end up deadlocked. This method should be safe without the synchronization because the ROT works on per thread basis and the methods that add threads and remove thread related entries are all synchronized
o
- http://jacob-project.sourceforge.net