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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDataDir, getValueFactory, init, isInitialized, isWritable
public 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 NotifyingRepository
public void removeRepositoryListener(RepositoryListener listener)
removeRepositoryListener
in interface NotifyingRepository
public void addRepositoryConnectionListener(RepositoryConnectionListener listener)
addRepositoryConnectionListener
in interface NotifyingRepository
public void removeRepositoryConnectionListener(RepositoryConnectionListener listener)
removeRepositoryConnectionListener
in interface NotifyingRepository
public NotifyingRepositoryConnection getConnection() throws RepositoryException
Repository
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 NotifyingRepository
getConnection
in interface Repository
getConnection
in class RepositoryWrapper
RepositoryException
- If something went wrong during the creation of the Connection.public void initialize() throws RepositoryException
Repository
initialize
in interface Repository
initialize
in class RepositoryWrapper
RepositoryException
- If the initialization failed.public void setDataDir(File dataDir)
Repository
setDataDir
in interface Repository
setDataDir
in class RepositoryWrapper
dataDir
- the directory where data for this repository is storedpublic void shutDown() throws RepositoryException
Repository
shutDown
in interface Repository
shutDown
in class RepositoryWrapper
RepositoryException
Copyright © 2015-2019 Eclipse Foundation. All Rights Reserved.