Class SimpleStatefulSessionBean<K,V extends StatefulSessionBeanInstance<K>>
- java.lang.Object
-
- org.jboss.as.ejb3.component.stateful.cache.simple.SimpleStatefulSessionBean<K,V>
-
- Type Parameters:
K- the bean identifier typeV- the bean instance type
- All Implemented Interfaces:
AutoCloseable,StatefulSessionBean<K,V>
public class SimpleStatefulSessionBean<K,V extends StatefulSessionBeanInstance<K>> extends Object implements StatefulSessionBean<K,V>
A simple stateful session bean cache.- Author:
- Paul Ferraro
-
-
Constructor Summary
Constructors Constructor Description SimpleStatefulSessionBean(V instance, Consumer<K> remover, Consumer<StatefulSessionBean<K,V>> closeTask)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes any resources associated with this bean.voiddiscard()Removes this bean from the cache without triggering any events.VgetInstance()Returns the bean instance.booleanisClosed()Indicates whether or not this bean was closed, i.e.booleanisDiscarded()Indicates whether or not this bean was discarded, i.e.booleanisRemoved()Indicates whether or not this bean was removed, i.e.voidremove()Removes this bean from the cache, triggering requisitePreDestroyevents.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.as.ejb3.component.stateful.cache.StatefulSessionBean
getId
-
-
-
-
Method Detail
-
getInstance
public V getInstance()
Description copied from interface:StatefulSessionBeanReturns the bean instance.- Specified by:
getInstancein interfaceStatefulSessionBean<K,V extends StatefulSessionBeanInstance<K>>- Returns:
- a bean instance.
-
isClosed
public boolean isClosed()
Description copied from interface:StatefulSessionBeanIndicates whether or not this bean was closed, i.e.StatefulSessionBean.close()was invoked.- Specified by:
isClosedin interfaceStatefulSessionBean<K,V extends StatefulSessionBeanInstance<K>>- Returns:
- true, if this bean is valid, false otherwise.
-
isDiscarded
public boolean isDiscarded()
Description copied from interface:StatefulSessionBeanIndicates whether or not this bean was discarded, i.e.StatefulSessionBean.discard()was invoked.- Specified by:
isDiscardedin interfaceStatefulSessionBean<K,V extends StatefulSessionBeanInstance<K>>- Returns:
- true, if this bean was discarded, false otherwise.
-
isRemoved
public boolean isRemoved()
Description copied from interface:StatefulSessionBeanIndicates whether or not this bean was removed, i.e.StatefulSessionBean.remove()was invoked.- Specified by:
isRemovedin interfaceStatefulSessionBean<K,V extends StatefulSessionBeanInstance<K>>- Returns:
- true, if this bean was removed, false otherwise.
-
discard
public void discard()
Description copied from interface:StatefulSessionBeanRemoves this bean from the cache without triggering any events. A discarded bean does not need to be closed.- Specified by:
discardin interfaceStatefulSessionBean<K,V extends StatefulSessionBeanInstance<K>>
-
remove
public void remove()
Description copied from interface:StatefulSessionBeanRemoves this bean from the cache, triggering requisitePreDestroyevents. A removed bean does not need to be closed.- Specified by:
removein interfaceStatefulSessionBean<K,V extends StatefulSessionBeanInstance<K>>
-
close
public void close()
Description copied from interface:StatefulSessionBeanCloses any resources associated with this bean. If bean has an associated timeout, it will schedule its expiration.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceStatefulSessionBean<K,V extends StatefulSessionBeanInstance<K>>
-
-