|
JPF 0.10 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Root interface to get access to all meta-information about discovered
plug-ins. All objects accessible from the registry are immutable. You
can imagine registry as a read-only storage of full information about
discovered plug-ins. There is only one exception from this rule: internal
state of registry, plug-in descriptors and plug-in elements can be modified
indirectly by registering
or
un-registering
plug-ins with this
registry. If your code is interested to be notified on all modifications
of plug-ins set, you can
register
an implementation of PluginRegistry.RegistryChangeListener
with this
registry.
Notes on unique ID's (UID's)
There are two types of identifiers in the API: ID's and UID's. ID is an
identifier that is unique within set of elements of the same type. UID is
an identifier that unique globally within registry space. ID is usually
defined by developer in plug-in manifest. UID always combined automatically
from several other plug-in "parts". All plug-in elements have method
getId()
that come from
basic Identity
interface, but not all
elements have UID - only those that inherits
UniqueIdentity
interface.
There are several utility methods available in this interface that aimed
to build UID from different plug-in "parts" and also split UID to it's
original elements: makeUniqueId(String, Version)
,
makeUniqueId(String, String)
, extractPluginId(String)
,
extractId(String)
and extractVersion(String)
.
ObjectFactory.createRegistry()
Nested Class Summary | |
static interface |
PluginRegistry.ManifestInfo
Manifest info holder interface. |
static interface |
PluginRegistry.RegistryChangeData
Registry changes data holder interface. |
static interface |
PluginRegistry.RegistryChangeListener
Plug-in registry changes callback interface. |
Method Summary | |
IntegrityCheckReport |
checkIntegrity(PathResolver pathResolver)
Performs integrity check of all registered plug-ins and generates result as a collection of standard report items. |
IntegrityCheckReport |
checkIntegrity(PathResolver pathResolver,
boolean includeRegistrationReport)
Performs integrity check of all registered plug-ins and generates result as a collection of standard report items. |
void |
configure(ExtendedProperties config)
Configures this registry instance. |
java.lang.String |
extractId(java.lang.String uniqueId)
Extracts plug-in element ID from some unique identifier. |
java.lang.String |
extractPluginId(java.lang.String uniqueId)
Extracts plug-in ID from some unique identifier. |
Version |
extractVersion(java.lang.String uniqueId)
Extracts plug-in version identifier from some unique identifier (plug-in or plug-in fragment). |
java.util.Collection |
getDependingPlugins(PluginDescriptor descr)
Utility method that recursively collects all plug-ins that depends on the given plug-in. |
ExtensionPoint |
getExtensionPoint(java.lang.String uniqueId)
Looks for extension point. |
ExtensionPoint |
getExtensionPoint(java.lang.String pluginId,
java.lang.String pointId)
Looks for extension point. |
java.util.Collection |
getOldPluginDescriptors(java.lang.String pluginId)
Deprecated. without any replacement, this method will be removed before 1.0 release |
java.util.Collection |
getOldPluginFragments(java.lang.String pluginFragmentId)
Deprecated. without any replacement, this method will be removed before 1.0 release |
PluginDescriptor |
getPluginDescriptor(java.lang.String pluginId)
Returns descriptor of plug-in with given ID. |
java.util.Collection |
getPluginDescriptors()
Returns collection of descriptors of all plug-ins that was successfully populated by this registry. |
java.util.Collection |
getPluginFragments()
Returns collection of descriptors of all plug-in fragments that was successfully populated by this registry. |
IntegrityCheckReport |
getRegistrationReport()
|
boolean |
isExtensionPointAvailable(java.lang.String uniqueId)
Checks if extension point exists and is in valid state. |
boolean |
isExtensionPointAvailable(java.lang.String pluginId,
java.lang.String pointId)
Checks if extension point exists and is in valid state. |
boolean |
isPluginDescriptorAvailable(java.lang.String pluginId)
Checks if plug-in exists and is in valid state. |
java.lang.String |
makeUniqueId(java.lang.String pluginId,
java.lang.String elementId)
Constructs unique identifier for some plug-in element from it's ID. |
java.lang.String |
makeUniqueId(java.lang.String pluginId,
Version version)
Constructs unique identifier for plug-in with given ID. |
PluginRegistry.ManifestInfo |
readManifestInfo(java.net.URL manifest)
Reads basic information from a plug-in or plug-in fragment manifest. |
java.util.Map |
register(java.net.URL[] manifests)
Registers plug-ins and plug-in fragments in this registry. |
void |
registerListener(PluginRegistry.RegistryChangeListener listener)
Registers plug-in registry change event listener. |
java.util.Collection |
unregister(java.lang.String[] ids)
Unregisters plug-ins and plug-in fragments with given ID's (including depending plug-ins and plug-in fragments). |
void |
unregisterListener(PluginRegistry.RegistryChangeListener listener)
Unregisters registry change event listener. |
Method Detail |
public java.util.Map register(java.net.URL[] manifests) throws ManifestProcessingException
PluginManager
instance as it is not aware of any manager.
Using this method just makes plug-in meta-data available for reading from
this registry.
If more than one version of the same plug-in or plug-in fragment given, the only latest version should be registered. If some plug-in or plug-in fragment already registered it should be ignored by this method. Client application have to un-register such plug-ins first before registering their newest versions.
manifests
- array of manifest locations
ManifestProcessingException
- if manifest processing error has
occurred (optional behavior)PluginManager.publishPlugins(PluginManager.PluginLocation[])
public PluginRegistry.ManifestInfo readManifestInfo(java.net.URL manifest) throws ManifestProcessingException
manifest
- manifest data URL
ManifestProcessingException
- if manifest data can't be readpublic java.util.Collection unregister(java.lang.String[] ids)
ids
- ID's of plug-ins and plug-in fragments to be
unregistered
public PluginDescriptor getPluginDescriptor(java.lang.String pluginId)
IllegalArgumentException
. In other words, this method
shouldn't return null
.
pluginId
- plug-id ID
public boolean isPluginDescriptorAvailable(java.lang.String pluginId)
true
, the method
getPluginDescriptor(String)
should always return valid plug-in
descriptor.
pluginId
- plug-in ID
true
if plug-in exists and validpublic java.util.Collection getPluginDescriptors()
PluginDescriptor
objectspublic ExtensionPoint getExtensionPoint(java.lang.String pluginId, java.lang.String pointId)
IllegalArgumentException
if requested extension point
can't be found or is in invalid state.
pluginId
- plug-in IDpointId
- extension point ID
ExtensionPoint.isValid()
public ExtensionPoint getExtensionPoint(java.lang.String uniqueId)
uniqueId
- extension point unique ID
getExtensionPoint(String, String)
public boolean isExtensionPointAvailable(java.lang.String pluginId, java.lang.String pointId)
true
, the method
getExtensionPoint(String, String)
should always return valid
extension point.
pluginId
- plug-in IDpointId
- extension point ID
true
if extension point exists and validpublic boolean isExtensionPointAvailable(java.lang.String uniqueId)
uniqueId
- extension point unique ID
true
if extension point exists and validisExtensionPointAvailable(String, String)
public java.util.Collection getOldPluginDescriptors(java.lang.String pluginId)
pluginId
- plug-in ID
PluginDescriptor
objectspublic java.util.Collection getPluginFragments()
PluginFragment
objectspublic java.util.Collection getOldPluginFragments(java.lang.String pluginFragmentId)
pluginFragmentId
- plug-in fragment ID
PluginFragment
objectspublic java.util.Collection getDependingPlugins(PluginDescriptor descr)
descr
- descriptor of plug-in to collect dependencies for
plug-in descriptors
that depend on given plug-inpublic IntegrityCheckReport checkIntegrity(PathResolver pathResolver)
pathResolver
- optional path resolver
public IntegrityCheckReport checkIntegrity(PathResolver pathResolver, boolean includeRegistrationReport)
pathResolver
- optional path resolverincludeRegistrationReport
- if true
, the plug-ins
registration report will be included
into resulting report
public IntegrityCheckReport getRegistrationReport()
public java.lang.String makeUniqueId(java.lang.String pluginId, java.lang.String elementId)
pluginId
- plug-in IDelementId
- element ID
public java.lang.String makeUniqueId(java.lang.String pluginId, Version version)
pluginId
- plug-in IDversion
- plug-in version identifier
public java.lang.String extractPluginId(java.lang.String uniqueId)
uniqueId
- unique ID
public java.lang.String extractId(java.lang.String uniqueId)
uniqueId
- unique ID
public Version extractVersion(java.lang.String uniqueId)
uniqueId
- unique ID
public void registerListener(PluginRegistry.RegistryChangeListener listener)
IllegalArgumentException
.
listener
- new registry change event listenerpublic void unregisterListener(PluginRegistry.RegistryChangeListener listener)
IllegalArgumentException
.
listener
- registered listenerpublic void configure(ExtendedProperties config)
object factory
implementation.
config
- registry configuration data
|
JPF 0.10 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |