|
JPF 1.5.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.java.plugin.registry.xml.PluginRegistryImpl
public final class PluginRegistryImpl
This is an implementation of plug-in registry of XML syntax plug-in manifests. Manifests should be prepared according to plug-in DTD.
Configuration parameters
This registry implementation supports following configuration parameters:
true
.registering
or un-registering
plug-ins.
If this is false
, the registration errors will be stored
in the internal report that is available with
PluginRegistry.checkIntegrity(PathResolver)
method.
The default parameter value is false
.
ObjectFactory.createRegistry()
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.java.plugin.registry.PluginRegistry |
---|
PluginRegistry.RegistryChangeData, PluginRegistry.RegistryChangeListener |
Constructor Summary | |
---|---|
PluginRegistryImpl()
Creates plug-in registry object. |
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<PluginDescriptor> |
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. |
PluginDescriptor |
getPluginDescriptor(java.lang.String pluginId)
Returns descriptor of plug-in with given ID. |
java.util.Collection<PluginDescriptor> |
getPluginDescriptors()
Returns collection of descriptors of all plug-ins that was successfully populated by this registry. |
java.util.Collection<PluginFragment> |
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 id)
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. |
ManifestInfo |
readManifestInfo(java.net.URL url)
Reads basic information from a plug-in or plug-in fragment manifest. |
java.util.Map<java.lang.String,Identity> |
register(java.net.URL[] manifests)
General algorithm: Collect all currently registered extension points. |
void |
registerListener(PluginRegistry.RegistryChangeListener listener)
Registers plug-in registry change event listener. |
java.util.Collection<java.lang.String> |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PluginRegistryImpl()
Method Detail |
---|
public void configure(ExtendedProperties config)
PluginRegistry
object factory
implementation.
configure
in interface PluginRegistry
config
- registry configuration dataPluginRegistry.configure(
ExtendedProperties)
public ManifestInfo readManifestInfo(java.net.URL url) throws ManifestProcessingException
PluginRegistry
readManifestInfo
in interface PluginRegistry
url
- manifest data URL
ManifestProcessingException
- if manifest data can't be readPluginRegistry.readManifestInfo(
java.net.URL)
public java.util.Map<java.lang.String,Identity> register(java.net.URL[] manifests) throws ManifestProcessingException
register
in interface PluginRegistry
manifests
- array of manifest locations
ManifestProcessingException
- if manifest processing error has occurred (optional behavior)PluginRegistry.register(java.net.URL[])
public java.util.Collection<java.lang.String> unregister(java.lang.String[] ids)
PluginRegistry
unregister
in interface PluginRegistry
ids
- ID's of plug-ins and plug-in fragments to be unregistered
PluginRegistry.unregister(java.lang.String[])
public ExtensionPoint getExtensionPoint(java.lang.String pluginId, java.lang.String pointId)
PluginRegistry
IllegalArgumentException
if requested extension point can't be
found or is in invalid state.
getExtensionPoint
in interface PluginRegistry
pluginId
- plug-in IDpointId
- extension point ID
PluginRegistry.getExtensionPoint(
java.lang.String, java.lang.String)
public ExtensionPoint getExtensionPoint(java.lang.String uniqueId)
PluginRegistry
getExtensionPoint
in interface PluginRegistry
uniqueId
- extension point unique ID
PluginRegistry.getExtensionPoint(java.lang.String)
public boolean isExtensionPointAvailable(java.lang.String pluginId, java.lang.String pointId)
PluginRegistry
true
, the method
PluginRegistry.getExtensionPoint(String, String)
should always return valid
extension point.
isExtensionPointAvailable
in interface PluginRegistry
pluginId
- plug-in IDpointId
- extension point ID
true
if extension point exists and validPluginRegistry.isExtensionPointAvailable(
java.lang.String, java.lang.String)
public boolean isExtensionPointAvailable(java.lang.String uniqueId)
PluginRegistry
isExtensionPointAvailable
in interface PluginRegistry
uniqueId
- extension point unique ID
true
if extension point exists and validPluginRegistry.isExtensionPointAvailable(
java.lang.String)
public PluginDescriptor getPluginDescriptor(java.lang.String pluginId)
PluginRegistry
IllegalArgumentException
. In other words, this method shouldn't
return null
.
getPluginDescriptor
in interface PluginRegistry
pluginId
- plug-id ID
PluginRegistry.getPluginDescriptor(java.lang.String)
public boolean isPluginDescriptorAvailable(java.lang.String pluginId)
PluginRegistry
true
, the method PluginRegistry.getPluginDescriptor(String)
should always return valid plug-in descriptor.
isPluginDescriptorAvailable
in interface PluginRegistry
pluginId
- plug-in ID
true
if plug-in exists and validPluginRegistry.isPluginDescriptorAvailable(java.lang.String)
public java.util.Collection<PluginDescriptor> getPluginDescriptors()
PluginRegistry
getPluginDescriptors
in interface PluginRegistry
PluginDescriptor
objectsPluginRegistry.getPluginDescriptors()
public java.util.Collection<PluginFragment> getPluginFragments()
PluginRegistry
getPluginFragments
in interface PluginRegistry
PluginFragment
objectsPluginRegistry.getPluginFragments()
public java.util.Collection<PluginDescriptor> getDependingPlugins(PluginDescriptor descr)
PluginRegistry
getDependingPlugins
in interface PluginRegistry
descr
- descriptor of plug-in to collect dependencies for
plug-in descriptors
that
depend on given plug-inPluginRegistry.getDependingPlugins(
org.java.plugin.registry.PluginDescriptor)
public IntegrityCheckReport checkIntegrity(PathResolver pathResolver)
PluginRegistry
checkIntegrity
in interface PluginRegistry
pathResolver
- optional path resolver
PluginRegistry.checkIntegrity(
org.java.plugin.PathResolver)
public IntegrityCheckReport checkIntegrity(PathResolver pathResolver, boolean includeRegistrationReport)
PluginRegistry
checkIntegrity
in interface PluginRegistry
pathResolver
- optional path resolverincludeRegistrationReport
- if true
, the plug-ins registration report will
be included into resulting report
PluginRegistry.checkIntegrity(
org.java.plugin.PathResolver, boolean)
public IntegrityCheckReport getRegistrationReport()
getRegistrationReport
in interface PluginRegistry
PluginRegistry.getRegistrationReport()
public java.lang.String makeUniqueId(java.lang.String pluginId, java.lang.String id)
PluginRegistry
makeUniqueId
in interface PluginRegistry
pluginId
- plug-in IDid
- element ID
PluginRegistry.makeUniqueId(
java.lang.String, java.lang.String)
public java.lang.String makeUniqueId(java.lang.String pluginId, Version version)
PluginRegistry
makeUniqueId
in interface PluginRegistry
pluginId
- plug-in IDversion
- plug-in version identifier
PluginRegistry.makeUniqueId(
java.lang.String, org.java.plugin.registry.Version)
public java.lang.String extractPluginId(java.lang.String uniqueId)
PluginRegistry
extractPluginId
in interface PluginRegistry
uniqueId
- unique ID
PluginRegistry.extractPluginId(java.lang.String)
public java.lang.String extractId(java.lang.String uniqueId)
PluginRegistry
extractId
in interface PluginRegistry
uniqueId
- unique ID
PluginRegistry.extractId(java.lang.String)
public Version extractVersion(java.lang.String uniqueId)
PluginRegistry
extractVersion
in interface PluginRegistry
uniqueId
- unique ID
PluginRegistry.extractVersion(java.lang.String)
public void registerListener(PluginRegistry.RegistryChangeListener listener)
PluginRegistry
IllegalArgumentException
.
registerListener
in interface PluginRegistry
listener
- new registry change event listenerPluginRegistry.registerListener(
org.java.plugin.registry.PluginRegistry.RegistryChangeListener)
public void unregisterListener(PluginRegistry.RegistryChangeListener listener)
PluginRegistry
IllegalArgumentException
.
unregisterListener
in interface PluginRegistry
listener
- registered listenerPluginRegistry.unregisterListener(
org.java.plugin.registry.PluginRegistry.RegistryChangeListener)
|
JPF 1.5.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |