Package com.tangosol.coherence.jcache
Class AbstractCoherenceBasedCompleteConfiguration<K,V>
- java.lang.Object
-
- com.tangosol.coherence.jcache.AbstractCoherenceBasedCompleteConfiguration<K,V>
-
- Type Parameters:
K- the type of the keysV- the type of the values
- All Implemented Interfaces:
CoherenceBasedCompleteConfiguration<K,V>,CoherenceBasedConfiguration<K,V>,ExternalizableLite,PortableObject,Serializable,javax.cache.configuration.CompleteConfiguration<K,V>,javax.cache.configuration.Configuration<K,V>
- Direct Known Subclasses:
LocalCacheConfiguration,PartitionedCacheConfiguration,RemoteCacheConfiguration
public abstract class AbstractCoherenceBasedCompleteConfiguration<K,V> extends Object implements CoherenceBasedCompleteConfiguration<K,V>, ExternalizableLite, PortableObject
A base implementation of aCoherenceBasedCompleteConfiguration.- Since:
- Coherence 12.1.3
- Author:
- bo 2013.11.12
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Class<K>m_clzKeyThe type of keys forCaches.protected Class<V>m_clzValueThe type of values forCaches.protected javax.cache.configuration.Factory<javax.cache.integration.CacheLoader<K,V>>m_factoryCacheLoaderTheFactoryfor theCacheLoader.protected javax.cache.configuration.Factory<javax.cache.integration.CacheWriter<? super K,? super V>>m_factoryCacheWriterTheFactoryfor theCacheWriter.protected javax.cache.configuration.Factory<javax.cache.expiry.ExpiryPolicy>m_factoryExpiryPolicyTheFactoryfor theExpiryPolicy.protected booleanm_fManagementEnabledIs JMX management enabled?protected booleanm_fReadThroughIs "read-through" enabled?protected booleanm_fStatisticsEnabledAre statistics enabled?protected booleanm_fStoreByValueIs store-by-reference enabled?protected booleanm_fWriteThroughIs "write-through" enabled?protected List<javax.cache.configuration.CacheEntryListenerConfiguration<K,V>>m_listListenerConfigurationsTheCacheEntryListenerConfigurations.
-
Constructor Summary
Constructors Constructor Description AbstractCoherenceBasedCompleteConfiguration()Constructs anAbstractCoherenceBasedCompleteConfiguration.AbstractCoherenceBasedCompleteConfiguration(javax.cache.configuration.CompleteConfiguration<K,V> cfgComplete)Constructs anAbstractCoherenceBasedCompleteConfigurationbased on anotherCompleteConfiguration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cfgListener)Add a configuration for aCacheEntryListener.booleanequals(Object object)List<javax.cache.configuration.CacheEntryListenerConfiguration<K,V>>getCacheEntryListenerConfigurations()javax.cache.configuration.Factory<javax.cache.integration.CacheLoader<K,V>>getCacheLoaderFactory()javax.cache.configuration.Factory<javax.cache.integration.CacheWriter<? super K,? super V>>getCacheWriterFactory()javax.cache.configuration.Factory<javax.cache.expiry.ExpiryPolicy>getExpiryPolicyFactory()Class<K>getKeyType()Class<V>getValueType()inthashCode()booleanisManagementEnabled()booleanisReadThrough()booleanisStatisticsEnabled()booleanisStoreByValue()booleanisWriteThrough()voidreadExternal(PofReader in)Restore the contents of a user type instance by reading its state using the specified PofReader object.voidreadExternal(DataInput in)Restore the contents of this object by loading the object's state from the passed DataInput object.voidsetCacheLoaderFactory(javax.cache.configuration.Factory<? extends javax.cache.integration.CacheLoader<K,V>> factory)Set theCacheLoaderfactory.voidsetCacheWriterFactory(javax.cache.configuration.Factory<? extends javax.cache.integration.CacheWriter<? super K,? super V>> factory)Set theCacheWriterfactory.voidsetExpiryPolicyFactory(javax.cache.configuration.Factory<? extends javax.cache.expiry.ExpiryPolicy> factory)Set theFactoryfor theExpiryPolicy.voidsetManagementEnabled(boolean fManagementEnabled)Set if JMX management is enabled for a configuration.voidsetReadThrough(boolean fReadThrough)Set if read-through caching should be used.voidsetStatisticsEnabled(boolean fStatisticsEnabled)Set if statistics gathering is enabled for a configuration.voidsetStoreByValue(boolean fStoreByValue)Set if a configured cache should use store-by-value or store-by-reference semantics.voidsetTypes(Class<K> clzKey, Class<V> clzValue)Sets the expected type of keys and values for aCoherenceBasedCache.voidsetWriteThrough(boolean fWriteThrough)Set if write-through caching should be used.StringtoString()voidwriteExternal(PofWriter out)Save the contents of a POF user type instance by writing its state using the specified PofWriter object.voidwriteExternal(DataOutput out)Save the contents of this object by storing the object's state into the passed DataOutput object.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.tangosol.coherence.jcache.CoherenceBasedConfiguration
createCache, destroyCache
-
-
-
-
Field Detail
-
m_listListenerConfigurations
protected List<javax.cache.configuration.CacheEntryListenerConfiguration<K,V>> m_listListenerConfigurations
TheCacheEntryListenerConfigurations.
-
m_factoryCacheLoader
protected javax.cache.configuration.Factory<javax.cache.integration.CacheLoader<K,V>> m_factoryCacheLoader
TheFactoryfor theCacheLoader.
-
m_factoryCacheWriter
protected javax.cache.configuration.Factory<javax.cache.integration.CacheWriter<? super K,? super V>> m_factoryCacheWriter
TheFactoryfor theCacheWriter.
-
m_factoryExpiryPolicy
protected javax.cache.configuration.Factory<javax.cache.expiry.ExpiryPolicy> m_factoryExpiryPolicy
TheFactoryfor theExpiryPolicy.
-
m_fReadThrough
protected boolean m_fReadThrough
Is "read-through" enabled?
-
m_fWriteThrough
protected boolean m_fWriteThrough
Is "write-through" enabled?
-
m_fStatisticsEnabled
protected boolean m_fStatisticsEnabled
Are statistics enabled?
-
m_fStoreByValue
protected boolean m_fStoreByValue
Is store-by-reference enabled?
-
m_fManagementEnabled
protected boolean m_fManagementEnabled
Is JMX management enabled?
-
-
Constructor Detail
-
AbstractCoherenceBasedCompleteConfiguration
public AbstractCoherenceBasedCompleteConfiguration()
Constructs anAbstractCoherenceBasedCompleteConfiguration.
-
AbstractCoherenceBasedCompleteConfiguration
public AbstractCoherenceBasedCompleteConfiguration(javax.cache.configuration.CompleteConfiguration<K,V> cfgComplete)
Constructs anAbstractCoherenceBasedCompleteConfigurationbased on anotherCompleteConfiguration.- Parameters:
cfgComplete- theCompleteConfiguration
-
-
Method Detail
-
isStoreByValue
public boolean isStoreByValue()
-
getCacheEntryListenerConfigurations
public List<javax.cache.configuration.CacheEntryListenerConfiguration<K,V>> getCacheEntryListenerConfigurations()
-
getCacheLoaderFactory
public javax.cache.configuration.Factory<javax.cache.integration.CacheLoader<K,V>> getCacheLoaderFactory()
-
getCacheWriterFactory
public javax.cache.configuration.Factory<javax.cache.integration.CacheWriter<? super K,? super V>> getCacheWriterFactory()
-
getExpiryPolicyFactory
public javax.cache.configuration.Factory<javax.cache.expiry.ExpiryPolicy> getExpiryPolicyFactory()
-
isReadThrough
public boolean isReadThrough()
-
isWriteThrough
public boolean isWriteThrough()
-
isStatisticsEnabled
public boolean isStatisticsEnabled()
-
isManagementEnabled
public boolean isManagementEnabled()
-
setTypes
public void setTypes(Class<K> clzKey, Class<V> clzValue)
Description copied from interface:CoherenceBasedCompleteConfigurationSets the expected type of keys and values for aCoherenceBasedCache.Setting both to
Object.classmeans type-safety checks are not required.- Specified by:
setTypesin interfaceCoherenceBasedCompleteConfiguration<K,V>- Parameters:
clzKey- the expected key typeclzValue- the expected value type
-
addCacheEntryListenerConfiguration
public void addCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cfgListener)
Description copied from interface:CoherenceBasedCompleteConfigurationAdd a configuration for aCacheEntryListener.- Specified by:
addCacheEntryListenerConfigurationin interfaceCoherenceBasedCompleteConfiguration<K,V>- Parameters:
cfgListener- theCacheEntryListenerConfiguration
-
setCacheLoaderFactory
public void setCacheLoaderFactory(javax.cache.configuration.Factory<? extends javax.cache.integration.CacheLoader<K,V>> factory)
Description copied from interface:CoherenceBasedCompleteConfigurationSet theCacheLoaderfactory.- Specified by:
setCacheLoaderFactoryin interfaceCoherenceBasedCompleteConfiguration<K,V>- Parameters:
factory- theCacheLoaderFactory
-
setCacheWriterFactory
public void setCacheWriterFactory(javax.cache.configuration.Factory<? extends javax.cache.integration.CacheWriter<? super K,? super V>> factory)
Description copied from interface:CoherenceBasedCompleteConfigurationSet theCacheWriterfactory.- Specified by:
setCacheWriterFactoryin interfaceCoherenceBasedCompleteConfiguration<K,V>- Parameters:
factory- theCacheWriterFactory
-
setExpiryPolicyFactory
public void setExpiryPolicyFactory(javax.cache.configuration.Factory<? extends javax.cache.expiry.ExpiryPolicy> factory)
Description copied from interface:CoherenceBasedCompleteConfigurationSet theFactoryfor theExpiryPolicy.If
nullis specified the defaultExpiryPolicyis used.- Specified by:
setExpiryPolicyFactoryin interfaceCoherenceBasedCompleteConfiguration<K,V>- Parameters:
factory- theExpiryPolicyFactory
-
setReadThrough
public void setReadThrough(boolean fReadThrough)
Description copied from interface:CoherenceBasedCompleteConfigurationSet if read-through caching should be used.It is an invalid configuration to set this to true without specifying a
CacheLoaderFactory.- Specified by:
setReadThroughin interfaceCoherenceBasedCompleteConfiguration<K,V>- Parameters:
fReadThrough-trueif read-through is required
-
setWriteThrough
public void setWriteThrough(boolean fWriteThrough)
Description copied from interface:CoherenceBasedCompleteConfigurationSet if write-through caching should be used.It is an invalid configuration to set this to true without specifying a
CacheWriterFactory.- Specified by:
setWriteThroughin interfaceCoherenceBasedCompleteConfiguration<K,V>- Parameters:
fWriteThrough-trueif write-through is required
-
setStoreByValue
public void setStoreByValue(boolean fStoreByValue)
Description copied from interface:CoherenceBasedCompleteConfigurationSet if a configured cache should use store-by-value or store-by-reference semantics.- Specified by:
setStoreByValuein interfaceCoherenceBasedCompleteConfiguration<K,V>- Parameters:
fStoreByValue-truefor store-by-value semantics,falsefor store-by-reference semantics
-
setStatisticsEnabled
public void setStatisticsEnabled(boolean fStatisticsEnabled)
Description copied from interface:CoherenceBasedCompleteConfigurationSet if statistics gathering is enabled for a configuration.Statistics may be enabled or disabled at runtime via
CacheManager.enableStatistics(String, boolean).- Specified by:
setStatisticsEnabledin interfaceCoherenceBasedCompleteConfiguration<K,V>- Parameters:
fStatisticsEnabled-trueto enable statistics gathering,falseto disable
-
setManagementEnabled
public void setManagementEnabled(boolean fManagementEnabled)
Description copied from interface:CoherenceBasedCompleteConfigurationSet if JMX management is enabled for a configuration.Management may be enabled or disabled at runtime via
CacheManager.enableManagement(String, boolean).- Specified by:
setManagementEnabledin interfaceCoherenceBasedCompleteConfiguration<K,V>- Parameters:
fManagementEnabled-trueto enable statistics,falseto disable
-
readExternal
public void readExternal(DataInput in) throws IOException
Description copied from interface:ExternalizableLiteRestore the contents of this object by loading the object's state from the passed DataInput object.- Specified by:
readExternalin interfaceExternalizableLite- Parameters:
in- the DataInput stream to read data from in order to restore the state of this object- Throws:
IOException- if an I/O exception occursNotActiveException- if the object is not in its initial state, and therefore cannot be deserialized into
-
writeExternal
public void writeExternal(DataOutput out) throws IOException
Description copied from interface:ExternalizableLiteSave the contents of this object by storing the object's state into the passed DataOutput object.- Specified by:
writeExternalin interfaceExternalizableLite- Parameters:
out- the DataOutput stream to write the state of this object to- Throws:
IOException- if an I/O exception occurs
-
readExternal
public void readExternal(PofReader in) throws IOException
Description copied from interface:PortableObjectRestore the contents of a user type instance by reading its state using the specified PofReader object.- Specified by:
readExternalin interfacePortableObject- Parameters:
in- the PofReader from which to read the object's state- Throws:
IOException- if an I/O error occurs
-
writeExternal
public void writeExternal(PofWriter out) throws IOException
Description copied from interface:PortableObjectSave the contents of a POF user type instance by writing its state using the specified PofWriter object.- Specified by:
writeExternalin interfacePortableObject- Parameters:
out- the PofWriter to which to write the object's state- Throws:
IOException- if an I/O error occurs
-
-