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 a
CoherenceBasedCompleteConfiguration
.- Since:
- Coherence 12.1.3
- Author:
- bo 2013.11.12
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionThe type of keys forCache
s.The type of values forCache
s.TheFactory
for theCacheLoader
.protected javax.cache.configuration.Factory
<javax.cache.integration.CacheWriter<? super K, ? super V>> TheFactory
for theCacheWriter
.protected javax.cache.configuration.Factory
<javax.cache.expiry.ExpiryPolicy> TheFactory
for theExpiryPolicy
.protected boolean
Is JMX management enabled?protected boolean
Is "read-through" enabled?protected boolean
Are statistics enabled?protected boolean
Is store-by-reference enabled?protected boolean
Is "write-through" enabled?TheCacheEntryListenerConfiguration
s. -
Constructor Summary
ConstructorDescriptionConstructs anAbstractCoherenceBasedCompleteConfiguration
.AbstractCoherenceBasedCompleteConfiguration
(javax.cache.configuration.CompleteConfiguration<K, V> cfgComplete) Constructs anAbstractCoherenceBasedCompleteConfiguration
based on anotherCompleteConfiguration
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCacheEntryListenerConfiguration
(javax.cache.configuration.CacheEntryListenerConfiguration<K, V> cfgListener) Add a configuration for aCacheEntryListener
.boolean
javax.cache.configuration.Factory
<javax.cache.expiry.ExpiryPolicy> int
hashCode()
boolean
boolean
boolean
boolean
boolean
void
Restore the contents of a user type instance by reading its state using the specified PofReader object.void
Restore the contents of this object by loading the object's state from the passed DataInput object.void
setCacheLoaderFactory
(javax.cache.configuration.Factory<? extends javax.cache.integration.CacheLoader<K, V>> factory) Set theCacheLoader
factory.void
setCacheWriterFactory
(javax.cache.configuration.Factory<? extends javax.cache.integration.CacheWriter<? super K, ? super V>> factory) Set theCacheWriter
factory.void
setExpiryPolicyFactory
(javax.cache.configuration.Factory<? extends javax.cache.expiry.ExpiryPolicy> factory) Set theFactory
for theExpiryPolicy
.void
setManagementEnabled
(boolean fManagementEnabled) Set if JMX management is enabled for a configuration.void
setReadThrough
(boolean fReadThrough) Set if read-through caching should be used.void
setStatisticsEnabled
(boolean fStatisticsEnabled) Set if statistics gathering is enabled for a configuration.void
setStoreByValue
(boolean fStoreByValue) Set if a configured cache should use store-by-value or store-by-reference semantics.void
Sets the expected type of keys and values for aCoherenceBasedCache
.void
setWriteThrough
(boolean fWriteThrough) Set if write-through caching should be used.toString()
void
writeExternal
(PofWriter out) Save the contents of a POF user type instance by writing its state using the specified PofWriter object.void
writeExternal
(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 Details
-
m_clzKey
The type of keys forCache
s. -
m_clzValue
The type of values forCache
s. -
m_listListenerConfigurations
protected List<javax.cache.configuration.CacheEntryListenerConfiguration<K,V>> m_listListenerConfigurationsTheCacheEntryListenerConfiguration
s. -
m_factoryCacheLoader
protected javax.cache.configuration.Factory<javax.cache.integration.CacheLoader<K,V>> m_factoryCacheLoaderTheFactory
for theCacheLoader
. -
m_factoryCacheWriter
protected javax.cache.configuration.Factory<javax.cache.integration.CacheWriter<? super K,? super V>> m_factoryCacheWriterTheFactory
for theCacheWriter
. -
m_factoryExpiryPolicy
protected javax.cache.configuration.Factory<javax.cache.expiry.ExpiryPolicy> m_factoryExpiryPolicyTheFactory
for theExpiryPolicy
. -
m_fReadThrough
protected boolean m_fReadThroughIs "read-through" enabled? -
m_fWriteThrough
protected boolean m_fWriteThroughIs "write-through" enabled? -
m_fStatisticsEnabled
protected boolean m_fStatisticsEnabledAre statistics enabled? -
m_fStoreByValue
protected boolean m_fStoreByValueIs store-by-reference enabled? -
m_fManagementEnabled
protected boolean m_fManagementEnabledIs JMX management enabled?
-
-
Constructor Details
-
AbstractCoherenceBasedCompleteConfiguration
public AbstractCoherenceBasedCompleteConfiguration()Constructs anAbstractCoherenceBasedCompleteConfiguration
. -
AbstractCoherenceBasedCompleteConfiguration
public AbstractCoherenceBasedCompleteConfiguration(javax.cache.configuration.CompleteConfiguration<K, V> cfgComplete) Constructs anAbstractCoherenceBasedCompleteConfiguration
based on anotherCompleteConfiguration
.- Parameters:
cfgComplete
- theCompleteConfiguration
-
-
Method Details
-
getKeyType
-
getValueType
-
isStoreByValue
public boolean isStoreByValue() -
getCacheEntryListenerConfigurations
-
getCacheLoaderFactory
-
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
Description copied from interface:CoherenceBasedCompleteConfiguration
Sets the expected type of keys and values for aCoherenceBasedCache
.Setting both to
Object.class
means type-safety checks are not required.- Specified by:
setTypes
in 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:CoherenceBasedCompleteConfiguration
Add a configuration for aCacheEntryListener
.- Specified by:
addCacheEntryListenerConfiguration
in 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:CoherenceBasedCompleteConfiguration
Set theCacheLoader
factory.- Specified by:
setCacheLoaderFactory
in interfaceCoherenceBasedCompleteConfiguration<K,
V> - Parameters:
factory
- theCacheLoader
Factory
-
setCacheWriterFactory
public void setCacheWriterFactory(javax.cache.configuration.Factory<? extends javax.cache.integration.CacheWriter<? super K, ? super V>> factory) Description copied from interface:CoherenceBasedCompleteConfiguration
Set theCacheWriter
factory.- Specified by:
setCacheWriterFactory
in interfaceCoherenceBasedCompleteConfiguration<K,
V> - Parameters:
factory
- theCacheWriter
Factory
-
setExpiryPolicyFactory
public void setExpiryPolicyFactory(javax.cache.configuration.Factory<? extends javax.cache.expiry.ExpiryPolicy> factory) Description copied from interface:CoherenceBasedCompleteConfiguration
Set theFactory
for theExpiryPolicy
.If
null
is specified the defaultExpiryPolicy
is used.- Specified by:
setExpiryPolicyFactory
in interfaceCoherenceBasedCompleteConfiguration<K,
V> - Parameters:
factory
- theExpiryPolicy
Factory
-
setReadThrough
public void setReadThrough(boolean fReadThrough) Description copied from interface:CoherenceBasedCompleteConfiguration
Set if read-through caching should be used.It is an invalid configuration to set this to true without specifying a
CacheLoader
Factory
.- Specified by:
setReadThrough
in interfaceCoherenceBasedCompleteConfiguration<K,
V> - Parameters:
fReadThrough
-true
if read-through is required
-
setWriteThrough
public void setWriteThrough(boolean fWriteThrough) Description copied from interface:CoherenceBasedCompleteConfiguration
Set if write-through caching should be used.It is an invalid configuration to set this to true without specifying a
CacheWriter
Factory
.- Specified by:
setWriteThrough
in interfaceCoherenceBasedCompleteConfiguration<K,
V> - Parameters:
fWriteThrough
-true
if write-through is required
-
setStoreByValue
public void setStoreByValue(boolean fStoreByValue) Description copied from interface:CoherenceBasedCompleteConfiguration
Set if a configured cache should use store-by-value or store-by-reference semantics.- Specified by:
setStoreByValue
in interfaceCoherenceBasedCompleteConfiguration<K,
V> - Parameters:
fStoreByValue
-true
for store-by-value semantics,false
for store-by-reference semantics
-
setStatisticsEnabled
public void setStatisticsEnabled(boolean fStatisticsEnabled) Description copied from interface:CoherenceBasedCompleteConfiguration
Set if statistics gathering is enabled for a configuration.Statistics may be enabled or disabled at runtime via
CacheManager.enableStatistics(String, boolean)
.- Specified by:
setStatisticsEnabled
in interfaceCoherenceBasedCompleteConfiguration<K,
V> - Parameters:
fStatisticsEnabled
-true
to enable statistics gathering,false
to disable
-
setManagementEnabled
public void setManagementEnabled(boolean fManagementEnabled) Description copied from interface:CoherenceBasedCompleteConfiguration
Set if JMX management is enabled for a configuration.Management may be enabled or disabled at runtime via
CacheManager.enableManagement(String, boolean)
.- Specified by:
setManagementEnabled
in interfaceCoherenceBasedCompleteConfiguration<K,
V> - Parameters:
fManagementEnabled
-true
to enable statistics,false
to disable
-
hashCode
public int hashCode() -
equals
-
toString
-
readExternal
Description copied from interface:ExternalizableLite
Restore the contents of this object by loading the object's state from the passed DataInput object.- Specified by:
readExternal
in 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 occurs
-
writeExternal
Description copied from interface:ExternalizableLite
Save the contents of this object by storing the object's state into the passed DataOutput object.- Specified by:
writeExternal
in interfaceExternalizableLite
- Parameters:
out
- the DataOutput stream to write the state of this object to- Throws:
IOException
- if an I/O exception occurs
-
readExternal
Description copied from interface:PortableObject
Restore the contents of a user type instance by reading its state using the specified PofReader object.- Specified by:
readExternal
in interfacePortableObject
- Parameters:
in
- the PofReader from which to read the object's state- Throws:
IOException
- if an I/O error occurs
-
writeExternal
Description copied from interface:PortableObject
Save the contents of a POF user type instance by writing its state using the specified PofWriter object.- Specified by:
writeExternal
in interfacePortableObject
- Parameters:
out
- the PofWriter to which to write the object's state- Throws:
IOException
- if an I/O error occurs
-