Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15
UNO Java Runtime

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

java.lang.Object
  |
  +--com.sun.star.lib.uno.helper.WeakAdapter
All Implemented Interfaces:
XAdapter, XInterface

public class WeakAdapter
extends java.lang.Object
implements 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 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.


Field Summary
 
Fields inherited from interface com.sun.star.uno.XAdapter
UNOTYPEINFO
 
Constructor Summary
WeakAdapter(java.lang.Object component)
           
 
Method Summary
 void addReference(XReference xReference)
          Method of com.sun.star.uno.XAdapter.
 java.lang.Object queryAdapted()
          Method of com.sun.star.uno.XAdapter.
 void removeReference(XReference xReference)
          Method of com.sun.star.uno.XAdapter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.

Specified by:
queryAdapted in interface XAdapter
Returns:
hard reference to the object

removeReference

public void removeReference(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 interface XAdapter
Parameters:
xReference - a listener

addReference

public void addReference(XReference xReference)
Method of com.sun.star.uno.XAdapter. Called by clients to unregister listeners.

Specified by:
addReference in interface XAdapter

UNO Java Runtime

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.