01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 2007.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.repository.config;
07:
08: import info.aduna.lang.service.ServiceRegistry;
09:
10: /**
11: * A registry that keeps track of the available {@link RepositoryFactory}s.
12: *
13: * @author Arjohn Kampman
14: */
15: public class RepositoryRegistry extends
16: ServiceRegistry<String, RepositoryFactory> {
17:
18: private static RepositoryRegistry defaultRegistry;
19:
20: /**
21: * Gets the default QueryParserRegistry.
22: *
23: * @return The default registry.
24: */
25: public static synchronized RepositoryRegistry getInstance() {
26: if (defaultRegistry == null) {
27: defaultRegistry = new RepositoryRegistry();
28: }
29:
30: return defaultRegistry;
31: }
32:
33: public RepositoryRegistry() {
34: super (RepositoryFactory.class);
35: }
36:
37: @Override
38: protected String getKey(RepositoryFactory factory) {
39: return factory.getRepositoryType();
40: }
41: }
|