Search in sources :

Example 1 with GitWebSocket

use of org.eclipse.winery.repository.rest.websockets.GitWebSocket in project winery by eclipse.

the class Prefs method doRepositoryInitialization.

/**
 * Initialization code for the repository. Should go into separate class, but being here should be OK for a
 * prototype
 * <p>
 * Called from both the constructor for JUnit and the servlet-based initialization
 * <p>
 */
private void doRepositoryInitialization() throws Exception {
    RepositoryFactory.reconfigure();
    if (RepositoryFactory.getRepository() instanceof GitBasedRepository) {
        GitWebSocket socket = new GitWebSocket();
        ((GitBasedRepository) RepositoryFactory.getRepository()).registerForEvents(socket);
    } else if (RepositoryFactory.getRepository() instanceof MultiRepository) {
        GitWebSocket socket = new GitWebSocket();
        ((MultiRepository) RepositoryFactory.getRepository()).registerForEvents(socket);
    }
}
Also used : GitWebSocket(org.eclipse.winery.repository.rest.websockets.GitWebSocket) MultiRepository(org.eclipse.winery.repository.filebased.MultiRepository) GitBasedRepository(org.eclipse.winery.repository.backend.filebased.GitBasedRepository)

Aggregations

GitBasedRepository (org.eclipse.winery.repository.backend.filebased.GitBasedRepository)1 MultiRepository (org.eclipse.winery.repository.filebased.MultiRepository)1 GitWebSocket (org.eclipse.winery.repository.rest.websockets.GitWebSocket)1