KickJava   Java API By Example, From Geeks To Geeks.

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


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

5 package com.tc.net.protocol.tcm;
6
7 import com.tc.async.api.Sink;
8 import com.tc.config.schema.dynamic.ConfigItem;
9 import com.tc.net.TCSocketAddress;
10 import com.tc.net.core.TCConnectionManager;
11 import com.tc.net.protocol.transport.ConnectionIDFactory;
12 import com.tc.object.session.SessionProvider;
13
14 /**
15  * CommsMgr provides Listener and Channel endpoints for exchanging <code>TCMessage</code> type messages
16  */

17 public interface CommunicationsManager {
18   public TCConnectionManager getConnectionManager();
19
20   public void shutdown();
21
22   public boolean isInShutdown();
23
24   public NetworkListener[] getAllListeners();
25
26   /**
27    * Creates a client message channel to the given host/port.
28    *
29    * @param maxReconnectTries The number of times the channel will attempt to reestablish communications with the server
30    * if the connection is lost. If n==0, the channel will not attempt to reestablish communications. If n>0, the
31    * channel will attempt to reestablish communications n times. If n<0 the channel will always try to
32    * reestablish communications.
33    * @param hostname The hostname to connect to.
34    * @param port The remote port to connect to.
35    * @param timeout The maximum time (in milliseconds) to wait for the underlying connection to be established before
36    * giving up.
37    */

38   public ClientMessageChannel createClientChannel(SessionProvider sessionProvider, int maxReconnectTries,
39                                                   String JavaDoc hostname, int port, int timeout,
40                                                   ConfigItem connectionInfoSource);
41
42   public NetworkListener createListener(SessionProvider sessionProvider, TCSocketAddress addr,
43                                         boolean transportDisconnectRemovesChannel,
44                                         ConnectionIDFactory connectionIdFactory);
45
46   public NetworkListener createListener(SessionProvider sessionProvider, TCSocketAddress addr,
47                                         boolean transportDisconnectRemovesChannel,
48                                         ConnectionIDFactory connectionIdFactory, boolean reuseAddress);
49
50   public NetworkListener createListener(SessionProvider sessionProvider, TCSocketAddress address,
51                                         boolean transportDisconnectRemovesChannel,
52                                         ConnectionIDFactory connectionIDFactory, Sink httpSink);
53 }
Popular Tags