1 4 package com.tc.net.protocol.tcm; 5 6 import com.tc.net.MaxConnectionsExceededException; 7 import com.tc.net.TCSocketAddress; 8 import com.tc.net.protocol.NetworkStackID; 9 import com.tc.net.protocol.TCNetworkMessage; 10 import com.tc.util.TCTimeoutException; 11 12 import java.io.IOException ; 13 import java.net.UnknownHostException ; 14 15 21 public interface MessageChannel { 22 23 public TCSocketAddress getLocalAddress(); 24 25 public TCSocketAddress getRemoteAddress(); 26 27 public void addListener(ChannelEventListener listener); 28 29 public ChannelID getChannelID(); 30 31 public boolean isOpen(); 32 33 public boolean isClosed(); 34 35 public TCMessage createMessage(TCMessageType type); 36 37 public Object getAttachment(String key); 38 39 46 public void addAttachment(String key, Object value, boolean replace); 47 48 53 public Object removeAttachment(String key); 54 55 public boolean isConnected(); 59 60 public void send(TCNetworkMessage message); 61 62 public NetworkStackID open() throws MaxConnectionsExceededException, TCTimeoutException, UnknownHostException , 63 IOException ; 64 65 public void close(); 66 67 } | Popular Tags |