/** Method of com.sun.star.uno.XReference. When called, it deregisteres this * object with the adapter and releases the reference to it. */ synchronized public void dispose() { if (m_adapter != null) { m_adapter.removeReference(this); m_adapter= null; } }
/** * Method of <code>com.sun.star.uno.XReference</code>. * * <p>When called, it deregisters this object with the adapter and releases * the reference to it.</p> */ synchronized public void dispose() { if (m_adapter != null) { m_adapter.removeReference(this); m_adapter= null; } }
/** Obtains a hard reference to the object which is kept weak by the adapter * and returns it. * @return hard reference to the otherwise weakly kept object. */ synchronized Object get() { Object retVal= null; if (m_adapter != null) { retVal= m_adapter.queryAdapted(); if (retVal == null) { // If this object registered as listener with XAdapter while it was notifying // the listeners then this object might not have been notified. If queryAdapted // returned null then the weak kept object is dead and the listeners have already // been notified. And we missed it. m_adapter.removeReference(this); m_adapter= null; } } return retVal; } }
/** * Obtains a hard reference to the object which is kept weak by the adapter * and returns it. * * @return hard reference to the otherwise weakly kept object. */ synchronized Object get() { Object retVal= null; if (m_adapter != null) { retVal= m_adapter.queryAdapted(); if (retVal == null) { // If this object registered as listener with XAdapter while it was notifying // the listeners then this object might not have been notified. If queryAdapted // returned null then the weak kept object is dead and the listeners have already // been notified. And we missed it. m_adapter.removeReference(this); m_adapter= null; } } return retVal; } }