Google

JBoss API: Class EntityInstanceCache

org.jboss.ejb.plugins
Class EntityInstanceCache

java.lang.Object
  |
  +--org.jboss.ejb.plugins.AbstractInstanceCache
        |
        +--org.jboss.ejb.plugins.EntityInstanceCache
All Implemented Interfaces:
ContainerPlugin, EntityCache, InstanceCache, MetricsConstants, Monitorable, Service, XmlLoadable

public class EntityInstanceCache
extends AbstractInstanceCache
implements EntityCache

Cache subclass for entity beans.

Version:
$Revision: 1.7.2.4 $
Author:
Simone Bordet, Bill Burke

Inner classes inherited from class org.jboss.ejb.plugins.AbstractInstanceCache
AbstractInstanceCache.PassivationHelper
 
Fields inherited from class org.jboss.ejb.plugins.AbstractInstanceCache
log
 
Fields inherited from interface org.jboss.monitor.MetricsConstants
ACTIVITY, APPLICATION, BEAN, BEANCACHE_METRICS, CHECKPOINT, INVOCATION_METRICS, MEMORY_MONITOR, METHOD, PRIMARY_KEY, SYSTEM_METRICS, THREAD_MONITOR, TIME, TYPE
 
Constructor Summary
EntityInstanceCache()
           
 
Method Summary
protected  EnterpriseContext acquireContext()
          Acquires an EnterpriseContext from the pool
protected  void activate(EnterpriseContext ctx)
          Activates the given EnterpriseContext
protected  boolean canPassivate(EnterpriseContext ctx)
          Returns whether the given context can be passivated or not
 java.lang.Object createCacheKey(java.lang.Object id)
          Returns the key used to cache the context
 void destroy()
           
protected  void freeContext(EnterpriseContext ctx)
          Frees the given EnterpriseContext to the pool
 EnterpriseContext get(java.lang.Object id)
          Gets a bean instance from this cache given the identity.
protected  Container getContainer()
          Returns the container for this cache.
protected  java.lang.Object getKey(EnterpriseContext ctx)
          Returns the key used by the cache to map the given context
protected  void passivate(EnterpriseContext ctx)
          Passivates the given EnterpriseContext
 void remove(java.lang.Object id)
          Removes a bean instance from this cache given the identity.
 void setContainer(Container c)
          This callback is set by the container so that the plugin may access it
protected  void setKey(java.lang.Object id, EnterpriseContext ctx)
          Sets the given id as key for the given context
 
Methods inherited from class org.jboss.ejb.plugins.AbstractInstanceCache
getCache, getCacheLock, importXml, init, insert, isActive, isJMSMonitoringEnabled, logActivation, logPassivation, logPassivationPostponed, logPassivationScheduled, release, resetStatistic, retrieveStatistic, sample, schedulePassivation, setJMSMonitoringEnabled, start, stop, unschedulePassivation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.ejb.InstanceCache
insert, isActive, release
 
Methods inherited from interface org.jboss.util.Service
init, start, stop
 

Constructor Detail

EntityInstanceCache

public EntityInstanceCache()
Method Detail

setContainer

public void setContainer(Container c)
Description copied from interface: ContainerPlugin
This callback is set by the container so that the plugin may access it
Specified by:
setContainer in interface ContainerPlugin
Following copied from interface: org.jboss.ejb.ContainerPlugin
Parameters:
con - the container using this plugin

createCacheKey

public java.lang.Object createCacheKey(java.lang.Object id)
Description copied from interface: EntityCache
Returns the key used to cache the context
Specified by:
createCacheKey in interface EntityCache
Following copied from interface: org.jboss.ejb.EntityCache
Parameters:
id - Object id / primary key
Returns:
Cache key

destroy

public void destroy()
Specified by:
destroy in interface Service
Overrides:
destroy in class AbstractInstanceCache

get

public EnterpriseContext get(java.lang.Object id)
                      throws java.rmi.RemoteException,
                             java.rmi.NoSuchObjectException
Description copied from interface: InstanceCache
Gets a bean instance from this cache given the identity. This method may involve activation if the instance is not in the cache. Implementation should have O(1) complexity. This method is never called for stateless session beans.
Specified by:
get in interface InstanceCache
Overrides:
get in class AbstractInstanceCache
Following copied from interface: org.jboss.ejb.InstanceCache
Parameters:
id - the primary key of the bean
Returns:
the EnterpriseContext related to the given id
Throws:
java.rmi.RemoteException - in case of illegal calls (concurrent / reentrant), NoSuchObjectException if the bean cannot be found.
See Also:
InstanceCache.release(org.jboss.ejb.EnterpriseContext)

remove

public void remove(java.lang.Object id)
Description copied from interface: InstanceCache
Removes a bean instance from this cache given the identity. Implementation should have O(1) complexity and guarantee proper locking.
Specified by:
remove in interface InstanceCache
Overrides:
remove in class AbstractInstanceCache
Following copied from interface: org.jboss.ejb.InstanceCache
Parameters:
id - the pimary key of the bean
See Also:
InstanceCache.insert(org.jboss.ejb.EnterpriseContext)

getKey

protected java.lang.Object getKey(EnterpriseContext ctx)
Description copied from class: AbstractInstanceCache
Returns the key used by the cache to map the given context
Overrides:
getKey in class AbstractInstanceCache

setKey

protected void setKey(java.lang.Object id,
                      EnterpriseContext ctx)
Description copied from class: AbstractInstanceCache
Sets the given id as key for the given context
Overrides:
setKey in class AbstractInstanceCache

getContainer

protected Container getContainer()
Description copied from class: AbstractInstanceCache
Returns the container for this cache.
Overrides:
getContainer in class AbstractInstanceCache

passivate

protected void passivate(EnterpriseContext ctx)
                  throws java.rmi.RemoteException
Description copied from class: AbstractInstanceCache
Passivates the given EnterpriseContext
Overrides:
passivate in class AbstractInstanceCache

activate

protected void activate(EnterpriseContext ctx)
                 throws java.rmi.RemoteException
Description copied from class: AbstractInstanceCache
Activates the given EnterpriseContext
Overrides:
activate in class AbstractInstanceCache

acquireContext

protected EnterpriseContext acquireContext()
                                    throws java.lang.Exception
Description copied from class: AbstractInstanceCache
Acquires an EnterpriseContext from the pool
Overrides:
acquireContext in class AbstractInstanceCache

freeContext

protected void freeContext(EnterpriseContext ctx)
Description copied from class: AbstractInstanceCache
Frees the given EnterpriseContext to the pool
Overrides:
freeContext in class AbstractInstanceCache

canPassivate

protected boolean canPassivate(EnterpriseContext ctx)
Description copied from class: AbstractInstanceCache
Returns whether the given context can be passivated or not
Overrides:
canPassivate in class AbstractInstanceCache


Copyright © 2000 The JBoss Organization. All Rights Reserved.