Class RegistrationNotRequiredKryoContextResolver

java.lang.Object
org.glassfish.jersey.kryo.internal.RegistrationNotRequiredKryoContextResolver
All Implemented Interfaces:
ContextResolver<com.esotericsoftware.kryo.Kryo>

public class RegistrationNotRequiredKryoContextResolver extends Object implements ContextResolver<com.esotericsoftware.kryo.Kryo>
Backwards compatibility ContextResolver. It should only be used when the user specifically agrees on a vulnerability provided when the KryoFeature#registrationRequired(false) is used. The default behaviour is demanded to require ContextResolver with
 public Kryo getContext(Class<?> type) {
      ...
      Kryo kryo = new Kryo();
      kryo.setRegistrationRequired(true);
      kryo.register(The_class_for_which_the_KryoMessageBodyProvider_should_be_allowed);
      ...
      return kryo;
 }
 
  • Constructor Details

    • RegistrationNotRequiredKryoContextResolver

      public RegistrationNotRequiredKryoContextResolver()
  • Method Details

    • getContext

      public com.esotericsoftware.kryo.Kryo getContext(Class<?> type)
      Specified by:
      getContext in interface ContextResolver<com.esotericsoftware.kryo.Kryo>