Search in sources :

Example 1 with AbstractJacksonBackedStringSerializer

use of org.apereo.cas.util.serialization.AbstractJacksonBackedStringSerializer in project cas by apereo.

the class JmsTicketRegistryConfiguration method jacksonJmsMessageConverter.

@Bean
public MessageConverter jacksonJmsMessageConverter() {
    final MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
    converter.setTargetType(MessageType.TEXT);
    converter.setTypeIdPropertyName("_type");
    new AbstractJacksonBackedStringSerializer<Object>() {

        private static final long serialVersionUID = 1466569521275630254L;

        @Override
        protected Class getTypeToSerialize() {
            return Object.class;
        }

        @Override
        protected ObjectMapper initializeObjectMapper() {
            final ObjectMapper mapper = super.initializeObjectMapper();
            converter.setObjectMapper(mapper);
            return mapper;
        }
    };
    return converter;
}
Also used : MappingJackson2MessageConverter(org.springframework.jms.support.converter.MappingJackson2MessageConverter) AbstractJacksonBackedStringSerializer(org.apereo.cas.util.serialization.AbstractJacksonBackedStringSerializer) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) StringBean(org.apereo.cas.StringBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 StringBean (org.apereo.cas.StringBean)1 AbstractJacksonBackedStringSerializer (org.apereo.cas.util.serialization.AbstractJacksonBackedStringSerializer)1 Bean (org.springframework.context.annotation.Bean)1 MappingJackson2MessageConverter (org.springframework.jms.support.converter.MappingJackson2MessageConverter)1