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() |
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) |
void |
setDefaultReportDeltas(boolean defaultReportDeltas) |
void |
shutDown() |
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
NotifyingRepository
Connection con = repository.getConnection();
try {
// perform operations on the connection
} finally {
con.close();
}
Note that RepositoryConnection is not guaranteed to be thread-safe! The recommended pattern for
repository access in a multithreaded 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
initialize in interface Repositoryinitialize in class RepositoryWrapperRepositoryExceptionpublic void setDataDir(File dataDir)
setDataDir in interface RepositorysetDataDir in class RepositoryWrapperpublic void shutDown()
throws RepositoryException
shutDown in interface RepositoryshutDown in class RepositoryWrapperRepositoryExceptionCopyright © 2015-2021 Eclipse Foundation. All Rights Reserved.