Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2819dc6
commit 0cf3fc0
Showing
5 changed files
with
59 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...c/main/java/org/wicketstuff/pageserializer/kryo2/inspecting/InspectionKryoSerializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.wicketstuff.pageserializer.kryo2.inspecting; | ||
|
||
import org.apache.wicket.util.lang.Bytes; | ||
import org.wicketstuff.pageserializer.kryo2.KryoSerializer; | ||
|
||
import com.esotericsoftware.kryo.Kryo; | ||
|
||
public class InspectionKryoSerializer extends KryoSerializer { | ||
|
||
private final ISerializationListener serializingListener; | ||
|
||
public InspectionKryoSerializer(Bytes size, ISerializationListener serializingListener) { | ||
super(size); | ||
this.serializingListener = serializingListener; | ||
} | ||
|
||
@Override | ||
protected Kryo createKryo() { | ||
return new InspectingKryo(this); | ||
} | ||
|
||
@Override | ||
public byte[] serialize(Object object) { | ||
try { | ||
serializingListener.start(object); | ||
return super.serialize(object); | ||
} finally { | ||
serializingListener.end(object); | ||
} | ||
} | ||
|
||
protected final ISerializationListener serializingListener() { | ||
return serializingListener; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters