Search in sources :

Example 1 with ReadOnlyTokenCreator

use of org.neo4j.kernel.impl.core.ReadOnlyTokenCreator in project neo4j by neo4j.

the class HighlyAvailableEditionModule method createRelationshipTypeCreator.

private TokenCreator createRelationshipTypeCreator(Config config, ComponentSwitcherContainer componentSwitcherContainer, DelegateInvocationHandler<Master> masterInvocationHandler, RequestContextFactory requestContextFactory, Supplier<KernelAPI> kernelProvider) {
    if (config.get(GraphDatabaseSettings.read_only)) {
        return new ReadOnlyTokenCreator();
    }
    DelegateInvocationHandler<TokenCreator> relationshipTypeCreatorDelegate = new DelegateInvocationHandler<>(TokenCreator.class);
    TokenCreator relationshipTypeCreator = (TokenCreator) newProxyInstance(TokenCreator.class.getClassLoader(), new Class[] { TokenCreator.class }, relationshipTypeCreatorDelegate);
    RelationshipTypeCreatorSwitcher typeCreatorModeSwitcher = new RelationshipTypeCreatorSwitcher(relationshipTypeCreatorDelegate, masterInvocationHandler, requestContextFactory, kernelProvider, idGeneratorFactory);
    componentSwitcherContainer.add(typeCreatorModeSwitcher);
    return relationshipTypeCreator;
}
Also used : RelationshipTypeCreatorSwitcher(org.neo4j.kernel.ha.cluster.modeswitch.RelationshipTypeCreatorSwitcher) ReadOnlyTokenCreator(org.neo4j.kernel.impl.core.ReadOnlyTokenCreator) DelegateInvocationHandler(org.neo4j.kernel.ha.DelegateInvocationHandler) ReadOnlyTokenCreator(org.neo4j.kernel.impl.core.ReadOnlyTokenCreator) TokenCreator(org.neo4j.kernel.impl.core.TokenCreator)

Example 2 with ReadOnlyTokenCreator

use of org.neo4j.kernel.impl.core.ReadOnlyTokenCreator in project neo4j by neo4j.

the class HighlyAvailableEditionModule method createLabelIdCreator.

private TokenCreator createLabelIdCreator(Config config, ComponentSwitcherContainer componentSwitcherContainer, DelegateInvocationHandler<Master> masterDelegateInvocationHandler, RequestContextFactory requestContextFactory, Supplier<KernelAPI> kernelProvider) {
    if (config.get(GraphDatabaseSettings.read_only)) {
        return new ReadOnlyTokenCreator();
    }
    DelegateInvocationHandler<TokenCreator> labelIdCreatorDelegate = new DelegateInvocationHandler<>(TokenCreator.class);
    TokenCreator labelIdCreator = (TokenCreator) newProxyInstance(TokenCreator.class.getClassLoader(), new Class[] { TokenCreator.class }, labelIdCreatorDelegate);
    LabelTokenCreatorSwitcher modeSwitcher = new LabelTokenCreatorSwitcher(labelIdCreatorDelegate, masterDelegateInvocationHandler, requestContextFactory, kernelProvider, idGeneratorFactory);
    componentSwitcherContainer.add(modeSwitcher);
    return labelIdCreator;
}
Also used : ReadOnlyTokenCreator(org.neo4j.kernel.impl.core.ReadOnlyTokenCreator) LabelTokenCreatorSwitcher(org.neo4j.kernel.ha.cluster.modeswitch.LabelTokenCreatorSwitcher) DelegateInvocationHandler(org.neo4j.kernel.ha.DelegateInvocationHandler) ReadOnlyTokenCreator(org.neo4j.kernel.impl.core.ReadOnlyTokenCreator) TokenCreator(org.neo4j.kernel.impl.core.TokenCreator)

Example 3 with ReadOnlyTokenCreator

use of org.neo4j.kernel.impl.core.ReadOnlyTokenCreator in project neo4j by neo4j.

the class HighlyAvailableEditionModule method createPropertyKeyCreator.

private TokenCreator createPropertyKeyCreator(Config config, ComponentSwitcherContainer componentSwitcherContainer, DelegateInvocationHandler<Master> masterDelegateInvocationHandler, RequestContextFactory requestContextFactory, Supplier<KernelAPI> kernelProvider) {
    if (config.get(GraphDatabaseSettings.read_only)) {
        return new ReadOnlyTokenCreator();
    }
    DelegateInvocationHandler<TokenCreator> propertyKeyCreatorDelegate = new DelegateInvocationHandler<>(TokenCreator.class);
    TokenCreator propertyTokenCreator = (TokenCreator) newProxyInstance(TokenCreator.class.getClassLoader(), new Class[] { TokenCreator.class }, propertyKeyCreatorDelegate);
    PropertyKeyCreatorSwitcher propertyKeyCreatorModeSwitcher = new PropertyKeyCreatorSwitcher(propertyKeyCreatorDelegate, masterDelegateInvocationHandler, requestContextFactory, kernelProvider, idGeneratorFactory);
    componentSwitcherContainer.add(propertyKeyCreatorModeSwitcher);
    return propertyTokenCreator;
}
Also used : PropertyKeyCreatorSwitcher(org.neo4j.kernel.ha.cluster.modeswitch.PropertyKeyCreatorSwitcher) ReadOnlyTokenCreator(org.neo4j.kernel.impl.core.ReadOnlyTokenCreator) DelegateInvocationHandler(org.neo4j.kernel.ha.DelegateInvocationHandler) ReadOnlyTokenCreator(org.neo4j.kernel.impl.core.ReadOnlyTokenCreator) TokenCreator(org.neo4j.kernel.impl.core.TokenCreator)

Aggregations

DelegateInvocationHandler (org.neo4j.kernel.ha.DelegateInvocationHandler)3 ReadOnlyTokenCreator (org.neo4j.kernel.impl.core.ReadOnlyTokenCreator)3 TokenCreator (org.neo4j.kernel.impl.core.TokenCreator)3 LabelTokenCreatorSwitcher (org.neo4j.kernel.ha.cluster.modeswitch.LabelTokenCreatorSwitcher)1 PropertyKeyCreatorSwitcher (org.neo4j.kernel.ha.cluster.modeswitch.PropertyKeyCreatorSwitcher)1 RelationshipTypeCreatorSwitcher (org.neo4j.kernel.ha.cluster.modeswitch.RelationshipTypeCreatorSwitcher)1