|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.linar.jintegra.Cleaner
public abstract class Cleaner
This class is used to programatically release references to COM objects.
References are normally released when the Java object is garbage collected. However, there are times when you want to force the release.
Consider the case where your object is a proxy to a Microsoft Excel application. The object may not be garbage collected for some time. Until it is, the Excel application holds onto any memory it has allocated, which is typically several megabytes.
By explicitly calling release, the Excel application will exit freeing the resources it was using. At some time later, the Java object will be garbage collected.
For more information, please see Garbage Collection: Releasing Java References to COM Objects.
Method Summary | |
---|---|
static void |
addConnectionListener(com.linar.jintegra.ConnectionListener theListener)
Adds a listener which is notified when new COM client connection comes in |
static void |
addUnreferencedListener(Unreferenced listener)
Adds a listener which is invoked when COM releases all references to a Java object. |
static void |
clearCreatorThreadContextFor(java.lang.Object o)
Clears the thread context for an object. |
static void |
flushLog()
Flushes the J-Integra® log. |
static int |
getActiveObjectCount()
Returns the number of active DCOM objects in the system. |
static java.lang.String |
getReleaseStackTraceFor(java.lang.Object anObject)
For internal use only - never call this method. |
static void |
release(java.lang.Object anObject)
Releases a specific reference to a COM object. |
static void |
releaseAll()
Releases all outstanding references to COM objects. |
static void |
releaseAllInCurrentThread()
Tells the runtime to release all objects used in the current thread since the last 'trackObjectsInCurrentThread' call. |
static void |
removeConnectionListener(com.linar.jintegra.ConnectionListener theListener)
Removes a listener which is notified when new COM client connection comes in |
static void |
removeUnreferencedListener(Unreferenced listener)
Removes a listener. |
static void |
reset()
For internal use only - never call this method. |
static void |
setObjectExportListener(ObjectExportChecker listener)
Sets a listener which is invoked when a Java object is about to be exported as a COM object |
static java.lang.String |
sizes()
|
static void |
trackObjectsInCurrentThread()
Tells the runtime to remember all objects used in the current thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void releaseAll()
public static void trackObjectsInCurrentThread()
releaseAllInCurrentThread()
public static void releaseAllInCurrentThread()
trackObjectsInCurrentThread()
public static void flushLog()
public static int getActiveObjectCount()
public static void reset()
public static void release(java.lang.Object anObject)
anObject
- the object to be released
java.lang.IllegalArgumentException
- if the object that is passed is not a reference to a COM object.public static java.lang.String getReleaseStackTraceFor(java.lang.Object anObject)
public static void addUnreferencedListener(Unreferenced listener)
listener
- a listener object which will handle the eventUnreferenced
public static void removeUnreferencedListener(Unreferenced listener)
listener
- a listener object which will handle the eventaddUnreferencedListener(com.linar.jintegra.Unreferenced)
,
Unreferenced
public static void setObjectExportListener(ObjectExportChecker listener) throws java.lang.SecurityException
listener
- a listener object which will handle the event
java.lang.SecurityException
- if a checker has already been installedObjectExportChecker
public static void clearCreatorThreadContextFor(java.lang.Object o)
o
- the objectpublic static void addConnectionListener(com.linar.jintegra.ConnectionListener theListener)
theListener
- a listener object which will handle the eventConnectionListener
public static void removeConnectionListener(com.linar.jintegra.ConnectionListener theListener)
theListener
- a listener object which will handle the eventConnectionListener
public static java.lang.String sizes()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |