public interface NotifyingRepository extends Repository
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.
|
void |
removeRepositoryConnectionListener(RepositoryConnectionListener listener)
Removes a registered RepositoryConnectionListener from this repository.
|
void |
removeRepositoryListener(RepositoryListener listener)
Removes a registered RepositoryListener from this repository.
|
getDataDir, getValueFactory, init, initialize, isInitialized, isWritable, setDataDir, shutDown
void addRepositoryListener(RepositoryListener listener)
void removeRepositoryListener(RepositoryListener listener)
void addRepositoryConnectionListener(RepositoryConnectionListener listener)
void removeRepositoryConnectionListener(RepositoryConnectionListener listener)
NotifyingRepositoryConnection getConnection() throws RepositoryException
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 RepositoryConnection
s.getConnection
in interface Repository
RepositoryException
- If something went wrong during the creation of the Connection.Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.