Package org.locationtech.geogig.di

Examples of org.locationtech.geogig.di.Decorator


        // bind separate caches for the object and staging databases

        bind(ObjectDatabaseCacheFactory.class).in(Scopes.SINGLETON);
        bind(StagingDatabaseCacheFactory.class).in(Scopes.SINGLETON);

        Decorator objectCachingDecorator = ObjectDatabaseCacheInterceptor
                .objects(getProvider(ObjectDatabaseCacheFactory.class));

        Decorator indexCachingDecorator = ObjectDatabaseCacheInterceptor
                .staging(getProvider(StagingDatabaseCacheFactory.class));

        GeogigModule.bindDecorator(binder(), objectCachingDecorator);
        GeogigModule.bindDecorator(binder(), indexCachingDecorator);
    }
View Full Code Here


        // force use of factory methods
    }

    public static Decorator staging(final Provider<? extends CacheFactory> cacheProvider) {

        return new Decorator() {
            @Override
            public boolean canDecorate(Object subject) {
                return subject instanceof StagingDatabase;
            }
View Full Code Here

        };
    }

    public static Decorator objects(final Provider<? extends CacheFactory> cacheProvider) {

        return new Decorator() {
            @Override
            public boolean canDecorate(Object subject) {
                return subject instanceof ObjectDatabase && (!(subject instanceof StagingDatabase));
            }
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.di.Decorator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.