|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.torque.manager.AbstractBaseManager
public abstract class AbstractBaseManager
This class contains common functionality of a Manager for instantiating OM's.
Field Summary | |
---|---|
protected org.apache.jcs.access.GroupCacheAccess |
cache
used to cache the om objects. |
protected java.util.Map |
listenersMap
|
protected static org.apache.commons.logging.Log |
log
the log |
protected MethodResultCache |
mrCache
method results cache |
protected java.util.Map |
validFields
|
Constructor Summary | |
---|---|
AbstractBaseManager()
|
Method Summary | |
---|---|
void |
addCacheListenerImpl(CacheListener listener)
|
protected Persistent |
cacheGet(java.io.Serializable key)
Get an object from cache |
protected void |
clearImpl()
Clears the cache |
void |
dispose()
Disposes of the cache. |
java.lang.String |
getClassName()
Get the classname to instantiate for getInstance() |
MethodResultCache |
getMethodResultCache()
|
protected java.lang.Class |
getOMClass()
Get the Class instance |
protected Persistent |
getOMInstance()
Get a fresh instance of an om |
protected Persistent |
getOMInstance(ObjectKey id)
Return an instance of an om based on the id |
protected Persistent |
getOMInstance(ObjectKey key,
boolean fromCache)
Return an instance of an om based on the id |
protected java.util.List |
getOMs(java.util.List ids)
Gets a list of om's based on id's. |
protected java.util.List |
getOMs(java.util.List ids,
boolean fromCache)
Gets a list of om's based on id's. |
protected java.util.List |
getOMs(ObjectKey[] ids)
Gets a list of om's based on id's. |
java.lang.String |
getRegion()
Get the value of region. |
protected void |
notifyListeners(java.util.List listeners,
Persistent oldOm,
Persistent om)
|
protected Persistent |
putInstanceImpl(Persistent om)
Put an object into the cache |
protected Persistent |
putInstanceImpl(java.io.Serializable key,
Persistent om)
Put an object into the cache |
protected void |
registerAsListener()
NoOp version. |
protected Persistent |
removeInstanceImpl(java.io.Serializable key)
Remove an object from the cache |
protected abstract Persistent |
retrieveStoredOM(ObjectKey id)
Retrieve an object from persistent storage |
protected abstract java.util.List |
retrieveStoredOMs(java.util.List ids)
Gets a list of om's based on id's. |
void |
setClassName(java.lang.String v)
Set the classname to instantiate for getInstance() |
protected void |
setOMClass(java.lang.Class omClass)
Set the Class that will be instantiated by this manager |
void |
setRegion(java.lang.String v)
Set the value of region. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log log
protected transient org.apache.jcs.access.GroupCacheAccess cache
protected MethodResultCache mrCache
protected java.util.Map validFields
protected java.util.Map listenersMap
Constructor Detail |
---|
public AbstractBaseManager()
Method Detail |
---|
protected java.lang.Class getOMClass()
protected void setOMClass(java.lang.Class omClass)
omClass
- the om classprotected Persistent getOMInstance() throws java.lang.InstantiationException, java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.IllegalAccessException
public java.lang.String getClassName()
public void setClassName(java.lang.String v) throws TorqueException
v
- Value to assign to className.
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.protected Persistent getOMInstance(ObjectKey id) throws TorqueException
id
- the primary key of the object
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.protected Persistent getOMInstance(ObjectKey key, boolean fromCache) throws TorqueException
key
- the primary key of the objectfromCache
- true if the object should be retrieved from cache
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.protected Persistent cacheGet(java.io.Serializable key)
key
- the primary key of the object
protected void clearImpl() throws TorqueException
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.public void dispose()
protected Persistent removeInstanceImpl(java.io.Serializable key) throws TorqueException
key
- the cache key for the object
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.protected Persistent putInstanceImpl(Persistent om) throws TorqueException
om
- the object
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.protected Persistent putInstanceImpl(java.io.Serializable key, Persistent om) throws TorqueException
key
- the cache key for the objectom
- the object
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.protected abstract Persistent retrieveStoredOM(ObjectKey id) throws TorqueException
id
- the primary key of the object
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.protected java.util.List getOMs(ObjectKey[] ids) throws TorqueException
ids
- a ObjectKey[]
value
List
value
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.protected java.util.List getOMs(java.util.List ids) throws TorqueException
ids
- a List
of ObjectKey
's
List
value
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.protected java.util.List getOMs(java.util.List ids, boolean fromCache) throws TorqueException
ids
- a List
of ObjectKey
's
List
value
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.protected abstract java.util.List retrieveStoredOMs(java.util.List ids) throws TorqueException
ids
- a List
of ObjectKey
's
List
value
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.public java.lang.String getRegion()
public void setRegion(java.lang.String v) throws TorqueException
v
- Value to assign to region.
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.public MethodResultCache getMethodResultCache()
protected void registerAsListener()
public void addCacheListenerImpl(CacheListener listener)
listener
- A new listener for cache events.protected void notifyListeners(java.util.List listeners, Persistent oldOm, Persistent om)
listeners
- oldOm
- om
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |