Eclipse Platform
Release 3.2

org.eclipse.core.runtime
Class RegistryUtils

java.lang.Object
  extended byorg.eclipse.core.runtime.RegistryUtils

public final class RegistryUtils
extends Object

Collection of utility methods related to the extension registry functionality. This class is not intended to be subclassed or instantiated.

Since:
org.eclipse.equinox.registry 1.0

Constructor Summary
RegistryUtils()
           
 
Method Summary
static org.eclipse.core.runtime.spi.RegistryStrategy createOSGiStrategy(File storageDir, boolean cacheReadOnly, Object token)
          Creates registry strategy that can be used in OSGi world.
static String getContributorId(Bundle bundle)
          Returns Id corresponding to the OSGi bundle.
static IExtensionRegistry getRegistryFromProvider()
          Returns the existing extension registry specified by the registry provider.
static void setRegistryProvider(IRegistryProvider provider)
          Use this method to specify the default registry provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryUtils

public RegistryUtils()
Method Detail

createOSGiStrategy

public static org.eclipse.core.runtime.spi.RegistryStrategy createOSGiStrategy(File storageDir,
                                                                               boolean cacheReadOnly,
                                                                               Object token)
Creates registry strategy that can be used in OSGi world. It provides the following functionality: - Event scheduling is done using Eclipse job scheduling mechanism - Translation is done with Equinox ResourceTranslator - Uses OSGi bundle model for namespace resolution - Uses bunlde-based class loaders to create executable extensions - Registry is filled with information stored in plugin.xml / fragment.xml files of OSGi bundles with the XML parser is obtained via an OSGi service - Performs registry validation based on the time stamps of the plugin.xml / fragment.xml files

Parameters:
storageDir - - file system directory to store cache files; might be null
cacheReadOnly - - true: cache is read only; false: cache is read/write
token - - control token for the registry

getContributorId

public static String getContributorId(Bundle bundle)
Returns Id corresponding to the OSGi bundle.

Parameters:
bundle - - OSGi bundle
Returns:
Id used for the OSGi bundle
See Also:
IExtensionRegistry.addContribution(java.io.InputStream, java.lang.String, boolean, java.lang.String, java.util.ResourceBundle, java.lang.Object)

getRegistryFromProvider

public static IExtensionRegistry getRegistryFromProvider()
Returns the existing extension registry specified by the registry provider. May return null is the provider has not been set or registry was not created.

Returns:
existing extension registry or null

setRegistryProvider

public static void setRegistryProvider(IRegistryProvider provider)
                                throws CoreException
Use this method to specify the default registry provider. The default registry provider is immutable in the sense that it can be set only once during the application runtime. Attempts to change the default registry provider will cause CoreException.

Parameters:
provider - - extension registry provider
Throws:
CoreException - - default registry provider was already set for this application
See Also:
This is an experimental API. It might change in future.

Eclipse Platform
Release 3.2

Guidelines for using Eclipse APIs.

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