Package com.sun.star.lib.uno.helper
Class WeakAdapter
- java.lang.Object
-
- com.sun.star.lib.uno.helper.WeakAdapter
-
- All Implemented Interfaces:
com.sun.star.uno.XAdapter
,com.sun.star.uno.XInterface
public class WeakAdapter extends java.lang.Object implements com.sun.star.uno.XAdapter
An XAdapter implementation that holds a weak reference (java.lang.ref.WeakReference) to an object. Clients can register listener (com.sun.star.lang.XReference) which are notified when the object (the one which is kept weak) is being finalized. That is, that object is being destroyed because there are not any hard references to it.
-
-
Constructor Summary
Constructors Constructor Description WeakAdapter(java.lang.Object component)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addReference(com.sun.star.uno.XReference xReference)
Method of com.sun.star.uno.XAdapter.java.lang.Object
queryAdapted()
Method of com.sun.star.uno.XAdapter.void
removeReference(com.sun.star.uno.XReference xReference)
Method of com.sun.star.uno.XAdapter.
-
-
-
Method Detail
-
queryAdapted
public java.lang.Object queryAdapted()
Method of com.sun.star.uno.XAdapter. It is called to obtain a hard reference to the object which is kept weak by this instance.- Specified by:
queryAdapted
in interfacecom.sun.star.uno.XAdapter
- Returns:
- hard reference to the object
-
removeReference
public void removeReference(com.sun.star.uno.XReference xReference)
Method of com.sun.star.uno.XAdapter. Called by clients to register listener which are notified when the weak object is dying.- Specified by:
removeReference
in interfacecom.sun.star.uno.XAdapter
- Parameters:
xReference
- a listener
-
addReference
public void addReference(com.sun.star.uno.XReference xReference)
Method of com.sun.star.uno.XAdapter. Called by clients to unregister listeners.- Specified by:
addReference
in interfacecom.sun.star.uno.XAdapter
- Parameters:
xReference
- listener
-
-