forked from infinispan/infinispan
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISPN-4104 Generic store cache child creation fails
* Added ConfiguredBy annotation ** This allows a Cachestore to tell what Configuration to use * Updated existing cache stores and loaders to define this * Added parsing support for embedded and server configuration * Added tests to verify generic loader definitions * Refactored base configuration builder to reduce code copy for read
- Loading branch information
1 parent
ab43486
commit bbee749
Showing
37 changed files
with
256 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
commons/src/main/java/org/infinispan/commons/configuration/ConfiguredBy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.infinispan.commons.configuration; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Defines the configuration used to configure the given class instances | ||
* | ||
* @author wburns | ||
* @since 7.0 | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.TYPE) | ||
public @interface ConfiguredBy { | ||
Class<?> value(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
core/src/main/java/org/infinispan/configuration/cache/BaseStoreConfigurationBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.infinispan.configuration.cache; | ||
|
||
import org.infinispan.commons.configuration.Builder; | ||
|
||
/** | ||
* StoreConfigurationBuilder used for stores/loaders that don't have a configuration builder | ||
* | ||
* @author wburns | ||
* @since 7.0 | ||
*/ | ||
public class BaseStoreConfigurationBuilder extends AbstractStoreConfigurationBuilder<AbstractStoreConfiguration, BaseStoreConfigurationBuilder> { | ||
public BaseStoreConfigurationBuilder(PersistenceConfigurationBuilder builder) { | ||
super(builder); | ||
} | ||
|
||
@Override | ||
public AbstractStoreConfiguration create() { | ||
return new AbstractStoreConfiguration(purgeOnStartup, fetchPersistentState, ignoreModifications, async.create(), | ||
singletonStore.create(), preload, shared, properties); | ||
} | ||
|
||
@Override | ||
public BaseStoreConfigurationBuilder self() { | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
import org.infinispan.AdvancedCache; | ||
import org.infinispan.commands.remote.ClusteredGetCommand; | ||
import org.infinispan.commons.configuration.ConfiguredBy; | ||
import org.infinispan.commons.util.InfinispanCollections; | ||
import org.infinispan.configuration.cache.ClusterLoaderConfiguration; | ||
import org.infinispan.container.entries.InternalCacheValue; | ||
|
@@ -34,6 +35,7 @@ | |
* | ||
* @author [email protected] | ||
*/ | ||
@ConfiguredBy(ClusterLoaderConfiguration.class) | ||
public class ClusterLoader implements CacheLoader, LocalOnlyCacheLoader { | ||
private static final Log log = LogFactory.getLog(ClusterLoader.class); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.