public Object createService(IProvisioningAgent agent) { return new MetadataRepositoryManager(agent); } }
public IMetadataRepository getRepository(URI location) { return (IMetadataRepository) basicGetRepository(location); }
public IMetadataRepository refreshRepository(URI location, IProgressMonitor monitor) throws ProvisionException { return (IMetadataRepository) basicRefreshRepository(location, monitor); }
@Override public String setProperty(String key, String newValue, IProgressMonitor monitor) { try { String oldValue = null; synchronized (this) { oldValue = super.setProperty(key, newValue, monitor); if (oldValue == newValue || (oldValue != null && oldValue.equals(newValue))) return oldValue; save(); } //force repository manager to reload this repository because it caches properties MetadataRepositoryManager manager = (MetadataRepositoryManager) getProvisioningAgent().getService(IMetadataRepositoryManager.SERVICE_NAME); if (manager.removeRepository(getLocation())) manager.addRepository(this); return oldValue; } finally { if (monitor != null) monitor.done(); } }
protected IRepository<IInstallableUnit> factoryLoad(URI location, IExtension extension, int flags, SubMonitor monitor) throws ProvisionException { MetadataRepositoryFactory factory = (MetadataRepositoryFactory) createExecutableExtension(extension, EL_FACTORY); if (factory == null) return null; factory.setAgent(agent); return factory.load(location, flags, monitor); }
public IMetadataRepository loadRepository(URI location, IProgressMonitor monitor) throws ProvisionException { return loadRepository(location, 0, monitor); }
/** * Helper method to create an extension location metadata repository at the given URI. * If one already exists at that location then an exception will be thrown. * * This method never returns <code>null</code>. * * @throws IllegalStateException * @throws ProvisionException */ public static IMetadataRepository createExtensionLocationMetadataRepository(URI location, String name, Map<String, String> properties) throws ProvisionException { IProvisioningAgent agent = getAgent(); IMetadataRepositoryManager manager = (IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME); if (manager == null) throw new IllegalStateException("MetadataRepositoryManager not registered."); //$NON-NLS-1$ ExtensionLocationMetadataRepositoryFactory factory = new ExtensionLocationMetadataRepositoryFactory(); factory.setAgent(agent); // always compress repositories that we are creating. Map<String, String> repositoryProperties = new HashMap<String, String>(); repositoryProperties.put(IRepository.PROP_COMPRESSED, Boolean.TRUE.toString()); if (properties != null) repositoryProperties.putAll(properties); IMetadataRepository repository = factory.create(location, name, ExtensionLocationMetadataRepository.TYPE, repositoryProperties); //we need to add the concrete repository to the repository manager, or its properties will not be correct ((MetadataRepositoryManager) manager).addRepository(repository); manager.setRepositoryProperty(location, IRepository.PROP_SYSTEM, String.valueOf(true)); return repository; }
public IMetadataRepository createRepository(URI location, String name, String type, Map<String, String> properties) throws ProvisionException { return (IMetadataRepository) doCreateRepository(location, name, type, properties); }
@Override public String setProperty(String key, String newValue, IProgressMonitor monitor) { try { String oldValue = null; synchronized (this) { oldValue = super.setProperty(key, newValue, monitor); if (oldValue == newValue || (oldValue != null && oldValue.equals(newValue))) return oldValue; save(); } //force repository manager to reload this repository because it caches properties MetadataRepositoryManager manager = (MetadataRepositoryManager) getProvisioningAgent().getService(IMetadataRepositoryManager.SERVICE_NAME); if (manager.removeRepository(getLocation())) manager.addRepository(this); return oldValue; } finally { if (monitor != null) monitor.done(); } }
protected IRepository<IInstallableUnit> factoryLoad(URI location, IExtension extension, int flags, SubMonitor monitor) throws ProvisionException { MetadataRepositoryFactory factory = (MetadataRepositoryFactory) createExecutableExtension(extension, EL_FACTORY); if (factory == null) return null; factory.setAgent(agent); return factory.load(location, flags, monitor); }
public IMetadataRepository loadRepository(URI location, int flags, IProgressMonitor monitor) throws ProvisionException { return (IMetadataRepository) loadRepository(location, monitor, null, flags); }
public IMetadataRepository createRepository(URI location, String name, String type, Map<String, String> properties) throws ProvisionException { return (IMetadataRepository) doCreateRepository(location, name, type, properties); }
@Override public String setProperty(String key, String newValue, IProgressMonitor monitor) { try { String oldValue = null; synchronized (this) { oldValue = super.setProperty(key, newValue, monitor); if (oldValue == newValue || (oldValue != null && oldValue.equals(newValue))) return oldValue; save(); } //force repository manager to reload this repository because it caches properties MetadataRepositoryManager manager = (MetadataRepositoryManager) getProvisioningAgent().getService(IMetadataRepositoryManager.SERVICE_NAME); if (manager.removeRepository(getLocation())) manager.addRepository(this); return oldValue; } finally { if (monitor != null) monitor.done(); } }
protected IRepository<IInstallableUnit> factoryCreate(URI location, String name, String type, Map<String, String> properties, IExtension extension) throws ProvisionException { MetadataRepositoryFactory factory = (MetadataRepositoryFactory) createExecutableExtension(extension, EL_FACTORY); if (factory == null) return null; factory.setAgent(agent); return factory.create(location, name, type, properties); }
public IMetadataRepository loadRepository(URI location, IProgressMonitor monitor) throws ProvisionException { return loadRepository(location, 0, monitor); }
public Object createService(IProvisioningAgent agent) { return new MetadataRepositoryManager(agent); } }
public IMetadataRepository createRepository(URI location, String name, String type, Map<String, String> properties) throws ProvisionException { return (IMetadataRepository) doCreateRepository(location, name, type, properties); }
public IMetadataRepository refreshRepository(URI location, IProgressMonitor monitor) throws ProvisionException { return (IMetadataRepository) basicRefreshRepository(location, monitor); }
public IMetadataRepository getRepository(URI location) { return (IMetadataRepository) basicGetRepository(location); }
protected IRepository<IInstallableUnit> factoryCreate(URI location, String name, String type, Map<String, String> properties, IExtension extension) throws ProvisionException { MetadataRepositoryFactory factory = (MetadataRepositoryFactory) createExecutableExtension(extension, EL_FACTORY); if (factory == null) return null; factory.setAgent(agent); return factory.create(location, name, type, properties); }