mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 17:05:43 +01:00
adopt fix for circular dependencies from 1.x branch
This commit is contained in:
@@ -34,6 +34,7 @@ package sonia.scm.repository.spi;
|
|||||||
//~--- non-JDK imports --------------------------------------------------------
|
//~--- non-JDK imports --------------------------------------------------------
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Provider;
|
||||||
|
|
||||||
import sonia.scm.repository.Repository;
|
import sonia.scm.repository.Repository;
|
||||||
import sonia.scm.repository.RepositoryException;
|
import sonia.scm.repository.RepositoryException;
|
||||||
@@ -56,14 +57,16 @@ public final class HookEventFacade
|
|||||||
* Constructs ...
|
* Constructs ...
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param repositoryManager
|
* @param repositoryManagerProvider
|
||||||
* @param hookContextFactory
|
* @param hookContextFactory
|
||||||
|
*
|
||||||
|
* @since 1.38
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public HookEventFacade(RepositoryManager repositoryManager,
|
public HookEventFacade(Provider<RepositoryManager> repositoryManagerProvider,
|
||||||
HookContextFactory hookContextFactory)
|
HookContextFactory hookContextFactory)
|
||||||
{
|
{
|
||||||
this.repositoryManager = repositoryManager;
|
this.repositoryManagerProvider = repositoryManagerProvider;
|
||||||
this.hookContextFactory = hookContextFactory;
|
this.hookContextFactory = hookContextFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,7 +84,7 @@ public final class HookEventFacade
|
|||||||
*/
|
*/
|
||||||
public HookEventHandler handle(String id) throws RepositoryException
|
public HookEventHandler handle(String id) throws RepositoryException
|
||||||
{
|
{
|
||||||
return handle(repositoryManager.get(id));
|
return handle(repositoryManagerProvider.get().get(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -98,7 +101,7 @@ public final class HookEventFacade
|
|||||||
public HookEventHandler handle(String type, String repositoryName)
|
public HookEventHandler handle(String type, String repositoryName)
|
||||||
throws RepositoryException
|
throws RepositoryException
|
||||||
{
|
{
|
||||||
return handle(repositoryManager.get(type, repositoryName));
|
return handle(repositoryManagerProvider.get().get(type, repositoryName));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -119,8 +122,8 @@ public final class HookEventFacade
|
|||||||
throw new RepositoryNotFoundException("could not find repository");
|
throw new RepositoryNotFoundException("could not find repository");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new HookEventHandler(repositoryManager, hookContextFactory,
|
return new HookEventHandler(repositoryManagerProvider.get(),
|
||||||
repository);
|
hookContextFactory, repository);
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- inner classes --------------------------------------------------------
|
//~--- inner classes --------------------------------------------------------
|
||||||
@@ -191,5 +194,5 @@ public final class HookEventFacade
|
|||||||
private final HookContextFactory hookContextFactory;
|
private final HookContextFactory hookContextFactory;
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
private final RepositoryManager repositoryManager;
|
private final Provider<RepositoryManager> repositoryManagerProvider;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user