org.openbp.config.context.StandardContextObjectSerializerConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openbp-server Show documentation
Show all versions of openbp-server Show documentation
The OpenBP process engine (main module)
package org.openbp.config.context;
import org.openbp.server.context.serializer.ContextObjectSerializer;
import org.openbp.server.context.serializer.ContextObjectSerializerRegistry;
import org.openbp.server.context.serializer.JavaSerializationContextObjectSerializer;
import org.openbp.server.context.serializer.PersistenceContextObjectSerializer;
import org.openbp.server.context.serializer.XStreamContextObjectSerializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Spring token context serializer configuration supporting serialization of entities, serialization using x-stream and regular Java serialization.
*/
@Configuration
public class StandardContextObjectSerializerConfig
{
@Bean
public ContextObjectSerializerRegistry contextObjectSerializerRegistry()
{
// Note that we may we must define the serializers below as beans in order to make them @autowire-capable
ContextObjectSerializerRegistry registry = new ContextObjectSerializerRegistry();
registry.addSerializer(persistenceContextObjectSerializer());
registry.addSerializer(xStreamContextObjectSerializer());
registry.addSerializer(javaSerializationContextObjectSerializer());
return registry;
}
@Bean
public ContextObjectSerializer persistenceContextObjectSerializer()
{
return new PersistenceContextObjectSerializer();
}
@Bean
public ContextObjectSerializer xStreamContextObjectSerializer()
{
return new XStreamContextObjectSerializer();
}
@Bean
public ContextObjectSerializer javaSerializationContextObjectSerializer()
{
return new JavaSerializationContextObjectSerializer();
}
}