public class InstrumentTools extends Object
| Constructor and Description |
|---|
InstrumentTools() |
| Modifier and Type | Method and Description |
|---|---|
static IExtension |
getLastExtension(IInstrumentRegistry registry,
String extensionPointId)
A tool method to simplify handling of "singleton" extensions, for example
configuration information.
|
static IExtension |
getOrCreateExtension(IInstrument provider,
String extensionPointId,
String id) |
static void |
installExtensions(IInstrumentRegistry registry,
String point,
IExtensionPointHandler functor)
Helper method to register all extensions to an extension point correctly.
|
static boolean |
isPrerequisiteImplied(IInstrument instrument,
IInstrument requiredInstrument)
Check if
newPrerequisite is required already directly or
indirectly |
static IExtension |
lookupDefiningExtension(IExtensionPoint extensionPoint,
Object object)
Lookup the
IExtension within extensionPoint that originally
defined the object (performed an "insert" operation). |
static IInstrument |
lookupInstrument(IInstrumentRegistry registry,
String instrumentId) |
static IInstrument |
lookupOrCreateInstrument(IInstrumentRegistry registry,
String instrumentId,
IInstrumentStore store) |
static IExtension |
objectDelete(IInstrument provider,
String extensionPointId,
Object target) |
static IExtension |
objectInsert(IInstrument provider,
String extensionPointId,
Object target)
Initiate the insertion of the definition for object within an
IExtension to provider. |
static IExtension |
objectUpdate(IInstrument provider,
String extensionPointId,
Object target) |
static void |
uninstallExtensions(IInstrumentRegistry registry,
String point,
IExtensionPointHandler functor)
Clean up artifacts / references to functor.
|
public static IExtension getLastExtension(IInstrumentRegistry registry, String extensionPointId)
extensionPointId - public static IExtension getOrCreateExtension(IInstrument provider, String extensionPointId, String id) throws ObjectCreationException, InstrumentRegistryException
public static void installExtensions(IInstrumentRegistry registry, String point, IExtensionPointHandler functor) throws InstrumentRegistryException
IExtensionPoint "point".
It is safe to call this method repeatedly with the identical functor object. Access is synchronized and installation will be executed at most once.
You should take care to uninstallExtensions to protect
against memory leaks.
ATTENTION: "functor" must be a unique (not transient) object as it is used as a handle to guard against multiple installs.
point - elementName - functor - ExtensionInstallationExceptionInstrumentRegistryExceptionpublic static boolean isPrerequisiteImplied(IInstrument instrument, IInstrument requiredInstrument)
newPrerequisite is required already directly or
indirectlynewPrerequisite - public static IExtension lookupDefiningExtension(IExtensionPoint extensionPoint, Object object)
IExtension within extensionPoint that originally
defined the object (performed an "insert" operation).extensionPoint - object - public static IInstrument lookupInstrument(IInstrumentRegistry registry, String instrumentId)
public static IInstrument lookupOrCreateInstrument(IInstrumentRegistry registry, String instrumentId, IInstrumentStore store) throws ObjectCreationException, InstrumentRegistryException
public static IExtension objectDelete(IInstrument provider, String extensionPointId, Object target) throws ObjectCreationException, InstrumentRegistryException, InstrumentRegistryException
public static IExtension objectInsert(IInstrument provider, String extensionPointId, Object target) throws ObjectCreationException, InstrumentRegistryException
IExtension to provider.
The system looks up or creates the IExtension for
extensionPointId, manages the prerequisites and requests the
serialization of the object within the IExtension.
provider - extensionPointId - target - ObjectCreationExceptionExtensionInstallationExceptionInstrumentRegistryExceptionpublic static IExtension objectUpdate(IInstrument provider, String extensionPointId, Object target) throws ObjectCreationException, InstrumentRegistryException
public static void uninstallExtensions(IInstrumentRegistry registry, String point, IExtensionPointHandler functor) throws InstrumentRegistryException
point - functor - ExtensionInstallationExceptionInstrumentRegistryExceptionCopyright © 2013 intarsys consulting GmbH. All Rights Reserved.