站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 server API Documentation 英文版文档

TableCache (JBoss Server API) - JBoss 4.0.1 sp1 server API Documentation 英文版文档


org.jboss.ejb.plugins.cmp.jdbc2.schema
Class TableCache

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended byorg.jboss.system.ServiceMBeanSupport
          extended byorg.jboss.ejb.plugins.cmp.jdbc2.schema.TableCache
All Implemented Interfaces:
Cache, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, org.jboss.system.Service, org.jboss.system.ServiceMBean, TableCacheMBean

public class TableCache
extends org.jboss.system.ServiceMBeanSupport
implements Cache, TableCacheMBean

Simple LRU cache. Items are evicted when maxCapacity is exceeded.

Version:
$Revision: 1.8.4.2 $
Author:
Alexey Loubyansky

Nested Class Summary
 
Nested classes inherited from class org.jboss.ejb.plugins.cmp.jdbc2.schema.Cache
Cache.CacheLoader, Cache.Listener, Cache.RemoveException
 
Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.ejb.plugins.cmp.jdbc2.schema.Cache
NONE
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
TableCache(Element conf)
           
TableCache(int partitionIndex, int initialCapacity, int maxCapacity)
           
 
Method Summary
 boolean contains(Transaction tx, Object pk)
           
 void flush()
           
 Object[] getFields(Object pk)
           
 int getMaxCapacity()
           
 int getMinCapacity()
           
 Object[] getRelations(Object pk)
           
 void lock()
           
 void lock(Object key)
           
 void lockForUpdate(Transaction tx, Object pk)
           
 void put(Transaction tx, Object pk, Object[] fields, Object[] relations)
           
 void registerListener(Cache.Listener listener)
           
 void releaseLock(Transaction tx, Object pk)
           
 void remove(Transaction tx, Object pk)
           
 void setMaxCapacity(int maxCapacity)
           
 int size()
           
 String toString()
           
 void unlock()
           
 void unlock(Object key)
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, startService, stop, stopService
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Constructor Detail

TableCache

public TableCache(int partitionIndex,
                  int initialCapacity,
                  int maxCapacity)

TableCache

public TableCache(Element conf)
           throws org.jboss.deployment.DeploymentException
Method Detail

registerListener

public void registerListener(Cache.Listener listener)
Specified by:
registerListener in interface TableCacheMBean

size

public int size()
Specified by:
size in interface TableCacheMBean

getMaxCapacity

public int getMaxCapacity()
Specified by:
getMaxCapacity in interface TableCacheMBean

setMaxCapacity

public void setMaxCapacity(int maxCapacity)
Specified by:
setMaxCapacity in interface TableCacheMBean

getMinCapacity

public int getMinCapacity()
Specified by:
getMinCapacity in interface TableCacheMBean

lock

public void lock()
Specified by:
lock in interface Cache

lock

public void lock(Object key)
Specified by:
lock in interface Cache

unlock

public void unlock()
Specified by:
unlock in interface Cache

unlock

public void unlock(Object key)
Specified by:
unlock in interface Cache

getFields

public Object[] getFields(Object pk)
Specified by:
getFields in interface Cache

getRelations

public Object[] getRelations(Object pk)
Specified by:
getRelations in interface Cache

put

public void put(Transaction tx,
                Object pk,
                Object[] fields,
                Object[] relations)
Specified by:
put in interface Cache

remove

public void remove(Transaction tx,
                   Object pk)
Specified by:
remove in interface Cache

contains

public boolean contains(Transaction tx,
                        Object pk)
Specified by:
contains in interface Cache

lockForUpdate

public void lockForUpdate(Transaction tx,
                          Object pk)
                   throws Exception
Specified by:
lockForUpdate in interface Cache
Throws:
Exception

releaseLock

public void releaseLock(Transaction tx,
                        Object pk)
                 throws Exception
Specified by:
releaseLock in interface Cache
Throws:
Exception

flush

public void flush()
Specified by:
flush in interface Cache

toString

public String toString()


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.