public class ComponentSerializerFactory extends java.lang.Object implements SerializerFactory
KryoCustomization that creates a ReferenceFieldSerializerReflectionFactorySupport as
serializer for subclasses of Component. This is required, as the Component
constructor invokes Application.get() to tell the application
to org.apache.wicket.Application#notifyComponentInstantiationListeners(). This will
lead to NullpointerExceptions if the application is not yet bound to the current thread
because the session is e.g. accessed from within a servlet filter. If the component is created
via the constructor for serialization, this problem does not occur.| Constructor and Description |
|---|
ComponentSerializerFactory(com.esotericsoftware.kryo.Kryo kryo) |
| Modifier and Type | Method and Description |
|---|---|
com.esotericsoftware.kryo.Serializer |
newSerializer(java.lang.Class<?> type)
Returns a serializer for the specified type or
null if the type is not supported
by this factory. |
public ComponentSerializerFactory(com.esotericsoftware.kryo.Kryo kryo)
public com.esotericsoftware.kryo.Serializer newSerializer(java.lang.Class<?> type)
SerializerFactorynull if the type is not supported
by this factory.newSerializer in interface SerializerFactorytype - the type a serializer shall be created for.Serializer implementation or null.Copyright © 2009-2014. All Rights Reserved.