1 19 20 package org.apache.cayenne.remote.hessian; 21 22 import org.apache.cayenne.util.Util; 23 24 import com.caucho.hessian.io.AbstractSerializerFactory; 25 import com.caucho.hessian.io.Deserializer; 26 import com.caucho.hessian.io.HessianProtocolException; 27 import com.caucho.hessian.io.Serializer; 28 29 36 public class EnumSerializerProxy extends AbstractSerializerFactory { 37 38 static final String FACTORY_CLASS = "org.apache.cayenne.remote.hessian.EnumSerializerFactory"; 39 40 private AbstractSerializerFactory enumSerializer; 41 42 public EnumSerializerProxy() { 43 try { 44 Class.forName("java.lang.StringBuilder"); 46 47 Class factoryClass = Util.getJavaClass(FACTORY_CLASS); 48 this.enumSerializer = (AbstractSerializerFactory) factoryClass.newInstance(); 49 } 50 catch (Throwable th) { 51 } 53 } 54 55 public Serializer getSerializer(Class cl) throws HessianProtocolException { 56 return enumSerializer != null ? enumSerializer.getSerializer(cl) : null; 57 } 58 59 public Deserializer getDeserializer(Class cl) throws HessianProtocolException { 60 return enumSerializer != null ? enumSerializer.getDeserializer(cl) : null; 61 } 62 } 63 | Popular Tags |