|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.cache.pojo.impl.PojoCacheImpl
public class PojoCacheImpl
Implementation class for PojoCache interface
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
log_
|
Constructor Summary | |
---|---|
PojoCacheImpl(Configuration config,
boolean toStart)
|
|
PojoCacheImpl(java.lang.String configStr,
boolean toStart)
|
Method Summary | |
---|---|
java.lang.Object |
_evictObject(Fqn fqn)
Used by internal implementation. |
void |
addListener(java.lang.Object listener)
Add a PojoCache listener. |
void |
addListener(java.lang.Object listener,
java.util.regex.Pattern pattern)
Add a PojoCache listener that will only monitor a specific ID(FQN) pattern. |
java.lang.Object |
attach(Fqn id,
java.lang.Object pojo)
|
java.lang.Object |
attach(Fqn id,
java.lang.Object pojo,
java.lang.String field)
|
java.lang.Object |
attach(java.lang.String id,
java.lang.Object pojo)
Attach a POJO into PojoCache. |
void |
create()
Lifecycle method to start PojoCache. |
void |
destroy()
Lifecycle method to destroy PojoCache. |
java.lang.Object |
detach(Fqn id)
|
java.lang.Object |
detach(Fqn id,
java.lang.String field)
|
java.lang.Object |
detach(java.lang.String id)
Remove POJO object from the cache. |
java.lang.Object |
find(Fqn id)
|
java.lang.Object |
find(java.lang.String id)
Retrieve POJO from the cache system. |
java.util.Map |
findAll(Fqn id)
|
java.util.Map |
findAll(java.lang.String id)
Query all managed POJO objects under the id recursively. |
Cache<java.lang.Object,java.lang.Object> |
getCache()
Obtain the underlying generic cache system. |
CachedType |
getCachedType(java.lang.Class clazz)
Obtain a cache aop type for user to traverse the defined "primitive" types in aop. |
CacheSPI |
getCacheSPI()
|
java.util.Collection<java.lang.Object> |
getListeners()
Retrieve a read-only list of listeners. |
java.lang.Object |
getObject(Fqn id)
|
java.lang.Object |
getObject(Fqn id,
java.lang.String field)
|
java.lang.String |
getPojoID(java.lang.Object pojo)
Return the POJO id that is associated with PojoCache. |
java.lang.String |
getVersion()
|
java.lang.Object |
putObject(Fqn id,
java.lang.Object pojo,
java.lang.String field)
This public API is called from internal package only. |
void |
removeListener(java.lang.Object listener)
Remove the specific listener. |
java.lang.Object |
removeObject(Fqn id,
java.lang.String field)
|
void |
start()
Lifecycle method to start PojoCache. |
void |
stop()
Lifecycle method to stop PojoCache. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final org.apache.commons.logging.Log log_
Constructor Detail |
---|
public PojoCacheImpl(java.lang.String configStr, boolean toStart)
public PojoCacheImpl(Configuration config, boolean toStart)
Method Detail |
---|
public CacheSPI getCacheSPI()
public java.lang.Object attach(java.lang.String id, java.lang.Object pojo) throws PojoCacheException
PojoCache
Attach a POJO into PojoCache. It will also recursively put any sub-POJO into the cache system. A POJO can be the following and have the consqeuences when attached:
@org.jboss.cache.pojo.annotation.Replicable
annotation (or via XML),
and has
been "instrumented" either compile- or load-time. The POJO will be mapped
recursively to the system and fine-grained replication will be
performed.
attach
in interface PojoCache
id
- An id String to identify the object in the cache. To promote
concurrency, we recommend the use of hierarchical String separating by a
designated separator. Default is "/" but it can be set differently via a
System property, jbosscache.separator in the future release. E.g., "ben",
or "student/joe", etc.pojo
- object to be inerted into the cache. If null, it will nullify
the fqn node.
PojoCacheException
- Throws if there is an error related to the cache operation.public java.lang.Object attach(Fqn id, java.lang.Object pojo) throws PojoCacheException
PojoCacheException
public java.lang.Object attach(Fqn id, java.lang.Object pojo, java.lang.String field) throws PojoCacheException
PojoCacheException
public java.lang.Object putObject(Fqn id, java.lang.Object pojo, java.lang.String field) throws CacheException
CacheException
public java.lang.Object detach(java.lang.String id) throws PojoCacheException
PojoCache
detach
in interface PojoCache
id
- Is string that associates with this node.
PojoCacheException
- Throws if there is an error related to the cache operation.public java.lang.Object detach(Fqn id, java.lang.String field) throws PojoCacheException
PojoCacheException
public java.lang.Object detach(Fqn id) throws PojoCacheException
PojoCacheException
public java.lang.Object removeObject(Fqn id, java.lang.String field) throws CacheException
CacheException
public java.lang.String getPojoID(java.lang.Object pojo)
PojoCache
getPojoID
in interface PojoCache
pojo
- The POJO that is attached to PojoCache.
public java.lang.Object find(java.lang.String id) throws PojoCacheException
PojoCache
find
in interface PojoCache
id
- that associates with this node.
PojoCacheException
- Throws if there is an error related to the cache operation.public java.lang.Object find(Fqn id) throws PojoCacheException
PojoCacheException
public java.lang.Object getObject(Fqn id) throws CacheException
CacheException
public java.lang.Object getObject(Fqn id, java.lang.String field) throws CacheException
CacheException
public java.util.Map findAll(java.lang.String id) throws PojoCacheException
PojoCache
findAll
in interface PojoCache
id
- The starting place to find all POJOs.
PojoCacheException
- Throws if there is an error related to the cache operation.public java.util.Map findAll(Fqn id) throws PojoCacheException
PojoCacheException
public java.lang.String getVersion()
public void create() throws PojoCacheException
PojoCache
create
in interface PojoCache
PojoCacheException
public void start() throws PojoCacheException
PojoCache
start
in interface PojoCache
PojoCacheException
public void stop() throws PojoCacheException
PojoCache
stop
in interface PojoCache
PojoCacheException
public void destroy() throws PojoCacheException
PojoCache
destroy
in interface PojoCache
PojoCacheException
public java.util.Collection<java.lang.Object> getListeners()
PojoCache
getListeners
in interface PojoCache
public void addListener(java.lang.Object listener)
PojoCache
Add a PojoCache listener. A given listener instance can only be added once. To have a duplicate listener simply create a new instance.
The listener must be annotated with the PojoCacheListener
annotation, and
all callback methods need to be annotated with the respective event annotations.
Otherwise, an exception will be thrown.
addListener
in interface PojoCache
listener
- the listener instance to registerfor examples
public void addListener(java.lang.Object listener, java.util.regex.Pattern pattern)
PojoCache
Add a PojoCache listener that will only monitor a specific ID(FQN) pattern. A given listener instance can only be added once, whether or not there is a pattern. To have a duplicate listener simply create a new instance.
The listener must be annotated with the PojoCacheListener
annotation, and
all callback methods need to be annotated with the respective event annotations.
Otherwise, an exception will be thrown.
addListener
in interface PojoCache
listener
- the listener instance to registerpattern
- the ID pattern for notifications of interestfor examples
public void removeListener(java.lang.Object listener)
PojoCache
removeListener
in interface PojoCache
listener
- the listener to removepublic Cache<java.lang.Object,java.lang.Object> getCache()
PojoCache
getCache
in interface PojoCache
public java.lang.Object _evictObject(Fqn fqn) throws CacheException
CacheException
public CachedType getCachedType(java.lang.Class clazz)
clazz
- The original pojo class
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |