Skip to content

Commit

Permalink
序列化部分重构,因此Memcached部分的序列化使用部分需要修改。
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellitoc committed Apr 25, 2014
1 parent 4d1dc64 commit 5c23c48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 53 deletions.
16 changes: 4 additions & 12 deletions src/main/resources/applicationContext-service-captcha-base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,27 +96,19 @@
<bean class="net.rubyeye.xmemcached.impl.KetamaMemcachedSessionLocator" />
</property>
<!-- Serializing transcoder -->
<property name="transcoder">
<ref bean="serializingTranscoder"/>
</property>
<property name="transcoder" ref="serializingTranscoder" />
<!-- ByteBuffer allocator -->
<property name="bufferAllocator">
<bean class="net.rubyeye.xmemcached.buffer.SimpleBufferAllocator" />
</property>
<!-- Failure mode -->
<property name="failureMode" value="true" />
</bean>

<bean id="serializingTranscoder" class="org.danielli.xultimate.context.kvStore.memcached.xmemcached.SerializingTranscoder"
p:compressionThreshold="1024"
p:booleanSerializer-ref="booleanSerializer"
p:byteSerializer-ref="byteSerializer"
p:dateSerializer-ref="dateSerializer"
p:doubleSerializer-ref="doubleSerializer"
p:floatSerializer-ref="floatSerializer"
p:integerSerializer-ref="integerSerializer"
p:longSerializer-ref="longSerializer"
p:rpcSerializer-ref="rpcSerializer"
p:stringSerializer-ref="stringSerializer" />
p:baseTypeDeserializer-ref="rpcProtostuffDeserializerProxy"
p:baseTypeSerializer-ref="rpcProtostuffSerializerProxy" />

<bean id="memcachedClient" factory-bean="memcachedClientBuilder" factory-method="build" destroy-method="shutdown" />
<bean id="xmemcachedTemplate" class="org.danielli.xultimate.context.kvStore.memcached.xmemcached.support.XMemcachedTemplate" p:memcachedClient-ref="memcachedClient" />
Expand Down
44 changes: 3 additions & 41 deletions src/main/resources/applicationContext-service-serializer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,47 +27,9 @@
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

<util:list id="notSupportClassType" >
<value>java.util.Collection</value>
<value>java.util.Map</value>
</util:list>
<bean id="defaultClassTypeNotSupporter" class="org.danielli.xultimate.core.support.DefaultClassTypeNotSupporter" p:notSupportClassTypes-ref="notSupportClassType" />
<bean id="stringSerializer" class="org.danielli.xultimate.core.serializer.java.StringSerializer" />
<bean id="longSerializer" class="org.danielli.xultimate.core.serializer.java.LongSerializer" />
<bean id="integerSerializer" class="org.danielli.xultimate.core.serializer.java.IntegerSerializer" />
<bean id="booleanSerializer" class="org.danielli.xultimate.core.serializer.java.BooleanSerializer" />
<bean id="dateSerializer" class="org.danielli.xultimate.core.serializer.java.DateSerializer" />
<bean id="byteSerializer" class="org.danielli.xultimate.core.serializer.java.ByteSerializer" />
<bean id="floatSerializer" class="org.danielli.xultimate.core.serializer.java.FloatSerializer" />
<bean id="doubleSerializer" class="org.danielli.xultimate.core.serializer.java.DoubleSerializer" />
<bean id="mainProtobufSerializer" class="org.danielli.xultimate.core.serializer.protostuff.MainProtobufSerializer" p:classTypeSupporter-ref="defaultClassTypeNotSupporter" />
<bean id="rpcSerializer" class="org.danielli.xultimate.core.serializer.protostuff.RpcProtobufSerializer" />
<util:list id="serializers1">
<ref bean="stringSerializer" />
<ref bean="longSerializer" />
<ref bean="integerSerializer" />
<ref bean="booleanSerializer" />
<ref bean="dateSerializer" />
<ref bean="byteSerializer" />
<ref bean="floatSerializer" />
<ref bean="doubleSerializer" />
<ref bean="mainProtobufSerializer"/>
<ref bean="rpcSerializer"/>
</util:list>
<util:list id="deserializers1">
<ref bean="stringSerializer" />
<ref bean="booleanSerializer" />
<ref bean="integerSerializer" />
<ref bean="longSerializer" />
<ref bean="byteSerializer" />
<ref bean="floatSerializer" />
<ref bean="doubleSerializer" />
<ref bean="dateSerializer" />
<ref bean="mainProtobufSerializer"/>
<ref bean="rpcSerializer"/>
</util:list>
<bean id="protobufSerializer" class="org.danielli.xultimate.core.serializer.support.SerializerFactory" p:serializers-ref="serializers1" />
<bean id="protobufDeserializer" class="org.danielli.xultimate.core.serializer.support.DeserializerFactory" p:deserializers-ref="deserializers1" />
<bean id="rpcProtostuffSerializer" class="org.danielli.xultimate.core.serializer.protostuff.RpcProtostuffSerializer" />
<bean id="rpcProtostuffSerializerProxy" class="org.danielli.xultimate.core.serializer.support.BaseTypeSerializer" p:checkKnownType="false" p:exportKnownTypeToOutputStream="false" p:packZerosWithoutOutputStream="true" p:serializer-ref="rpcProtostuffSerializer" />
<bean id="rpcProtostuffDeserializerProxy" class="org.danielli.xultimate.core.serializer.support.BaseTypeDeserializer" p:checkKnownType="false" p:importKnownTypeFromInputStream="false" p:deserializer-ref="rpcProtostuffSerializer" />

<bean id="fastJsonTemplate" class="org.danielli.xultimate.core.json.fastjson.FastJSONTemplate" />
</beans>

0 comments on commit 5c23c48

Please sign in to comment.