|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.cache.marshall.TreeCacheMarshaller
public class TreeCacheMarshaller
Marshaller implementation that does aplication specific marshalling in the JGroups RpcDispatcher
level. Application
that runs on specific class loader will only need to register beforehand with TreeCache the class loader
needed under the specific fqn
region. Note again that this marshalling policy is region based.
Anything that falls under that region will use the registered class loader. We also handle the region conflict
during registeration time as well. For fqn
that does
not belong to any region, the default (system) class loader will be used.
Field Summary | |
---|---|
protected boolean |
defaultInactive_
|
protected RegionManager |
manager_
|
Constructor Summary | |
---|---|
TreeCacheMarshaller(RegionManager manager,
boolean defaultInactive)
|
Method Summary | |
---|---|
void |
activate(java.lang.String fqn)
Activates unmarshalling of replication messages for the region rooted in the given Fqn. |
protected java.lang.String |
extractFqn(org.jgroups.blocks.MethodCall method_call)
|
protected java.lang.String |
extractFqnFromListOfMethodCall(org.jgroups.blocks.MethodCall call)
This is "replicate" call with a list of MethodCall argument. |
protected java.lang.String |
extractFqnFromMethodCall(org.jgroups.blocks.MethodCall call)
This is "replicate" call with a single MethodCall argument. |
java.lang.ClassLoader |
getClassLoader(java.lang.String fqn)
Gets the classloader previously registered for fqn by
a call to registerClassLoader(String, ClassLoader) . |
void |
inactivate(java.lang.String fqn)
Disables unmarshalling of replication messages for the region rooted in the given Fqn. |
boolean |
isInactive(java.lang.String fqn)
Gets whether unmarshalling has been disabled for the region rooted in the given Fqn. |
java.lang.Object |
objectFromByteBuffer(byte[] bytes)
This is the un-marshalling step. |
byte[] |
objectToByteBuffer(java.lang.Object o)
Idea is to write specific fqn information in the header such that during unm-marshalling we know which class loader to use. |
void |
registerClassLoader(java.lang.String fqn,
java.lang.ClassLoader cl)
Register the specific classloader under the fqn region. |
void |
unregisterClassLoader(java.lang.String fqn)
Un-register the class loader. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected RegionManager manager_
protected boolean defaultInactive_
Constructor Detail |
---|
public TreeCacheMarshaller(RegionManager manager, boolean defaultInactive)
Method Detail |
---|
public void registerClassLoader(java.lang.String fqn, java.lang.ClassLoader cl) throws RegionNameConflictException
fqn
region.
fqn
- cl
-
RegionNameConflictException
- thrown if there is a conflict in region definition.public void unregisterClassLoader(java.lang.String fqn) throws RegionNotFoundException
fqn
-
RegionNotFoundException
public java.lang.ClassLoader getClassLoader(java.lang.String fqn) throws RegionNotFoundException
fqn
by
a call to registerClassLoader(String, ClassLoader)
.
fqn
- the fqn
fqn
, or null
if no classloader has
been associated with the region.
RegionNotFoundException
public void activate(java.lang.String fqn) throws RegionNameConflictException
fqn
-
RegionNameConflictException
public void inactivate(java.lang.String fqn) throws RegionNameConflictException
fqn
-
RegionNameConflictException
- if there is a conflict in region definition.public boolean isInactive(java.lang.String fqn)
fqn
-
true
if unmarshalling is disabled;
false
otherwise.activate(java.lang.String)
,
inactivate(java.lang.String)
public byte[] objectToByteBuffer(java.lang.Object o) throws java.lang.Exception
objectToByteBuffer
in interface org.jgroups.blocks.RpcDispatcher.Marshaller
o
-
java.lang.Exception
public java.lang.Object objectFromByteBuffer(byte[] bytes) throws java.lang.Exception
objectFromByteBuffer
in interface org.jgroups.blocks.RpcDispatcher.Marshaller
bytes
-
java.lang.Exception
protected java.lang.String extractFqnFromMethodCall(org.jgroups.blocks.MethodCall call)
call
-
protected java.lang.String extractFqnFromListOfMethodCall(org.jgroups.blocks.MethodCall call)
call
-
protected java.lang.String extractFqn(org.jgroups.blocks.MethodCall method_call)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |