|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport
org.jboss.system.ServiceMBeanSupport
org.jboss.cache.TreeCache
org.jboss.cache.aop.MarshalledTreeCache
public class MarshalledTreeCache
Version of TreeCache that added call to handle marshalling values. You will need marshalling when your application is running under different class loader scope, for example, under JBoss AS where your application has a scoped class loader.
Note that: Currently, we also have a in-memory cache copy to minimize the call to unmarshalling. And we also have an invalidation mechanism in place to synchronize the external updates.
In the future, it'd be best if JBossCache can provides 1) notification excluding myself, 2) notification granulairty with specific modified key, 3) we will also move this to different package.
Finally, since the use of in-memory copy, the memory usage is almost doubled since we have one in-memory copy and the marshalled value in the cache store.
Field Summary | |
---|---|
protected TreeCache |
localCopy_
|
protected boolean |
marshalling_
|
protected java.lang.String |
nodeId_
|
protected static java.lang.String |
NODEID_KEY
|
protected java.lang.ClassLoader |
tcl_
|
protected boolean |
useLocalOptimization_
|
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
---|
server, SERVICE_CONTROLLER_SIG, serviceName |
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 | |
---|---|
MarshalledTreeCache()
|
|
MarshalledTreeCache(org.jgroups.JChannel channel)
|
|
MarshalledTreeCache(java.lang.String cluster_name,
java.lang.String props,
long state_fetch_timeout)
|
Method Summary | |
---|---|
void |
cacheStarted(TreeCache cache)
Called when the cache is started. |
void |
cacheStopped(TreeCache cache)
Called when the cache is stopped. |
protected void |
checkValue(java.lang.Object value)
|
java.lang.String |
getNodeId()
DataNode id is a communication id that denotes the cluster node. |
protected void |
invalidate(Fqn fqn)
Invalidate the local copy cache. |
java.lang.Object |
marshalledGet_(Fqn fqn,
java.lang.Object key)
|
java.lang.Object |
marshalledGet(Fqn fqn,
java.lang.Object key)
Obtain the value from the marshalled cache. |
java.lang.Object |
marshalledGet(java.lang.String fqn,
java.lang.Object key)
|
void |
marshalledPut_(Fqn fqn,
java.lang.Object key,
java.lang.Object value)
|
void |
marshalledPut(Fqn fqn,
java.lang.Object key,
java.lang.Object value)
Marshalled put. |
void |
marshalledPut(java.lang.String fqn,
java.lang.Object key,
java.lang.Object value)
|
java.lang.Object |
marshalledRemove_(Fqn fqn,
java.lang.Object key)
|
java.lang.Object |
marshalledRemove(Fqn fqn,
java.lang.Object key)
Remove a marshalled node. |
java.lang.Object |
marshalledRemove(java.lang.String fqn,
java.lang.Object key)
|
void |
nodeCreated(Fqn fqn)
Called when a node is created |
void |
nodeEvicted(Fqn fqn)
Called when a node is evicted (not the same as remove()). |
void |
nodeLoaded(Fqn fqn)
Called when a node is loaded into memory via the CacheLoader. |
void |
nodeModified(Fqn fqn)
Called when a node is modified, e.g., one (key, value) pair in the internal map storage has been modified. |
void |
nodeRemoved(Fqn fqn)
Called when a node is removed. |
void |
nodeVisited(Fqn fqn)
Called when a node is visisted, i.e., get(). |
protected void |
obtainNodeId()
Get a node id based on jgroups properties. |
void |
setClassLoader(java.lang.ClassLoader tcl)
The context class loader to perform marshalling/unmarshalling |
void |
setLocalOptimization(boolean optimization)
Indicate whether to have a in-memory copy of the unmarshalling object such that there is no need to unmarshal. |
void |
setMarshalling(boolean marshalling)
Turn marshalling layer on or off. |
void |
startService()
Lifecyle method. |
void |
stopService()
Lifecycle method. |
void |
viewChange(org.jgroups.View new_view)
|
Methods inherited from class org.jboss.system.ServiceMBeanSupport |
---|
create, destroy, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport |
---|
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, 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 |
Field Detail |
---|
protected TreeCache localCopy_
protected java.lang.String nodeId_
protected static final java.lang.String NODEID_KEY
protected java.lang.ClassLoader tcl_
protected boolean useLocalOptimization_
protected boolean marshalling_
Constructor Detail |
---|
public MarshalledTreeCache(java.lang.String cluster_name, java.lang.String props, long state_fetch_timeout) throws java.lang.Exception
java.lang.Exception
public MarshalledTreeCache() throws java.lang.Exception
java.lang.Exception
public MarshalledTreeCache(org.jgroups.JChannel channel) throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
public void startService() throws java.lang.Exception
TreeCache
start
startService
in interface TreeCacheMBean
startService
in class TreeCache
java.lang.Exception
public void stopService()
TreeCache
stop
.
stopService
in interface TreeCacheMBean
stopService
in class TreeCache
protected void obtainNodeId()
public java.lang.String getNodeId()
public void setMarshalling(boolean marshalling)
public void setLocalOptimization(boolean optimization)
public void setClassLoader(java.lang.ClassLoader tcl)
public void marshalledPut(java.lang.String fqn, java.lang.Object key, java.lang.Object value) throws CacheException
CacheException
public void marshalledPut(Fqn fqn, java.lang.Object key, java.lang.Object value) throws CacheException
CacheException
public void marshalledPut_(Fqn fqn, java.lang.Object key, java.lang.Object value) throws CacheException
CacheException
public java.lang.Object marshalledGet(java.lang.String fqn, java.lang.Object key) throws CacheException
CacheException
public java.lang.Object marshalledGet(Fqn fqn, java.lang.Object key) throws CacheException
CacheException
public java.lang.Object marshalledGet_(Fqn fqn, java.lang.Object key) throws CacheException
CacheException
public java.lang.Object marshalledRemove(java.lang.String fqn, java.lang.Object key) throws CacheException
CacheException
public java.lang.Object marshalledRemove(Fqn fqn, java.lang.Object key) throws CacheException
CacheException
public java.lang.Object marshalledRemove_(Fqn fqn, java.lang.Object key) throws CacheException
CacheException
public void nodeCreated(Fqn fqn)
TreeCacheListener
nodeCreated
in interface TreeCacheListener
public void nodeRemoved(Fqn fqn)
TreeCacheListener
nodeRemoved
in interface TreeCacheListener
public void nodeLoaded(Fqn fqn)
TreeCacheListener
TreeCacheListener.nodeCreated(Fqn)
.
nodeLoaded
in interface TreeCacheListener
public void nodeEvicted(Fqn fqn)
TreeCacheListener
nodeEvicted
in interface TreeCacheListener
public void nodeModified(Fqn fqn)
TreeCacheListener
nodeModified
in interface TreeCacheListener
public void nodeVisited(Fqn fqn)
TreeCacheListener
nodeVisited
in interface TreeCacheListener
public void cacheStarted(TreeCache cache)
TreeCacheListener
cacheStarted
in interface TreeCacheListener
public void cacheStopped(TreeCache cache)
TreeCacheListener
cacheStopped
in interface TreeCacheListener
public void viewChange(org.jgroups.View new_view)
viewChange
in interface TreeCacheListener
protected void checkValue(java.lang.Object value)
protected void invalidate(Fqn fqn)
fqn
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |