Eclipse Platform
Release 3.1

org.eclipse.core.runtime.dynamichelpers
Interface IExtensionTracker

All Known Implementing Classes:
ExtensionTracker

public interface IExtensionTracker

An extension tracker keeps associations between extensions and their derived objects on an extension basis. All extensions being added in a tracker will automatically be removed when the extension is uninstalled from the registry. Users interested in extension removal can register a handler that will let them know when an object is being removed.

This interface is not intended to be implemented by clients.

Since:
3.1

Field Summary
static int REF_SOFT
          Constant for soft reference holding.
static int REF_STRONG
          Constant for strong (normal) reference holding.
static int REF_WEAK
          Constant for weak reference holding.
 
Method Summary
 void close()
          Close the tracker.
 Object[] getObjects(IExtension extension)
          Get all the objects that have been associated with the given extension.
 void registerHandler(IExtensionChangeHandler handler, IFilter filter)
          Register an extension change handler with this tracker using the given filter
 void registerObject(IExtension extension, Object object, int referenceType)
          Create an association between the given extension and the given object.
 void unregisterHandler(IExtensionChangeHandler handler)
          Unregister the given extension change handler previously registered with this tracker
 Object[] unregisterObject(IExtension extension)
          Remove all the objects associated with the given extension and return them.
 void unregisterObject(IExtension extension, Object object)
          Remove an association between the given extension and the given object.
 

Field Detail

REF_STRONG

public static final int REF_STRONG
Constant for strong (normal) reference holding. Value 1.

See Also:
Constant Field Values

REF_SOFT

public static final int REF_SOFT
Constant for soft reference holding. Value 2.

See Also:
Constant Field Values

REF_WEAK

public static final int REF_WEAK
Constant for weak reference holding. Value 3.

See Also:
Constant Field Values
Method Detail

registerHandler

public void registerHandler(IExtensionChangeHandler handler,
                            IFilter filter)
Register an extension change handler with this tracker using the given filter

Parameters:
handler - the handler to be registered
filter - the filter to use to choose interesting changes

unregisterHandler

public void unregisterHandler(IExtensionChangeHandler handler)
Unregister the given extension change handler previously registered with this tracker

Parameters:
handler - the handler to be unregistered

registerObject

public void registerObject(IExtension extension,
                           Object object,
                           int referenceType)
Create an association between the given extension and the given object. The referenceType indicates how strongly the object is being kept in memory. There is 3 possible values: strong, soft, weak.

Parameters:
extension - : an extension
object - : the object to associate with the extension
referenceType - : one of REF_STRONG, REF_SOFT, REF_WEAK

unregisterObject

public void unregisterObject(IExtension extension,
                             Object object)
Remove an association between the given extension and the given object.

Parameters:
extension - : the extension under which the object has been registered
object - : the object to unregister

unregisterObject

public Object[] unregisterObject(IExtension extension)
Remove all the objects associated with the given extension and return them.

Parameters:
extension - : the extension for which the objects are removed
Returns:
the objects that were assoicated with the extension.s

getObjects

public Object[] getObjects(IExtension extension)
Get all the objects that have been associated with the given extension. All objects registered strongly will be return unless they have been unregistered. The objects registered softly or weakly may not be returned if they have been garbage collected.

Parameters:
extension - the extension for which the object must be returned
Returns:
an array of objects associated with this extension, or an empty array if no association exists

close

public void close()
Close the tracker. All registered objects are fred and all handlers are being automatically removed.


Eclipse Platform
Release 3.1

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.