01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2007.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.repository.base;
07:
08: import java.io.File;
09:
10: import org.openrdf.model.ValueFactory;
11: import org.openrdf.repository.DelegatingRepository;
12: import org.openrdf.repository.Repository;
13: import org.openrdf.repository.RepositoryConnection;
14: import org.openrdf.repository.RepositoryException;
15:
16: /**
17: * A {@link DelegatingRepository} implementation that, by default, forwards all
18: * method calls to its delegate.
19: *
20: * @author Herko ter Horst
21: * @author Arjohn Kampman
22: */
23: public class RepositoryWrapper implements DelegatingRepository {
24:
25: private Repository delegate;
26:
27: /**
28: * Creates a new <tt>RepositoryWrapper</tt>.
29: */
30: public RepositoryWrapper() {
31: }
32:
33: /**
34: * Creates a new <tt>RepositoryWrapper</tt> and calls
35: * {@link #setDelegate(Repository)} with the supplied delegate repository.
36: */
37: public RepositoryWrapper(Repository delegate) {
38: setDelegate(delegate);
39: }
40:
41: public void setDelegate(Repository delegate) {
42: this .delegate = delegate;
43: }
44:
45: public Repository getDelegate() {
46: return delegate;
47: }
48:
49: public void setDataDir(File dataDir) {
50: getDelegate().setDataDir(dataDir);
51: }
52:
53: public File getDataDir() {
54: return getDelegate().getDataDir();
55: }
56:
57: public void initialize() throws RepositoryException {
58: getDelegate().initialize();
59: }
60:
61: public void shutDown() throws RepositoryException {
62: getDelegate().shutDown();
63: }
64:
65: public boolean isWritable() throws RepositoryException {
66: return getDelegate().isWritable();
67: }
68:
69: public RepositoryConnection getConnection()
70: throws RepositoryException {
71: return getDelegate().getConnection();
72: }
73:
74: public ValueFactory getValueFactory() {
75: return getDelegate().getValueFactory();
76: }
77: }
|