@@ -0,0 +1,2009 @@
+package com.radiadesign.catalina.session;%0A%0Aimport com.esotericsoftware.kryo.Kryo;%0Aimport com.esotericsoftware.kryo.io.Input;%0Aimport com.esotericsoftware.kryo.io.Output;%0Aimport com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer;%0Aimport org.objenesis.strategy.SerializingInstantiatorStrategy;%0A%0Aimport java.io.ByteArrayInputStream;%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.IOException;%0A%0Apublic class XstreamSerializer implements Serializer  %7B%0A    private ClassLoader classLoader;%0A%0A    @Override%0A    public void setClassLoader(ClassLoader classLoader) %7B%0A        this.classLoader = classLoader;%0A    %7D%0A%0A    @Override%0A    public byte%5B%5D serialize(RedisSession redisSession) throws IOException %7B%0A        final Kryo kryo = getKryo();%0A        final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();%0A        final Output output = new Output(byteArrayOutputStream);%0A        //kryo.writeObject(output, redisSession.getCreationTime());%0A        kryo.writeObject(output, redisSession);%0A        output.close();%0A%0A        return byteArrayOutputStream.toByteArray();%0A    %7D%0A%0A    @Override%0A    public RedisSession deserialize(byte%5B%5D data, RedisSessionManager redisSessionManager) throws IOException, ClassNotFoundException %7B%0A        final Kryo kryo = getKryo();%0A        final Input input = new Input(new ByteArrayInputStream(data));%0A        //redisSession.setCreationTime(kryo.readObject(input, long.class));%0A        RedisSession redisSession = kryo.readObject(input, RedisSession.class);%0A        redisSession.setManager(redisSessionManager);%0A        redisSession.setCreationTime(redisSession.getCreationTimeInternal());%0A%0A        return redisSession;%0A    %7D%0A%0A    private Kryo getKryo() %7B%0A        Kryo kryo = new Kryo();%0A        kryo.setInstantiatorStrategy(new SerializingInstantiatorStrategy());%0A        kryo.setClassLoader(classLoader);%0A        kryo.setDefaultSerializer(CompatibleFieldSerializer.class);%0A        kryo.register(RedisSession.class, 32);%0A        return kryo;%0A    %7D%0A%7D%0A

Add XStream serializer