Package org.glassfish.jersey.kryo
Class KryoFeature
- java.lang.Object
-
- org.glassfish.jersey.kryo.KryoFeature
-
- All Implemented Interfaces:
Feature
@Beta public class KryoFeature extends Object implements Feature
Feature used to register Kryo providers.
For the security reasons, Kryo#setRegistrationRequired(true) should be specified. Unless
KryoFeature#registrationRequired(false)is registered, aContextResolver<Kryo>should be registered. There the user is expected to create newKryoinstance with the registrations: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; }Note thatContextResolver#getContextis invoked just once when creatingKryoPooland thetypeargument isnull.- Author:
- Libor Kramolis
-
-
Constructor Summary
Constructors Constructor Description KryoFeature()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanconfigure(FeatureContext context)static KryoFeatureregistrationRequired(boolean registrationRequired)
-
-
-
Method Detail
-
registrationRequired
public static KryoFeature registrationRequired(boolean registrationRequired)
-
configure
public boolean configure(FeatureContext context)
-
-