01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.net.protocol.tcm;
05:
06: import java.util.Date;
07:
08: public class ChannelEventImpl implements ChannelEvent {
09:
10: private final ChannelEventType type;
11: private final MessageChannel channel;
12: private final Date timestamp;
13:
14: ChannelEventImpl(ChannelEventType type, MessageChannel channel) {
15: this .type = type;
16: this .channel = channel;
17: this .timestamp = new Date();
18: }
19:
20: public String toString() {
21: return getClass().getName() + "@"
22: + System.identityHashCode(this ) + "[type=" + this .type
23: + ", timestamp=" + timestamp + ", channel=undisplayed]";
24: }
25:
26: public MessageChannel getChannel() {
27: return channel;
28: }
29:
30: public ChannelID getChannelID() {
31: return getChannel().getChannelID();
32: }
33:
34: public Date getTimestamp() {
35: return timestamp;
36: }
37:
38: public ChannelEventType getType() {
39: return type;
40: }
41: }
|