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
ConstructorsConstructorDescriptionSimpleStatefulSessionBean(V instance, Consumer<K> remover, Consumer<StatefulSessionBean<K, V>> closeTask) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes any resources associated with this bean.voiddiscard()Removes this bean from the cache without triggering any events.Returns the bean instance.booleanisClosed()Indicates whether or not this bean was closed, i.e.booleanIndicates whether or not this bean was discarded, i.e.booleanIndicates 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, waitMethods inherited from interface org.jboss.as.ejb3.component.stateful.cache.StatefulSessionBean
getId
-
Constructor Details
-
SimpleStatefulSessionBean
-
-
Method Details
-
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>>
-