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