01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.net.protocol.tcm;
06:
07: import com.tc.async.api.Sink;
08: import com.tc.net.TCSocketAddress;
09: import com.tc.net.core.ConnectionAddressProvider;
10: import com.tc.net.core.TCConnectionManager;
11: import com.tc.net.protocol.transport.ConnectionIDFactory;
12: import com.tc.net.protocol.transport.WireProtocolMessageSink;
13: import com.tc.object.session.SessionProvider;
14:
15: /**
16: * CommsMgr provides Listener and Channel endpoints for exchanging <code>TCMessage</code> type messages
17: */
18: public interface CommunicationsManager {
19: public TCConnectionManager getConnectionManager();
20:
21: public void shutdown();
22:
23: public boolean isInShutdown();
24:
25: public NetworkListener[] getAllListeners();
26:
27: /**
28: * Creates a client message channel to the given host/port.
29: *
30: * @param maxReconnectTries The number of times the channel will attempt to reestablish communications with the server
31: * if the connection is lost. If n==0, the channel will not attempt to reestablish communications. If n>0, the
32: * channel will attempt to reestablish communications n times. If n<0 the channel will always try to
33: * reestablish communications.
34: * @param hostname The hostname to connect to.
35: * @param port The remote port to connect to.
36: * @param timeout The maximum time (in milliseconds) to wait for the underlying connection to be established before
37: * giving up.
38: */
39: public ClientMessageChannel createClientChannel(
40: SessionProvider sessionProvider, int maxReconnectTries,
41: String hostname, int port, int timeout,
42: ConnectionAddressProvider addressProvider);
43:
44: public NetworkListener createListener(
45: SessionProvider sessionProvider, TCSocketAddress addr,
46: boolean transportDisconnectRemovesChannel,
47: ConnectionIDFactory connectionIdFactory);
48:
49: public NetworkListener createListener(
50: SessionProvider sessionProvider, TCSocketAddress addr,
51: boolean transportDisconnectRemovesChannel,
52: ConnectionIDFactory connectionIdFactory,
53: WireProtocolMessageSink wireProtoMsgSink);
54:
55: public NetworkListener createListener(
56: SessionProvider sessionProvider, TCSocketAddress addr,
57: boolean transportDisconnectRemovesChannel,
58: ConnectionIDFactory connectionIdFactory,
59: boolean reuseAddress);
60:
61: public NetworkListener createListener(
62: SessionProvider sessionProvider, TCSocketAddress address,
63: boolean transportDisconnectRemovesChannel,
64: ConnectionIDFactory connectionIDFactory, Sink httpSink);
65: }
|