Search in sources :

Example 1 with RepositoryListener

use of org.locationtech.geogig.repository.Repository.RepositoryListener in project GeoGig by boundlessgeo.

the class RepositoryDecorator method decorate.

@Override
public <I> I decorate(I subject) {
    if (listener == null) {
        listener = new RepositoryListener() {

            @Override
            public void opened(Repository repo) {
                service.startAsync().awaitRunning();
            }

            @Override
            public void closed() {
                service.stopAsync();
            }
        };
        ((Repository) subject).addListener(listener);
    }
    return subject;
}
Also used : RepositoryListener(org.locationtech.geogig.repository.Repository.RepositoryListener) Repository(org.locationtech.geogig.repository.Repository)

Aggregations

Repository (org.locationtech.geogig.repository.Repository)1 RepositoryListener (org.locationtech.geogig.repository.Repository.RepositoryListener)1