org.jboss.cache.marshall
Class Marshaller

java.lang.Object
  extended by org.jboss.cache.marshall.Marshaller
Direct Known Subclasses:
LegacyTreeCacheMarshaller, TreeCacheMarshaller140

public abstract class Marshaller
extends java.lang.Object

Abstract Marshaller for JBoss Cache.

Author:
Manik Surtani (manik@jboss.org)

Field Summary
protected  boolean defaultInactive
           
protected  RegionManager regionManager
           
protected  boolean useRegionBasedMarshalling
           
 
Constructor Summary
Marshaller()
           
 
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(JBCMethodCall methodCall)
           
protected  java.lang.String extractFqnFromListOfMethodCall(JBCMethodCall call)
          This is "replicate" call with a list of MethodCall argument.
protected  java.lang.String extractFqnFromMethodCall(JBCMethodCall 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).
protected  Region getRegion(java.lang.String fqnString)
           
 void inactivate(java.lang.String fqn)
          Disables unmarshalling of replication messages for the region rooted in the given Fqn.
protected  void init(RegionManager manager, boolean defaultInactive, boolean useRegionBasedMarshalling)
           
 boolean isInactive(java.lang.String fqn)
          Gets whether unmarshalling has been disabled for the region rooted in the given Fqn.
abstract  java.lang.Object objectFromStream(java.io.ObjectInputStream in)
          Implementation classes will need to parse the given stream and create an object from it.
abstract  void objectToStream(java.lang.Object obj, java.io.ObjectOutputStream out)
          Implementation classes will need to marshall the object passed in and write the object into the given stream.
 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

useRegionBasedMarshalling

protected boolean useRegionBasedMarshalling

regionManager

protected RegionManager regionManager

defaultInactive

protected boolean defaultInactive
Constructor Detail

Marshaller

public Marshaller()
Method Detail

init

protected void init(RegionManager manager,
                    boolean defaultInactive,
                    boolean useRegionBasedMarshalling)

objectToStream

public abstract void objectToStream(java.lang.Object obj,
                                    java.io.ObjectOutputStream out)
                             throws java.lang.Exception
Implementation classes will need to marshall the object passed in and write the object into the given stream.

Parameters:
obj -
out -
Throws:
java.lang.Exception

objectFromStream

public abstract java.lang.Object objectFromStream(java.io.ObjectInputStream in)
                                           throws java.lang.Exception
Implementation classes will need to parse the given stream and create an object from it.

Parameters:
in -
Throws:
java.lang.Exception

extractFqnFromMethodCall

protected java.lang.String extractFqnFromMethodCall(JBCMethodCall call)
This is "replicate" call with a single MethodCall argument.

Parameters:
call -

extractFqnFromListOfMethodCall

protected java.lang.String extractFqnFromListOfMethodCall(JBCMethodCall call)
This is "replicate" call with a list of MethodCall argument.

Parameters:
call -

extractFqn

protected java.lang.String extractFqn(JBCMethodCall methodCall)

getRegion

protected Region getRegion(java.lang.String fqnString)

registerClassLoader

public void registerClassLoader(java.lang.String fqn,
                                java.lang.ClassLoader cl)
                         throws RegionNameConflictException
Register the specific classloader under the fqn region.

Parameters:
fqn -
cl -
Throws:
RegionNameConflictException - thrown if there is a conflict in region definition.

unregisterClassLoader

public void unregisterClassLoader(java.lang.String fqn)
                           throws RegionNotFoundException
Un-register the class loader. Caller will need to call this when the application is out of scope. Otherwise, the class loader will not get gc.

Parameters:
fqn -
Throws:
RegionNotFoundException

getClassLoader

public java.lang.ClassLoader getClassLoader(java.lang.String fqn)
                                     throws RegionNotFoundException
Gets the classloader previously registered for fqn by a call to registerClassLoader(String, ClassLoader).

Parameters:
fqn - the fqn
Returns:
the classloader associated with the cache region rooted by fqn, or null if no classloader has been associated with the region.
Throws:
RegionNotFoundException

activate

public void activate(java.lang.String fqn)
              throws RegionNameConflictException
Activates unmarshalling of replication messages for the region rooted in the given Fqn.

Parameters:
fqn -
Throws:
RegionNameConflictException

inactivate

public void inactivate(java.lang.String fqn)
                throws RegionNameConflictException
Disables unmarshalling of replication messages for the region rooted in the given Fqn.

Parameters:
fqn -
Throws:
RegionNameConflictException - if there is a conflict in region definition.

isInactive

public boolean isInactive(java.lang.String fqn)
Gets whether unmarshalling has been disabled for the region rooted in the given Fqn.

Parameters:
fqn -
Returns:
true if unmarshalling is disabled; false otherwise.
See Also:
activate(java.lang.String), inactivate(java.lang.String)


Copyright 1998-2005 JBoss Inc . All Rights Reserved.