Class DistributableStatefulSessionBeanCache<K,V extends StatefulSessionBeanInstance<K>>
- java.lang.Object
-
- org.jboss.as.ejb3.component.stateful.cache.distributable.DistributableStatefulSessionBeanCache<K,V>
-
- Type Parameters:
K- the bean identifier typeV- the bean instance type
- All Implemented Interfaces:
StatefulSessionBeanCache<K,V>,Restartable,BeanStatistics,AffinitySupport<K>
public class DistributableStatefulSessionBeanCache<K,V extends StatefulSessionBeanInstance<K>> extends Object implements StatefulSessionBeanCache<K,V>
A distributable stateful session bean cache. The availability of bean instances managed by this cache is determined by the underlying bean manager implementation.- Author:
- Paul Ferraro
-
-
Field Summary
-
Fields inherited from interface org.jboss.as.ejb3.component.stateful.cache.StatefulSessionBeanCache
CURRENT_GROUP
-
-
Constructor Summary
Constructors Constructor Description DistributableStatefulSessionBeanCache(DistributableStatefulSessionBeanCacheConfiguration<K,V> configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KcreateStatefulSessionBean()Creates and caches a stateful bean using a generated identifier.StatefulSessionBean<K,V>findStatefulSessionBean(K id)Returns the stateful bean with the specified identifier, or null if no such bean exists.intgetActiveCount()Supplier<K>getIdentifierFactory()Returns the identifier factory of this cache.intgetPassiveCount()org.jboss.ejb.client.AffinitygetStrongAffinity()org.jboss.ejb.client.AffinitygetWeakAffinity(K id)booleanisRemotable(Throwable throwable)Checks whether the suppliedThrowableis remotable - meaning it can be safely sent to the client over the wire.voidstart()voidstop()
-
-
-
Constructor Detail
-
DistributableStatefulSessionBeanCache
public DistributableStatefulSessionBeanCache(DistributableStatefulSessionBeanCacheConfiguration<K,V> configuration)
-
-
Method Detail
-
start
public void start()
- Specified by:
startin interfaceRestartable
-
stop
public void stop()
- Specified by:
stopin interfaceRestartable
-
getStrongAffinity
public org.jboss.ejb.client.Affinity getStrongAffinity()
- Specified by:
getStrongAffinityin interfaceAffinitySupport<K>
-
getWeakAffinity
public org.jboss.ejb.client.Affinity getWeakAffinity(K id)
- Specified by:
getWeakAffinityin interfaceAffinitySupport<K>
-
createStatefulSessionBean
public K 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
public StatefulSessionBean<K,V> findStatefulSessionBean(K id)
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
public Supplier<K> 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
-
isRemotable
public boolean isRemotable(Throwable throwable)
Description copied from interface:StatefulSessionBeanCacheChecks whether the suppliedThrowableis remotable - meaning it can be safely sent to the client over the wire.- Specified by:
isRemotablein interfaceStatefulSessionBeanCache<K,V extends StatefulSessionBeanInstance<K>>
-
-