CodeBeamer 5.4.0.1-RC API

com.intland.codebeamer.remoting
Class DecoratorSerializerFactory

java.lang.Object
  extended by com.caucho.hessian.io.AbstractSerializerFactory
      extended by com.caucho.hessian.io.SerializerFactory
          extended by com.intland.codebeamer.remoting.DecoratorSerializerFactory
Direct Known Subclasses:
RemoteServiceSerializerFactory

public class DecoratorSerializerFactory
extends com.caucho.hessian.io.SerializerFactory

Hessian SerializerFactory which delegates all tasks to an other factory, but for a certain class (and its subclasses) allows to alter the instances of the class before-serialization and after-deserialization


Nested Class Summary
 class DecoratorSerializerFactory.SerializerProxy
           
 
Field Summary
 
Fields inherited from class com.caucho.hessian.io.SerializerFactory
_collectionSerializer, _defaultSerializer, _factories, _mapSerializer
 
Constructor Summary
DecoratorSerializerFactory(com.caucho.hessian.io.SerializerFactory delegate, java.lang.Class<?> targetClass)
          Factory delegate all task to an other factory, and only accepts a certain class and its subclasses.
 
Method Summary
 void addClass(java.lang.Class<?> targetClass)
           
protected  java.lang.Object beforeSerialization(java.lang.Object obj)
          Allows to change/touch the object before serialization
 com.caucho.hessian.io.Deserializer getDeserializer(java.lang.Class clazz)
           
 com.caucho.hessian.io.Serializer getSerializer(java.lang.Class clazz)
           
protected  boolean isApplicable(java.lang.Class<?> clazz)
          Decide if this serializer is applicable for a given class
 
Methods inherited from class com.caucho.hessian.io.SerializerFactory
addFactory, getDefaultDeserializer, getDefaultSerializer, getDeserializer, getObjectDeserializer, getObjectDeserializer, isAllowNonSerializable, readList, readMap, readObject, setAllowNonSerializable, setSendCollectionType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecoratorSerializerFactory

public DecoratorSerializerFactory(com.caucho.hessian.io.SerializerFactory delegate,
                                  java.lang.Class<?> targetClass)
Factory delegate all task to an other factory, and only accepts a certain class and its subclasses.

Parameters:
delegate - The delegate factory
targetClass - The target class handled by this factory
Method Detail

addClass

public void addClass(java.lang.Class<?> targetClass)

isApplicable

protected boolean isApplicable(java.lang.Class<?> clazz)
Decide if this serializer is applicable for a given class

Parameters:
clazz -
Returns:
If it is applicable

getSerializer

public com.caucho.hessian.io.Serializer getSerializer(java.lang.Class clazz)
                                               throws com.caucho.hessian.io.HessianProtocolException
Overrides:
getSerializer in class com.caucho.hessian.io.SerializerFactory
Throws:
com.caucho.hessian.io.HessianProtocolException

getDeserializer

public com.caucho.hessian.io.Deserializer getDeserializer(java.lang.Class clazz)
                                                   throws com.caucho.hessian.io.HessianProtocolException
Overrides:
getDeserializer in class com.caucho.hessian.io.SerializerFactory
Throws:
com.caucho.hessian.io.HessianProtocolException

beforeSerialization

protected java.lang.Object beforeSerialization(java.lang.Object obj)
                                        throws java.lang.Exception
Allows to change/touch the object before serialization

Parameters:
obj - The object would be serialized
Returns:
The same or altered/replaced object which actually gets serialized
Throws:
java.lang.Exception

CodeBeamer 5.4.0.1-RC API

Copyright © 2006-2009 Intland Software. All rights reserved.