Class DistributableCache<K,​V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>

  • Type Parameters:
    K - the cache key type
    V - the cache value type
    All Implemented Interfaces:
    Cache<K,​V>, org.wildfly.clustering.ee.Restartable, AffinitySupport<K>

    public class DistributableCache<K,​V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>
    extends Object
    implements Cache<K,​V>
    Distributable Cache implementation. This object is responsible for:
    • Group association based on creation context
    • Batching of bean manager operations
    Author:
    Paul Ferraro
    • Constructor Detail

      • DistributableCache

        public DistributableCache​(BeanManager<K,​V,​org.wildfly.clustering.ee.Batch> manager,
                                  StatefulObjectFactory<V> factory,
                                  javax.transaction.TransactionSynchronizationRegistry tsr)
    • Method Detail

      • create

        public V create()
        Description copied from interface: Cache
        Creates and caches a new instance of T.
        Specified by:
        create in interface Cache<K,​V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>
        Returns:
        a new T
      • get

        public V get​(K id)
        Description copied from interface: Cache
        Get the specified object from cache. This will mark the object as being in use, and increase its usage count.
        Specified by:
        get in interface Cache<K,​V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>
        Parameters:
        id - the identifier of the object
        Returns:
        the object, or null if it does not exist
      • release

        public void release​(V value)
        Description copied from interface: Cache
        Decreases the objects usage count. If the usage count hits 0 then the object will be released.
        Specified by:
        release in interface Cache<K,​V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>
        Parameters:
        value - the object
      • remove

        public void remove​(K id)
        Description copied from interface: Cache
        Remove and destroy the specified object from cache.
        Specified by:
        remove in interface Cache<K,​V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>
        Parameters:
        id - the identifier of the object
      • discard

        public void discard​(V value)
        Description copied from interface: Cache
        Discard the specified object from cache.
        Specified by:
        discard in interface Cache<K,​V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>
        Parameters:
        value - the object to discard
      • contains

        public boolean contains​(K id)
        Description copied from interface: Cache
        Indicates whether or not the specified key is contained within this cache.
        Specified by:
        contains in interface Cache<K,​V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>
        Parameters:
        id - the cache key
        Returns:
        true if the key is present in the cache, false otherwise.
      • start

        public void start()
        Specified by:
        start in interface org.wildfly.clustering.ee.Restartable
      • stop

        public void stop()
        Specified by:
        stop in interface org.wildfly.clustering.ee.Restartable
      • isRemotable

        public boolean isRemotable​(Throwable throwable)
        Description copied from interface: Cache
        Checks whether the supplied Throwable is remotable meaning it can be safely sent to the client over the wire.
        Specified by:
        isRemotable in interface Cache<K,​V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>