Class DefaultBeanGroup<K,V extends BeanInstance<K>>

java.lang.Object
org.wildfly.clustering.ejb.cache.bean.DefaultImmutableBeanGroup<K,V>
org.wildfly.clustering.ejb.cache.bean.DefaultBeanGroup<K,V>
Type Parameters:
K - the bean identifier type
V - the bean instance type
All Implemented Interfaces:
AutoCloseable, org.wildfly.clustering.cache.CacheEntryMutator, BeanGroup<K,V>, ImmutableBeanGroup<K,V>, MutableBeanGroup<K,V>

public class DefaultBeanGroup<K,V extends BeanInstance<K>> extends DefaultImmutableBeanGroup<K,V> implements MutableBeanGroup<K,V>
A default BeanGroup implementation based on a map of bean instances.
Author:
Paul Ferraro
  • Constructor Details

    • DefaultBeanGroup

      public DefaultBeanGroup(K id, Map<K,V> instances, Consumer<Map<K,V>> prePassivateTask, org.wildfly.clustering.cache.CacheEntryMutator mutator, Runnable closeTask)
  • Method Details

    • addBeanInstance

      public void addBeanInstance(V instance)
      Description copied from interface: BeanGroup
      Adds the specified bean instance to this group.
      Specified by:
      addBeanInstance in interface BeanGroup<K,V extends BeanInstance<K>>
      Parameters:
      instance - a bean instance
    • removeBeanInstance

      public V removeBeanInstance(K id)
      Description copied from interface: BeanGroup
      Removes the bean instance with the specified identifier from this group.
      Specified by:
      removeBeanInstance in interface BeanGroup<K,V extends BeanInstance<K>>
      Parameters:
      id - a bean instance identifier
      Returns:
      the removed bean instance, or null, if no such bean instance existed
    • mutateAsync

      public CompletionStage<Void> mutateAsync()
      Specified by:
      mutateAsync in interface org.wildfly.clustering.cache.CacheEntryMutator