|
|||||||||
| Home >> All >> com >> RuntimeCollective >> [ webapps overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.RuntimeCollective.webapps
Class IndexedEntityBeanStore

java.lang.Objectcom.RuntimeCollective.webapps.IndexedEntityBeanStore
- All Implemented Interfaces:
- EntityBeanStore
- Direct Known Subclasses:
- AlwaysUpdateEntityBeanStore, SynchronizedEntityBeanStore
- public class IndexedEntityBeanStore
- extends java.lang.Object
- implements EntityBeanStore
- extends java.lang.Object
An extension of SimpleEntityBeanStore that maintains a object index. This records the entity bean type for each unique ID, and enables this store to handle superclasses and interfaces properly.
For example, if a bean is registered on the store using a particular id and class name, but then retrieved using a superclass or interface name, then this store can still determine the correct constructor to call.
- Version:
- $Id: IndexedEntityBeanStore.java,v 1.43 2003/10/03 14:48:10 criss Exp $
| Constructor Summary | |
IndexedEntityBeanStore()
|
|
| Method Summary | |
static boolean |
checkClassExtendsOrImplementsAnother(java.lang.String subClassName,
java.lang.String parentClassName)
Check if a class name extends or implements another |
void |
clear()
Clear the store. |
com.RuntimeCollective.webapps.bean.EntityBean |
create(java.lang.String className)
Generate a new entity bean of the given class, with a new unique id. |
void |
delete(com.RuntimeCollective.webapps.bean.EntityBean eb)
Delete an entity bean |
void |
delete(java.lang.String className,
int id)
Delete an entity bean |
void |
fillGlobalObjectCache()
|
void |
flush(com.RuntimeCollective.webapps.bean.EntityBean eb)
Flush an entity bean from the cache, useful to spare memory, or for testing. |
void |
flush(java.lang.String className,
int id)
Flush an entity bean from the cache, useful to spare memory, or for testing. |
com.RuntimeCollective.webapps.bean.EntityBean |
get(java.lang.String className,
int id)
Get an entity bean (this used to use entity name) |
java.util.Iterator |
getAll(java.lang.String className)
Get an iterator of all saved beans of this class name |
java.util.List |
getAllAsList(java.lang.String className)
Get a list of all saved beans of this class name |
java.util.Iterator |
getAllClasses()
Get an iterator of all class names (entity names) that the EntityBeanStore handles |
java.util.Iterator |
getAllIds(java.lang.String className)
Get an iterator of all saved beans' ids of this class name |
java.util.List |
getAllIdsAsList(java.lang.String className)
Get a list of all saved beans' ids of this class name |
java.util.List |
getAsLazyList(java.lang.String className,
int[] ids)
Get a list of all beans in the id array, as a lazy-loading list |
java.util.List |
getAsLazyList(java.lang.String className,
java.util.List ids)
Get a list of all beans in the id array, as a lazy-loading list |
java.util.List |
getAsLazyList(java.lang.String className,
java.lang.String query)
Get a list of all beans whose ids are selected by the given query, as a lazy-loading list |
Cache |
getBeanCache(java.lang.String className)
Get the Cache for a Class name. |
java.util.Iterator |
getExactNameAll(java.lang.String className)
Get an iterator of all saved beans of this class name, but only this class, not sub-classes. |
java.util.List |
getExactNameAllAsList(java.lang.String className)
Get a list of all saved beans of this class name, but only this class, not sub-classes |
java.util.Iterator |
getExactNameAllIds(java.lang.String className)
Get an iterator of all saved beans' ids of this class name, but only this class, not sub-classes. |
java.util.List |
getExactNameAllIdsAsList(java.lang.String className)
Get a list of all saved beans' ids of this class name, but only this class, not sub-classes. |
protected java.lang.String |
getRealClassName(java.lang.String className,
int id)
Get the real class name of a bean, which should be a subclass of the class provided |
EntityBeanStore |
getStoreForBean(java.lang.String className)
Get the EntityBeanStore for a Class name. |
void |
init()
Initialise the store, creating the necessary hash maps to store the registered bean types. |
com.RuntimeCollective.webapps.bean.EntityBean |
refresh(com.RuntimeCollective.webapps.bean.EntityBean eb)
Refresh an entity bean in cache: flush it and get it. |
com.RuntimeCollective.webapps.bean.EntityBean |
refresh(java.lang.String className,
int id)
Refresh an entity bean in cache: flush it and get it. |
void |
registerBean(java.lang.String className,
java.lang.String cacheName)
Register an Entity Bean class on this store. |
void |
save(com.RuntimeCollective.webapps.bean.EntityBean eb)
Save an entity bean |
void |
save(java.lang.String className,
int id)
Save an entity bean |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
OBJECT_TABLE
public static final java.lang.String OBJECT_TABLE
- See Also:
- Constant Field Values
DELETE_QUERY
public static final java.lang.String DELETE_QUERY
- See Also:
- Constant Field Values
SELECT_QUERY
public static final java.lang.String SELECT_QUERY
- See Also:
- Constant Field Values
SELECT_CLASSNAME_QUERY
public static final java.lang.String SELECT_CLASSNAME_QUERY
- See Also:
- Constant Field Values
SELECT_ID
public static final java.lang.String SELECT_ID
- See Also:
- Constant Field Values
WHERE_CLASSNAME
public static final java.lang.String WHERE_CLASSNAME
- See Also:
- Constant Field Values
ORDER_BY
public static final java.lang.String ORDER_BY
- See Also:
- Constant Field Values
ESC_COMMA_ESC
public static final java.lang.String ESC_COMMA_ESC
- See Also:
- Constant Field Values
CLASS_NAME_FIELD
public static final java.lang.String CLASS_NAME_FIELD
- See Also:
- Constant Field Values
RELOADING_BEAN
public static final java.lang.String RELOADING_BEAN
- See Also:
- Constant Field Values
REFRESHING_BEAN
public static final java.lang.String REFRESHING_BEAN
- See Also:
- Constant Field Values
FLUSHING_BEAN
public static final java.lang.String FLUSHING_BEAN
- See Also:
- Constant Field Values
SAVING_BEAN
public static final java.lang.String SAVING_BEAN
- See Also:
- Constant Field Values
DELETING_BEAN
public static final java.lang.String DELETING_BEAN
- See Also:
- Constant Field Values
CREATED_BEAN
public static final java.lang.String CREATED_BEAN
- See Also:
- Constant Field Values
FROM_DB
public static final java.lang.String FROM_DB
- See Also:
- Constant Field Values
FOR_CLASS
public static final java.lang.String FOR_CLASS
- See Also:
- Constant Field Values
SPACE
public static final java.lang.String SPACE
- See Also:
- Constant Field Values
NOTHING
public static final java.lang.String NOTHING
- See Also:
- Constant Field Values
noRegisteredBeans
protected int noRegisteredBeans
classIndices
protected java.util.HashMap classIndices
gets
protected java.lang.reflect.Constructor[] gets
getsList
protected java.util.ArrayList getsList
creates
protected java.lang.reflect.Constructor[] creates
createsList
protected java.util.ArrayList createsList
classes
protected java.lang.Class[] classes
classesList
protected java.util.ArrayList classesList
tables
protected java.lang.String[] tables
tablesList
protected java.util.ArrayList tablesList
caches
protected Cache[] caches
cachesList
protected java.util.ArrayList cachesList
paramId
protected static java.lang.Integer[] paramId
paramNew
protected static java.lang.Integer[] paramNew
classId
protected static java.lang.Class[] classId
classNew
protected static java.lang.Class[] classNew
GlobalObjectIdNameHash
java.util.Hashtable GlobalObjectIdNameHash
ParentLists
public static java.util.Hashtable ParentLists
| Constructor Detail |
IndexedEntityBeanStore
public IndexedEntityBeanStore()
| Method Detail |
registerBean
public void registerBean(java.lang.String className, java.lang.String cacheName) throws java.lang.RuntimeException
- Register an Entity Bean class on this store.
- Specified by:
registerBeanin interfaceEntityBeanStore
init
public void init()
throws java.lang.RuntimeException
- Initialise the store, creating the necessary hash maps to store
the registered bean types.
- Specified by:
initin interfaceEntityBeanStore
fillGlobalObjectCache
public void fillGlobalObjectCache()
get
public com.RuntimeCollective.webapps.bean.EntityBean get(java.lang.String className, int id) throws java.lang.RuntimeException
- Get an entity bean (this used to use entity name)
- Specified by:
getin interfaceEntityBeanStore
refresh
public com.RuntimeCollective.webapps.bean.EntityBean refresh(com.RuntimeCollective.webapps.bean.EntityBean eb) throws java.lang.RuntimeException
- Refresh an entity bean in cache: flush it and get it.
- Specified by:
refreshin interfaceEntityBeanStore
refresh
public com.RuntimeCollective.webapps.bean.EntityBean refresh(java.lang.String className, int id) throws java.lang.RuntimeException
- Refresh an entity bean in cache: flush it and get it.
- Specified by:
refreshin interfaceEntityBeanStore
flush
public void flush(com.RuntimeCollective.webapps.bean.EntityBean eb) throws java.lang.RuntimeException
- Flush an entity bean from the cache, useful to spare memory, or for testing.
- Specified by:
flushin interfaceEntityBeanStore
flush
public void flush(java.lang.String className, int id) throws java.lang.RuntimeException
- Flush an entity bean from the cache, useful to spare memory, or for testing.
- Specified by:
flushin interfaceEntityBeanStore
create
public com.RuntimeCollective.webapps.bean.EntityBean create(java.lang.String className) throws java.lang.RuntimeException
- Generate a new entity bean of the given class, with a new unique id.
- Specified by:
createin interfaceEntityBeanStore
save
public void save(com.RuntimeCollective.webapps.bean.EntityBean eb) throws java.lang.RuntimeException
- Save an entity bean
- Specified by:
savein interfaceEntityBeanStore
save
public void save(java.lang.String className, int id) throws java.lang.RuntimeException
- Save an entity bean
- Specified by:
savein interfaceEntityBeanStore
delete
public void delete(com.RuntimeCollective.webapps.bean.EntityBean eb) throws java.lang.RuntimeException
- Delete an entity bean
- Specified by:
deletein interfaceEntityBeanStore
delete
public void delete(java.lang.String className, int id) throws java.lang.RuntimeException
- Delete an entity bean
- Specified by:
deletein interfaceEntityBeanStore
clear
public void clear()
- Clear the store.
- Specified by:
clearin interfaceEntityBeanStore
getAll
public java.util.Iterator getAll(java.lang.String className) throws java.sql.SQLException
- Get an iterator of all saved beans of this class name
- Specified by:
getAllin interfaceEntityBeanStore
getAllAsList
public java.util.List getAllAsList(java.lang.String className) throws java.sql.SQLException
- Get a list of all saved beans of this class name
- Specified by:
getAllAsListin interfaceEntityBeanStore
getAllIds
public java.util.Iterator getAllIds(java.lang.String className) throws java.sql.SQLException
- Get an iterator of all saved beans' ids of this class name
- Specified by:
getAllIdsin interfaceEntityBeanStore
getAllIdsAsList
public java.util.List getAllIdsAsList(java.lang.String className) throws java.sql.SQLException
- Get a list of all saved beans' ids of this class name
- Specified by:
getAllIdsAsListin interfaceEntityBeanStore
getExactNameAll
public java.util.Iterator getExactNameAll(java.lang.String className) throws java.sql.SQLException
- Get an iterator of all saved beans of this class name,
but only this class, not sub-classes.
- Specified by:
getExactNameAllin interfaceEntityBeanStore
getExactNameAllAsList
public java.util.List getExactNameAllAsList(java.lang.String className) throws java.sql.SQLException
- Get a list of all saved beans of this class name,
but only this class, not sub-classes
- Specified by:
getExactNameAllAsListin interfaceEntityBeanStore
getExactNameAllIds
public java.util.Iterator getExactNameAllIds(java.lang.String className) throws java.sql.SQLException
- Get an iterator of all saved beans' ids of this class name,
but only this class, not sub-classes.
- Specified by:
getExactNameAllIdsin interfaceEntityBeanStore
getExactNameAllIdsAsList
public java.util.List getExactNameAllIdsAsList(java.lang.String className) throws java.sql.SQLException
- Get a list of all saved beans' ids of this class name,
but only this class, not sub-classes.
- Specified by:
getExactNameAllIdsAsListin interfaceEntityBeanStore
getAllClasses
public java.util.Iterator getAllClasses() throws java.sql.SQLException
- Get an iterator of all class names (entity names) that the EntityBeanStore handles
- Specified by:
getAllClassesin interfaceEntityBeanStore
getStoreForBean
public EntityBeanStore getStoreForBean(java.lang.String className)
- Get the EntityBeanStore for a Class name.
- Specified by:
getStoreForBeanin interfaceEntityBeanStore
getBeanCache
public Cache getBeanCache(java.lang.String className)
- Get the Cache for a Class name.
- Specified by:
getBeanCachein interfaceEntityBeanStore
getRealClassName
protected java.lang.String getRealClassName(java.lang.String className, int id) throws java.lang.RuntimeException
- Get the real class name of a bean, which should be a subclass of the class provided
checkClassExtendsOrImplementsAnother
public static boolean checkClassExtendsOrImplementsAnother(java.lang.String subClassName, java.lang.String parentClassName) throws java.lang.RuntimeException
- Check if a class name extends or implements another
getAsLazyList
public java.util.List getAsLazyList(java.lang.String className, int[] ids)
- Get a list of all beans in the id array, as a lazy-loading list
- Specified by:
getAsLazyListin interfaceEntityBeanStore
getAsLazyList
public java.util.List getAsLazyList(java.lang.String className, java.util.List ids)
- Get a list of all beans in the id array, as a lazy-loading list
- Specified by:
getAsLazyListin interfaceEntityBeanStore
getAsLazyList
public java.util.List getAsLazyList(java.lang.String className, java.lang.String query)
- Get a list of all beans whose ids are selected by the given query,
as a lazy-loading list
- Specified by:
getAsLazyListin interfaceEntityBeanStore
|
|||||||||
| Home >> All >> com >> RuntimeCollective >> [ webapps overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.RuntimeCollective.webapps.IndexedEntityBeanStore