use of org.neo4j.kernel.ha.cluster.modeswitch.LockManagerSwitcher in project neo4j by neo4j.
the class HighlyAvailableEditionModule method createLockManager.
private Locks createLockManager(ComponentSwitcherContainer componentSwitcherContainer, Config config, DelegateInvocationHandler<Master> masterDelegateInvocationHandler, RequestContextFactory requestContextFactory, AvailabilityGuard availabilityGuard, Clock clock, LogService logService) {
DelegateInvocationHandler<Locks> lockManagerDelegate = new DelegateInvocationHandler<>(Locks.class);
Locks lockManager = (Locks) newProxyInstance(Locks.class.getClassLoader(), new Class[] { Locks.class }, lockManagerDelegate);
Factory<Locks> locksFactory = () -> CommunityEditionModule.createLockManager(config, clock, logService);
LockManagerSwitcher lockManagerModeSwitcher = new LockManagerSwitcher(lockManagerDelegate, masterDelegateInvocationHandler, requestContextFactory, availabilityGuard, locksFactory, logService.getInternalLogProvider(), config);
componentSwitcherContainer.add(lockManagerModeSwitcher);
return lockManager;
}
Aggregations