1 4 package com.tc.net.protocol.tcm; 5 6 public class ChannelEventType { 7 public static final ChannelEventType TRANSPORT_DISCONNECTED_EVENT = new ChannelEventType("TRANSPORT_DISCONNCTED_EVENT"); 8 public static final ChannelEventType TRANSPORT_CONNECTED_EVENT = new ChannelEventType("TRANSPORT_CONNECTED_EVENT"); 9 public static final ChannelEventType CHANNEL_CLOSED_EVENT = new ChannelEventType("CHANNEL_CLOSED_EVENT"); 10 public static final ChannelEventType CHANNEL_OPENED_EVENT = new ChannelEventType("CHANNEL_OPENED_EVENT"); 11 12 private final String name; 13 14 private ChannelEventType(String name) { 15 this.name = name; 16 } 17 18 public boolean matches(ChannelEvent event) { 19 return event == null ? false : event.getType() == this; 20 } 21 22 public String toString() { 23 return name; 24 } 25 } | Popular Tags |