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.sail.config;
07:
08: import info.aduna.lang.service.ServiceRegistry;
09:
10: /**
11: * A registry that keeps track of the available {@link SailFactory}s.
12: *
13: * @author Arjohn Kampman
14: */
15: public class SailRegistry extends ServiceRegistry<String, SailFactory> {
16:
17: private static SailRegistry defaultRegistry;
18:
19: /**
20: * Gets the default SailRegistry.
21: *
22: * @return The default registry.
23: */
24: public static synchronized SailRegistry getInstance() {
25: if (defaultRegistry == null) {
26: defaultRegistry = new SailRegistry();
27: }
28:
29: return defaultRegistry;
30: }
31:
32: public SailRegistry() {
33: super (SailFactory.class);
34: }
35:
36: @Override
37: protected String getKey(SailFactory factory) {
38: return factory.getSailType();
39: }
40: }
|