本文整理汇总了Java中com.caucho.hessian.io.Deserializer类的典型用法代码示例。如果您正苦于以下问题:Java Deserializer类的具体用法?Java Deserializer怎么用?Java Deserializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Deserializer类属于com.caucho.hessian.io包,在下文中一共展示了Deserializer类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDeserializer
import com.caucho.hessian.io.Deserializer; //导入依赖的package包/类
@Override
public Deserializer getDeserializer(@SuppressWarnings("rawtypes") Class cl) throws HessianProtocolException {
if(BigDecimal.class.isAssignableFrom(cl)) {
return bigDecimalDeserializer;
}
return null;
}
示例2: getDeserializer
import com.caucho.hessian.io.Deserializer; //导入依赖的package包/类
@Override
public Deserializer getDeserializer(@SuppressWarnings("rawtypes") Class cl) throws HessianProtocolException {
if(SoftReference.class.isAssignableFrom(cl)) {
return beanDeserializer;
}
return null;
}
示例3: getDeserializer
import com.caucho.hessian.io.Deserializer; //导入依赖的package包/类
@Override
public Deserializer getDeserializer(@SuppressWarnings("rawtypes") Class cl) throws HessianProtocolException {
if(BigDecimal.class.isAssignableFrom(cl)) {
return BIG_DECIMAL_DESERIALIZER;
}
return null;
}
示例4: getDeserializer
import com.caucho.hessian.io.Deserializer; //导入依赖的package包/类
@Override
public Deserializer getDeserializer(@SuppressWarnings("rawtypes") Class cl) throws HessianProtocolException {
if(WeakReference.class.isAssignableFrom(cl)) {
return beanDeserializer;
}
return null;
}
示例5: getDeserializer
import com.caucho.hessian.io.Deserializer; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public Deserializer getDeserializer(Class cl)throws HessianProtocolException{
if(PersistentCollection.class.isAssignableFrom(cl)){
return new HibernateDeserializer(cl) ;
}
return super.getDeserializer(cl) ;
}
示例6: getDeserializer
import com.caucho.hessian.io.Deserializer; //导入依赖的package包/类
@Override
public Deserializer getDeserializer(Class cls) throws HessianProtocolException {
Deserializer deserializer = null;
if (FaultDetail.class.isAssignableFrom(cls)) {
deserializer = new FaultDetailDeserialiser(cls, transcriptionParams);
}
return deserializer;
}
示例7: getDeserializer
import com.caucho.hessian.io.Deserializer; //导入依赖的package包/类
/**
* Returns a deserializer based on a string type.
*/
public Deserializer getDeserializer(String type)
throws HessianProtocolException
{
if (type == null || type.equals("")) {
return null;
}
if (!transcriptionParams.contains(TranscribableParams.MajorOnlyPackageNaming)) {
// look for vMajor
type = ClassnameCompatibilityMapper.toMajorOnlyPackaging(type);
}
return optimizedGetDeserializer(type);
}
示例8: optimizedGetDeserializer
import com.caucho.hessian.io.Deserializer; //导入依赖的package包/类
/**
* If a Cougar server response contains a class the client doesn't know about (which is legal and backwards compatible
* in cases) then the default behavior of Hessian is to perform a lookup, fail, throw an exception and log it.
* This has been measured at about 25 times slower than the happy path, and Hessian does not negatively cache 'misses',
* so this is a per-response slowdown. This implementation caches type lookup misses, and so eradicates the problem.
*/
private Deserializer optimizedGetDeserializer(String type)
throws HessianProtocolException {
if (missingTypes.contains(type)) {
return null;
}
Deserializer answer = super.getDeserializer(type);
if (answer == null) {
missingTypes.add(type);
}
return answer;
}
示例9: getDeserializer
import com.caucho.hessian.io.Deserializer; //导入依赖的package包/类
@Override
public Deserializer getDeserializer(Class cls) throws HessianProtocolException {
Deserializer deserializer = null;
if (cls != null && TranscribableEnum.class.isAssignableFrom(cls)) {
deserializer = new TranscribableEnumDeserializer(cls, transcriptionParams);
}
return deserializer;
}
示例10: testDeserializerFound
import com.caucho.hessian.io.Deserializer; //导入依赖的package包/类
@Test
public void testDeserializerFound() throws Exception {
CougarSerializerFactory factory = new CougarSerializerFactory(Collections.EMPTY_SET);
Deserializer deserializer = factory.getDeserializer(Integer.class.getName());
assertNotNull(deserializer);
Set<String> missingTypes = factory.getMissingTypes();
assertEquals(0, missingTypes.size());
}
示例11: testNoDeserializerFound
import com.caucho.hessian.io.Deserializer; //导入依赖的package包/类
@Test
public void testNoDeserializerFound() throws Exception {
CougarSerializerFactory factory = new CougarSerializerFactory(Collections.EMPTY_SET);
Deserializer deserializer = factory.getDeserializer(MISSING_TYPE_NAME);
assertNull(deserializer);
Set<String> missingTypes = factory.getMissingTypes();
assertEquals(1, missingTypes.size());
assertTrue(missingTypes.contains(MISSING_TYPE_NAME));
}
示例12: testMissingTypeCacheHit
import com.caucho.hessian.io.Deserializer; //导入依赖的package包/类
@Test
public void testMissingTypeCacheHit() throws Exception {
String presentType = getClass().getName();
CougarSerializerFactory factory = new CougarSerializerFactory(Collections.EMPTY_SET);
Deserializer deserializer = factory.getDeserializer(presentType);
assertNotNull(deserializer);
Set<String> missingTypes = factory.getMissingTypes();
missingTypes.add(presentType);
deserializer = factory.getDeserializer(presentType);
assertNull(deserializer);
}
示例13: addDeserializer
import com.caucho.hessian.io.Deserializer; //导入依赖的package包/类
public static void addDeserializer(Class<?> cl, Deserializer deserializer) {
extFactory.addDeserializer(cl, deserializer);
}