1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jboss.netty.channel;
17
18 import static org.jboss.netty.channel.Channels.*;
19
20
21
22
23 public class DefaultExceptionEvent implements ExceptionEvent {
24
25 private final Channel channel;
26 private final Throwable cause;
27
28
29
30
31 public DefaultExceptionEvent(Channel channel, Throwable cause) {
32 if (channel == null) {
33 throw new NullPointerException("channel");
34 }
35 if (cause == null) {
36 throw new NullPointerException("cause");
37 }
38 this.channel = channel;
39 this.cause = cause;
40 }
41
42 public Channel getChannel() {
43 return channel;
44 }
45
46 public ChannelFuture getFuture() {
47 return succeededFuture(getChannel());
48 }
49
50 public Throwable getCause() {
51 return cause;
52 }
53
54 @Override
55 public String toString() {
56 return getChannel().toString() + " EXCEPTION: " + cause;
57 }
58 }