KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > objectserver > persistence > sleepycat > CustomSerializationAdapterFactory


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.objectserver.persistence.sleepycat;
5
6 import com.sleepycat.bind.serial.ClassCatalog;
7 import com.tc.io.serializer.impl.StringUTFSerializer;
8 import com.tc.objectserver.managedobject.ManagedObjectSerializer;
9 import com.tc.objectserver.managedobject.ManagedObjectStateSerializer;
10
11 public class CustomSerializationAdapterFactory implements SerializationAdapterFactory {
12
13   public SerializationAdapter newAdapter(ClassCatalog classCatalog) {
14     ManagedObjectStateSerializer stateSerializer = new ManagedObjectStateSerializer();
15     ManagedObjectSerializer moSerializer = new ManagedObjectSerializer(stateSerializer);
16     StringUTFSerializer stringSerializer = new StringUTFSerializer();
17     return new CustomSerializationAdapter(moSerializer, stringSerializer);
18   }
19 }
20
Popular Tags