Search in sources :

Example 1 with SerializerAdapter

use of com.hazelcast.internal.serialization.impl.SerializerAdapter in project hazelcast by hazelcast.

the class DelegatingSerializationService method serializerFor.

@Override
public SerializerAdapter serializerFor(Object object, boolean includeSchema) {
    Class<?> clazz = object == null ? null : object.getClass();
    SerializerAdapter serializer = null;
    if (clazz != null) {
        serializer = serializersByClass.get(clazz);
    }
    if (serializer == null) {
        try {
            serializer = delegate.serializerFor(object, includeSchema);
        } catch (HazelcastSerializationException hse) {
            throw serializationException(clazz, hse);
        }
    }
    if (serializer == null) {
        throw active ? serializationException(clazz) : new HazelcastInstanceNotActiveException();
    }
    return serializer;
}
Also used : HazelcastInstanceNotActiveException(com.hazelcast.core.HazelcastInstanceNotActiveException) HazelcastSerializationException(com.hazelcast.nio.serialization.HazelcastSerializationException) SerializationUtil.createSerializerAdapter(com.hazelcast.internal.serialization.impl.SerializationUtil.createSerializerAdapter) SerializerAdapter(com.hazelcast.internal.serialization.impl.SerializerAdapter)

Aggregations

HazelcastInstanceNotActiveException (com.hazelcast.core.HazelcastInstanceNotActiveException)1 SerializationUtil.createSerializerAdapter (com.hazelcast.internal.serialization.impl.SerializationUtil.createSerializerAdapter)1 SerializerAdapter (com.hazelcast.internal.serialization.impl.SerializerAdapter)1 HazelcastSerializationException (com.hazelcast.nio.serialization.HazelcastSerializationException)1