1 11 package org.eclipse.core.runtime; 12 13 import java.io.File ; 14 import org.eclipse.core.internal.registry.*; 15 import org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI; 16 import org.eclipse.core.runtime.spi.*; 17 18 31 public final class RegistryFactory { 32 33 54 public static IExtensionRegistry createRegistry(RegistryStrategy strategy, Object masterToken, Object userToken) { 55 return new ExtensionRegistry(strategy, masterToken, userToken); 56 } 57 58 65 public static IExtensionRegistry getRegistry() { 66 IRegistryProvider defaultRegistryProvider = RegistryProviderFactory.getDefault(); 67 if (defaultRegistryProvider == null) 68 return null; 69 return defaultRegistryProvider.getRegistry(); 70 } 71 72 104 public static RegistryStrategy createOSGiStrategy(File [] storageDirs, boolean[] cacheReadOnly, Object token) { 105 return new RegistryStrategyOSGI(storageDirs, cacheReadOnly, token); 106 } 107 108 125 public static void setDefaultRegistryProvider(IRegistryProvider provider) throws CoreException { 126 RegistryProviderFactory.setDefault(provider); 127 } 128 } 129 | Popular Tags |