public final class RegistryFactory extends Object
The following methods can be used without OSGi running:
createRegistry(RegistryStrategy, Object, Object)
getRegistry()
setDefaultRegistryProvider(IRegistryProvider)
This class is not intended to be subclassed or instantiated.
Constructor and Description |
---|
RegistryFactory() |
Modifier and Type | Method and Description |
---|---|
static RegistryStrategy |
createOSGiStrategy(File[] storageDirs,
boolean[] cacheReadOnly,
Object token)
Creates a registry strategy that can be used in an OSGi container.
|
static IExtensionRegistry |
createRegistry(RegistryStrategy strategy,
Object masterToken,
Object userToken)
Creates a new extension registry based on the given set of parameters.
|
static IExtensionRegistry |
getRegistry()
Returns the default extension registry specified by the registry provider.
|
static void |
setDefaultRegistryProvider(IRegistryProvider provider)
Use this method to specify the default registry provider.
|
public static IExtensionRegistry createRegistry(RegistryStrategy strategy, Object masterToken, Object userToken)
The strategy is an optional collection of methods that supply additional registry
functionality. Users may pass in null
for the strategy if default
behavior is sufficient.
The master token is stored by the registry and later used as an identifier of callers
who are allowed full control over the registry functionality. Users may pass in
null
as a master token.
The user token is stored by the registry and later used as an identifier of callers
who are allowed to control registry at the user level. For instance, users attempting to
modify dynamic contributions to the registry have to use the user token. Users may pass
in null
as a user token.
strategy
- registry strategy or null
masterToken
- the token used for master control of the registry or null
userToken
- the token used for user control of the registry or null
public static IExtensionRegistry getRegistry()
null
if the provider has not been set or if the
registry has not been created.null
public static RegistryStrategy createOSGiStrategy(File[] storageDirs, boolean[] cacheReadOnly, Object token)
The OSGi registry strategy sequentially checks the array of storage directories to
discover the location of the registry cache formed by previous invocations of the extension
registry. Once found, the location is used to store registry cache. If this value
is null
then caching of the registry content is disabled.
The cache read-only array is an array the same length as the storage directory array.
It contains boolean values indicating whether or not each storage directory is read-only.
If the value at an index is true
then the location at the corresponding index
in the storage directories array is read-only; if false
then the cache location
is read-write. The array can be null
if the storageDirs
parameter
is null
.
The master token should be passed to the OSGi registry strategy to permit it to perform contributions to the registry.
storageDirs
- array of file system directories or null
cacheReadOnly
- array of read only attributes or null
token
- control token for the registrycreateRegistry(RegistryStrategy, Object, Object)
public static void setDefaultRegistryProvider(IRegistryProvider provider) throws CoreException
The given registry provider must not be null
.
provider
- extension registry providerCoreException
- if a default registry provider was already set for this applicationgetRegistry()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.