public class NotifyingRepositoryWrapper extends RepositoryWrapper implements NotifyingRepository
NotifyingRepositoryConnectionWrapper| Constructor and Description |
|---|
NotifyingRepositoryWrapper() |
NotifyingRepositoryWrapper(Repository delegate) |
NotifyingRepositoryWrapper(Repository delegate,
boolean defaultReportDeltas) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRepositoryConnectionListener(RepositoryConnectionListener listener)
Registers a RepositoryConnectionListener that will receive notifications of operations that are
performed on any< connections that are created by this repository.
|
void |
addRepositoryListener(RepositoryListener listener)
Registers a RepositoryListener that will receive notifications of operations that are performed on this
repository.
|
NotifyingRepositoryConnection |
getConnection()
Opens a connection to this repository that can be used for querying and updating the contents of the repository.
|
boolean |
getDefaultReportDeltas() |
void |
initialize()
Initializes this repository.
|
void |
removeRepositoryConnectionListener(RepositoryConnectionListener listener)
Removes a registered RepositoryConnectionListener from this repository.
|
void |
removeRepositoryListener(RepositoryListener listener)
Removes a registered RepositoryListener from this repository.
|
void |
setDataDir(File dataDir)
Set the directory where data and logging for this repository is stored.
|
void |
setDefaultReportDeltas(boolean defaultReportDeltas) |
void |
shutDown()
Shuts the repository down, releasing any resources that it keeps hold of.
|
getDataDir, getDelegate, getValueFactory, isInitialized, isWritable, setDelegate, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDataDir, getValueFactory, init, isInitialized, isWritablepublic NotifyingRepositoryWrapper()
public NotifyingRepositoryWrapper(Repository delegate)
public NotifyingRepositoryWrapper(Repository delegate, boolean defaultReportDeltas)
public boolean getDefaultReportDeltas()
public void setDefaultReportDeltas(boolean defaultReportDeltas)
public void addRepositoryListener(RepositoryListener listener)
addRepositoryListener in interface NotifyingRepositorypublic void removeRepositoryListener(RepositoryListener listener)
removeRepositoryListener in interface NotifyingRepositorypublic void addRepositoryConnectionListener(RepositoryConnectionListener listener)
addRepositoryConnectionListener in interface NotifyingRepositorypublic void removeRepositoryConnectionListener(RepositoryConnectionListener listener)
removeRepositoryConnectionListener in interface NotifyingRepositorypublic NotifyingRepositoryConnection getConnection() throws RepositoryException
Repository
try (RepositoryConnection conn = repository.getConnection()) {
// perform operations on the connection
}
Note that RepositoryConnection is not guaranteed to be thread-safe! The recommended pattern for
repository access in a multi-threaded application is to share the Repository object between threads, but have
each thread create and use its own RepositoryConnections.getConnection in interface NotifyingRepositorygetConnection in interface RepositorygetConnection in class RepositoryWrapperRepositoryException - If something went wrong during the creation of the Connection.public void initialize()
throws RepositoryException
Repositoryinitialize in interface Repositoryinitialize in class RepositoryWrapperRepositoryException - If the initialization failed.public void setDataDir(File dataDir)
RepositorysetDataDir in interface RepositorysetDataDir in class RepositoryWrapperdataDir - the directory where data for this repository is storedpublic void shutDown()
throws RepositoryException
RepositoryshutDown in interface RepositoryshutDown in class RepositoryWrapperRepositoryExceptionCopyright © 2015-2022 Eclipse Foundation. All Rights Reserved.