UNO Java Documentation

com.sun.star.lib.uno.helper
Class WeakAdapter

com.sun.star.lib.uno.helper.WeakAdapter

public class WeakAdapter

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 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
WeakAdapter(java.lang.Object component)
           
 
Method Summary
 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.
 

Constructor Detail

WeakAdapter

public WeakAdapter(java.lang.Object component)
Parameters:
component - the object that is to be held weak
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.
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.
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.
Parameters:
a - listener

UNO Java Documentation