KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > net > protocol > tcm > ChannelEventImpl


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.net.protocol.tcm;
5
6 import java.util.Date JavaDoc;
7
8 public class ChannelEventImpl implements ChannelEvent {
9
10   private final ChannelEventType type;
11   private final MessageChannel channel;
12   private final Date JavaDoc timestamp;
13
14   ChannelEventImpl(ChannelEventType type, MessageChannel channel) {
15     this.type = type;
16     this.channel = channel;
17     this.timestamp = new Date JavaDoc();
18   }
19
20   public String JavaDoc toString() {
21     return getClass().getName() + "@" + System.identityHashCode(this) + "[type=" + this.type + ", timestamp=" + timestamp + ", channel=undisplayed]";
22   }
23
24   public MessageChannel getChannel() {
25     return channel;
26   }
27
28   public ChannelID getChannelID() {
29     return getChannel().getChannelID();
30   }
31   
32   public Date JavaDoc getTimestamp() {
33     return timestamp;
34   }
35
36   public ChannelEventType getType() {
37     return type;
38   }
39 }
Popular Tags