Class SimpleStatefulSessionBeanCache<K,V extends StatefulSessionBeanInstance<K>>
java.lang.Object
org.jboss.as.ejb3.component.stateful.cache.simple.SimpleStatefulSessionBeanCache<K,V>
- Type Parameters:
K- the bean identifier typeV- the bean instance type
- All Implemented Interfaces:
Consumer<StatefulSessionBean<K,,V>> Predicate<K>,StatefulSessionBeanCache<K,,V> BeanStatistics,AffinitySupport<K>,org.wildfly.clustering.server.manager.Service
public class SimpleStatefulSessionBeanCache<K,V extends StatefulSessionBeanInstance<K>>
extends Object
implements StatefulSessionBeanCache<K,V>, Predicate<K>, Consumer<StatefulSessionBean<K,V>>
A simple stateful session bean cache implementation.
Bean instances are stored in memory and are lost on undeploy, shutdown, or server crash.
- Author:
- Paul Ferraro
-
Field Summary
Fields inherited from interface org.jboss.as.ejb3.component.stateful.cache.StatefulSessionBeanCache
CURRENT_GROUP -
Constructor Summary
ConstructorsConstructorDescriptionSimpleStatefulSessionBeanCache(SimpleStatefulSessionBeanCacheConfiguration<K, V> configuration) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(StatefulSessionBean<K, V> bean) Creates and caches a stateful bean using a generated identifier.Returns the stateful bean with the specified identifier, or null if no such bean exists.intReturns the identifier factory of this cache.intorg.jboss.ejb.client.Affinityorg.jboss.ejb.client.AffinitygetWeakAffinity(K id) voidstart()voidstop()booleanMethods 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.StatefulSessionBeanCache
isRemotable
-
Constructor Details
-
SimpleStatefulSessionBeanCache
public SimpleStatefulSessionBeanCache(SimpleStatefulSessionBeanCacheConfiguration<K, V> configuration)
-
-
Method Details
-
start
public void start()- Specified by:
startin interfaceorg.wildfly.clustering.server.manager.Service
-
stop
public void stop()- Specified by:
stopin interfaceorg.wildfly.clustering.server.manager.Service
-
getStrongAffinity
public org.jboss.ejb.client.Affinity getStrongAffinity()- Specified by:
getStrongAffinityin interfaceAffinitySupport<K>
-
getWeakAffinity
- Specified by:
getWeakAffinityin interfaceAffinitySupport<K>
-
accept
-
test
-
createStatefulSessionBean
Description copied from interface:StatefulSessionBeanCacheCreates and caches a stateful bean using a generated identifier.- Specified by:
createStatefulSessionBeanin interfaceStatefulSessionBeanCache<K,V extends StatefulSessionBeanInstance<K>> - Returns:
- the identifier of the created session bean
-
findStatefulSessionBean
Description copied from interface:StatefulSessionBeanCacheReturns the stateful bean with the specified identifier, or null if no such bean exists.- Specified by:
findStatefulSessionBeanin interfaceStatefulSessionBeanCache<K,V extends StatefulSessionBeanInstance<K>> - Returns:
- an existing stateful bean, or null if none was found
-
getActiveCount
public int getActiveCount()- Specified by:
getActiveCountin interfaceBeanStatistics
-
getPassiveCount
public int getPassiveCount()- Specified by:
getPassiveCountin interfaceBeanStatistics
-
getIdentifierFactory
Description copied from interface:StatefulSessionBeanCacheReturns the identifier factory of this cache.- Specified by:
getIdentifierFactoryin interfaceStatefulSessionBeanCache<K,V extends StatefulSessionBeanInstance<K>> - Returns:
- an identifier factory
-