Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISPN-1566 Remove duplicate async/singletonStore definitions #755

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,3 +1,22 @@
/*
* Copyright 2011 Red Hat, Inc. and/or its affiliates.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*/

package org.infinispan.configuration.cache;

import org.infinispan.configuration.AbstractTypedPropertiesConfiguration;
Expand Down
@@ -1,13 +1,32 @@
/*
* Copyright 2011 Red Hat, Inc. and/or its affiliates.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*/

package org.infinispan.configuration.cache;

import java.util.Properties;

/*
* This is slightly different AbstractLoaderConfigurationChildBuilder, as it instantiates a new set of children (async and singletonStore)
* rather than delegate to existing ones.
*
*/
public abstract class AbstractLoaderConfigurationBuilder<T extends AbstractLoaderConfiguration> extends AbstractLoadersConfigurationChildBuilder<T> {
public abstract class AbstractLoaderConfigurationBuilder<T extends AbstractLoaderConfiguration>
extends AbstractLoadersConfigurationChildBuilder<T> {

protected final AsyncLoaderConfigurationBuilder async;
protected final SingletonStoreConfigurationBuilder singletonStore;
Expand Down
Expand Up @@ -25,10 +25,10 @@
import org.infinispan.util.TypedProperties;

/**
* // TODO: Document this
* File cache store configuration builder
*
* @author Galder Zamarreño
* @since // TODO
* @since 5.1
*/
public class FileCacheStoreConfigurationBuilder extends AbstractLoaderConfigurationBuilder<FileCacheStoreConfiguration> {

Expand All @@ -42,14 +42,10 @@ public class FileCacheStoreConfigurationBuilder extends AbstractLoaderConfigurat
private boolean purgeSynchronously = false;
private int lockConcurrencyLevel;
private long lockAcquistionTimeout;
private final AsyncLoaderConfigurationBuilder async;
private final SingletonStoreConfigurationBuilder singletonStore;
private Properties properties = new Properties();

protected FileCacheStoreConfigurationBuilder(LoadersConfigurationBuilder builder) {
super(builder);
this.async = new AsyncLoaderConfigurationBuilder(this);
this.singletonStore = new SingletonStoreConfigurationBuilder(this);
}

public FileCacheStoreConfigurationBuilder location(String location) {
Expand Down Expand Up @@ -121,7 +117,11 @@ public static enum FsyncMode {

@Override
FileCacheStoreConfiguration create() {
return new FileCacheStoreConfiguration(location, fsyncInterval, fsyncMode, streamBufferSize, lockAcquistionTimeout, lockConcurrencyLevel, purgeOnStartup, purgeSynchronously, fetchPersistentState, ignoreModifications, TypedProperties.toTypedProperties(properties), async.create(), singletonStore.create());
return new FileCacheStoreConfiguration(location, fsyncInterval, fsyncMode,
streamBufferSize, lockAcquistionTimeout, lockConcurrencyLevel,
purgeOnStartup, purgeSynchronously, fetchPersistentState,
ignoreModifications, TypedProperties.toTypedProperties(properties),
async.create(), singletonStore.create());
}

@Override
Expand Down