1
2
3
4
5
6
7
8
9
10
11
12
13
14 package ch.qos.logback.access.common.net;
15
16 import java.io.Serializable;
17
18 import ch.qos.logback.access.common.spi.AccessEvent;
19 import ch.qos.logback.access.common.spi.IAccessEvent;
20 import ch.qos.logback.core.spi.PreSerializationTransformer;
21
22 public class AccessEventPreSerializationTransformer implements PreSerializationTransformer<IAccessEvent> {
23
24 @Override
25 public Serializable transform(IAccessEvent event) {
26 if (event instanceof AccessEvent) {
27 return (AccessEvent) event;
28 } else {
29 throw new IllegalArgumentException("Unsupported type " + event.getClass().getName());
30 }
31 }
32
33 }