org.infinispan.configuration.cache
Class LoaderConfigurationBuilder

java.lang.Object
  extended by org.infinispan.configuration.cache.AbstractLoadersConfigurationChildBuilder<T>
      extended by org.infinispan.configuration.cache.AbstractLoaderConfigurationBuilder<LoaderConfiguration>
          extended by org.infinispan.configuration.cache.LoaderConfigurationBuilder
All Implemented Interfaces:
ConfigurationChildBuilder, LoaderConfigurationChildBuilder, LoadersConfigurationChildBuilder

public class LoaderConfigurationBuilder
extends AbstractLoaderConfigurationBuilder<LoaderConfiguration>
implements LoaderConfigurationChildBuilder

Configuration a specific cache loader or cache store

Author:
pmuir

Field Summary
 
Fields inherited from class org.infinispan.configuration.cache.AbstractLoaderConfigurationBuilder
async, singletonStore
 
Method Summary
 LoaderConfigurationBuilder addProperty(String key, String value)
           Defines a single property.
 Configuration build()
           
 LoaderConfigurationBuilder cacheLoader(CacheLoader cacheLoader)
          NOTE: Currently Infinispan will not use the object instance, but instead instantiate a new instance of the class.
 ClusteringConfigurationBuilder clustering()
           
 CustomInterceptorsConfigurationBuilder customInterceptors()
           
 DataContainerConfigurationBuilder dataContainer()
           
 DeadlockDetectionConfigurationBuilder deadlockDetection()
           
 EvictionConfigurationBuilder eviction()
           
 ExpirationConfigurationBuilder expiration()
           
 LoaderConfigurationBuilder fetchPersistentState(boolean b)
          If true, fetch persistent state when joining a cluster.
protected  ConfigurationBuilder getBuilder()
           
 LoaderConfigurationBuilder ignoreModifications(boolean b)
          If true, any operation that modifies the cache (put, remove, clear, store...etc) won't be applied to the cache store.
 IndexingConfigurationBuilder indexing()
           
 InvocationBatchingConfigurationBuilder invocationBatching()
           
 JMXStatisticsConfigurationBuilder jmxStatistics()
           
 LoadersConfigurationBuilder loaders()
           
 LockingConfigurationBuilder locking()
           
 LoaderConfigurationBuilder purgeOnStartup(boolean b)
          If true, purges this cache store when it starts up.
 LoaderConfigurationBuilder purgerThreads(int i)
          The number of threads to use when purging asynchronously.
 LoaderConfigurationBuilder purgeSynchronously(boolean b)
          If true, CacheStore#purgeExpired() call will be done synchronously
 LoaderConfigurationBuilder read(LoaderConfiguration template)
           
 StoreAsBinaryConfigurationBuilder storeAsBinary()
           
 String toString()
           
 TransactionConfigurationBuilder transaction()
           
 UnsafeConfigurationBuilder unsafe()
           
 VersioningConfigurationBuilder versioning()
           
 LoaderConfigurationBuilder withProperties(Properties props)
           These properties are passed directly to the cache loader.
 
Methods inherited from class org.infinispan.configuration.cache.AbstractLoaderConfigurationBuilder
async, singletonStore
 
Methods inherited from class org.infinispan.configuration.cache.AbstractLoadersConfigurationChildBuilder
getLoadersBuilder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.infinispan.configuration.cache.LoaderConfigurationChildBuilder
async, singletonStore
 
Methods inherited from interface org.infinispan.configuration.cache.ConfigurationChildBuilder
build, clustering, customInterceptors, dataContainer, deadlockDetection, eviction, expiration, indexing, invocationBatching, jmxStatistics, loaders, locking, storeAsBinary, transaction, unsafe, versioning
 
Methods inherited from interface org.infinispan.configuration.cache.LoadersConfigurationChildBuilder
loaders
 

Method Detail

cacheLoader

public LoaderConfigurationBuilder cacheLoader(CacheLoader cacheLoader)
NOTE: Currently Infinispan will not use the object instance, but instead instantiate a new instance of the class. Therefore, do not expect any state to survive, and provide a no-args constructor to any instance. This will be resolved in Infinispan 5.2.0

Parameters:
cacheLoader -
Returns:

fetchPersistentState

public LoaderConfigurationBuilder fetchPersistentState(boolean b)
If true, fetch persistent state when joining a cluster. If multiple cache stores are chained, only one of them can have this property enabled. Persistent state transfer with a shared cache store does not make sense, as the same persistent store that provides the data will just end up receiving it. Therefore, if a shared cache store is used, the cache will not allow a persistent state transfer even if a cache store has this property set to true. Finally, setting it to true only makes sense if in a clustered environment, and only 'replication' and 'invalidation' cluster modes are supported.


ignoreModifications

public LoaderConfigurationBuilder ignoreModifications(boolean b)
If true, any operation that modifies the cache (put, remove, clear, store...etc) won't be applied to the cache store. This means that the cache store could become out of sync with the cache.


purgeOnStartup

public LoaderConfigurationBuilder purgeOnStartup(boolean b)
If true, purges this cache store when it starts up.


purgerThreads

public LoaderConfigurationBuilder purgerThreads(int i)
The number of threads to use when purging asynchronously.


purgeSynchronously

public LoaderConfigurationBuilder purgeSynchronously(boolean b)
If true, CacheStore#purgeExpired() call will be done synchronously


addProperty

public LoaderConfigurationBuilder addProperty(String key,
                                              String value)

Defines a single property. Can be used multiple times to define all needed properties, but the full set is overridden by withProperties(Properties).

These properties are passed directly to the cache loader.


withProperties

public LoaderConfigurationBuilder withProperties(Properties props)

These properties are passed directly to the cache loader.

Specified by:
withProperties in class AbstractLoaderConfigurationBuilder<LoaderConfiguration>
Returns:

read

public LoaderConfigurationBuilder read(LoaderConfiguration template)

toString

public String toString()
Overrides:
toString in class Object

clustering

public ClusteringConfigurationBuilder clustering()
Specified by:
clustering in interface ConfigurationChildBuilder

customInterceptors

public CustomInterceptorsConfigurationBuilder customInterceptors()
Specified by:
customInterceptors in interface ConfigurationChildBuilder

dataContainer

public DataContainerConfigurationBuilder dataContainer()
Specified by:
dataContainer in interface ConfigurationChildBuilder

deadlockDetection

public DeadlockDetectionConfigurationBuilder deadlockDetection()
Specified by:
deadlockDetection in interface ConfigurationChildBuilder

eviction

public EvictionConfigurationBuilder eviction()
Specified by:
eviction in interface ConfigurationChildBuilder

expiration

public ExpirationConfigurationBuilder expiration()
Specified by:
expiration in interface ConfigurationChildBuilder

indexing

public IndexingConfigurationBuilder indexing()
Specified by:
indexing in interface ConfigurationChildBuilder

invocationBatching

public InvocationBatchingConfigurationBuilder invocationBatching()
Specified by:
invocationBatching in interface ConfigurationChildBuilder

jmxStatistics

public JMXStatisticsConfigurationBuilder jmxStatistics()
Specified by:
jmxStatistics in interface ConfigurationChildBuilder

loaders

public LoadersConfigurationBuilder loaders()
Specified by:
loaders in interface ConfigurationChildBuilder

locking

public LockingConfigurationBuilder locking()
Specified by:
locking in interface ConfigurationChildBuilder

storeAsBinary

public StoreAsBinaryConfigurationBuilder storeAsBinary()
Specified by:
storeAsBinary in interface ConfigurationChildBuilder

transaction

public TransactionConfigurationBuilder transaction()
Specified by:
transaction in interface ConfigurationChildBuilder

versioning

public VersioningConfigurationBuilder versioning()
Specified by:
versioning in interface ConfigurationChildBuilder

unsafe

public UnsafeConfigurationBuilder unsafe()
Specified by:
unsafe in interface ConfigurationChildBuilder

getBuilder

protected ConfigurationBuilder getBuilder()

build

public Configuration build()
Specified by:
build in interface ConfigurationChildBuilder

-->

Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.