|
21 | 21 | importjava.nio.ByteBuffer; |
22 | 22 |
|
23 | 23 | /** |
24 | | - * Add the index parameter in the {@link #intercept(C1, ByteBuffer)} and |
25 | | - * {@link #intercept(C2, ByteBuffer)}, it indicates the packet index in the session. |
| 24 | + * Add the index parameter in the {@link #intercept(ReqChain, ByteBuffer)} and |
| 25 | + * {@link #intercept(ResChain, ByteBuffer)}, it indicates the packet index in the session. |
26 | 26 | * <p> |
27 | 27 | * The index will be reset when the session finished. |
28 | 28 | * </p> |
29 | 29 | * |
30 | 30 | * @author Megatron King |
31 | 31 | * @since 2018-12-03 21:00 |
32 | 32 | */ |
33 | | -publicabstractclassIndexedInterceptor<ReqextendsRequest,C1extendsAbstractRequestChain<Req, ?extendsInterceptor>, |
34 | | -ResextendsResponse,C2extendsAbstractResponseChain<Res, ?extendsInterceptor>> |
35 | | -implementsInterceptor<Req,C1,Res,C2> { |
| 33 | +publicabstractclassIndexedInterceptor<ReqextendsRequest,ReqChainextendsAbstractRequestChain<Req, ?extendsInterceptor>, |
| 34 | +ResextendsResponse,ResChainextendsAbstractResponseChain<Res, ?extendsInterceptor>> |
| 35 | +implementsInterceptor<Req,ReqChain,Res,ResChain> { |
36 | 36 |
|
37 | 37 | privateintmRequestIndex; |
38 | 38 | privateintmResponseIndex; |
39 | 39 |
|
40 | 40 | /** |
41 | | - * The same like {@link #intercept(C1, ByteBuffer)}. |
| 41 | + * The same like {@link #intercept(ReqChain, ByteBuffer)}. |
42 | 42 | * |
43 | | - * @param chain The request chain, call {@linkplainC1#process(ByteBuffer)} to |
| 43 | + * @param chain The request chain, call {@linkplainReqChain#process(ByteBuffer)} to |
44 | 44 | * delivery the packet. |
45 | 45 | * @param buffer A nio buffer contains the packet data. |
46 | 46 | * @param index The packet index, started from 0. |
47 | 47 | * @throws IOException If an I/O error has occurred. |
48 | 48 | */ |
49 | | -protectedabstractvoidintercept(@NonNullC1chain,@NonNullByteBufferbuffer, |
| 49 | +protectedabstractvoidintercept(@NonNullReqChainchain,@NonNullByteBufferbuffer, |
50 | 50 | intindex)throwsIOException; |
51 | 51 |
|
52 | 52 | /** |
53 | | - * The same like {@link #intercept(C2, ByteBuffer)}. |
| 53 | + * The same like {@link #intercept(ResChain, ByteBuffer)}. |
54 | 54 | * |
55 | | - * @param chain The response chain, call {@linkplainC2#process(ByteBuffer)} to |
| 55 | + * @param chain The response chain, call {@linkplainResChain#process(ByteBuffer)} to |
56 | 56 | * delivery the packet. |
57 | 57 | * @param buffer A nio buffer contains the packet data. |
58 | 58 | * @param index The packet index, started from 0. |
59 | 59 | * @throws IOException If an I/O error has occurred. |
60 | 60 | */ |
61 | | -protectedabstractvoidintercept(@NonNullC2chain,@NonNullByteBufferbuffer, |
| 61 | +protectedabstractvoidintercept(@NonNullResChainchain,@NonNullByteBufferbuffer, |
62 | 62 | intindex)throwsIOException; |
63 | 63 |
|
64 | 64 | @Override |
65 | | -publicfinalvoidintercept(@NonNullC1chain,@NonNullByteBufferbuffer) |
| 65 | +publicfinalvoidintercept(@NonNullReqChainchain,@NonNullByteBufferbuffer) |
66 | 66 | throwsIOException { |
67 | 67 | intercept(chain,buffer,mRequestIndex++); |
68 | 68 | } |
69 | 69 |
|
70 | 70 | @Override |
71 | | -publicfinalvoidintercept(@NonNullC2chain,@NonNullByteBufferbuffer) |
| 71 | +publicfinalvoidintercept(@NonNullResChainchain,@NonNullByteBufferbuffer) |
72 | 72 | throwsIOException { |
73 | 73 | intercept(chain,buffer,mResponseIndex++); |
74 | 74 | } |
|