Search in sources :

Example 1 with LockManagerSwitcher

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;
}
Also used : Locks(org.neo4j.kernel.impl.locking.Locks) LockManagerSwitcher(org.neo4j.kernel.ha.cluster.modeswitch.LockManagerSwitcher) DelegateInvocationHandler(org.neo4j.kernel.ha.DelegateInvocationHandler)

Aggregations

DelegateInvocationHandler (org.neo4j.kernel.ha.DelegateInvocationHandler)1 LockManagerSwitcher (org.neo4j.kernel.ha.cluster.modeswitch.LockManagerSwitcher)1 Locks (org.neo4j.kernel.impl.locking.Locks)1