GenericSingleClassLoaderSofaSerializerFactory extends SingleClassLoaderSofaSerializerFactory { @Override public Deserializer getDeserializer(String type) throws HessianProtocolException { if (StringUtils.isEmpty(type) || ClassFilter.filterExcludeClass(type)) { return super.getDeserializer(type); } if (type.charAt(0) == ARRAY_PREFIX && ClassFilter.arrayFilter(type)) { return super.getDeserializer(type); } Deserializer deserializer = DESERIALIZER_MAP.get(type); if (deserializer != null) { return deserializer; } if (ClassFilter.CLASS_NAME.equals(type)) { deserializer = GenericClassDeserializer.getInstance(); } else { deserializer = new GenericDeserializer(type); } DESERIALIZER_MAP.putIfAbsent(type, deserializer); return deserializer; }  @Override Serializer getSerializer(Class cl); @Override Deserializer getDeserializer(String type);  }
@Test public void getDeserializer() throws Exception { Assert.assertEquals(GenericClassDeserializer.class, factory.getDeserializer(Class.class.getCanonicalName()).getClass()); Assert.assertEquals(GenericDeserializer.class, factory.getDeserializer(GenericObject.class.getCanonicalName()).getClass()); }