47 |
|
* |
48 |
|
* @param socket The Socket connected to the new Client |
49 |
|
* @param packetSorter A reference to the PacketSorter in the component |
50 |
+ |
* @param queueMonitorInterval The interval at which to monitor our Queue |
51 |
|
*/ |
52 |
< |
public TCPControlHandler(Socket socket, PacketSorter packetSorter) throws IOException { |
52 |
> |
public TCPControlHandler(Socket socket, PacketSorter packetSorter, int queueMonitorInterval) throws IOException { |
53 |
|
_socket = socket; |
54 |
|
_packetSorter = packetSorter; |
55 |
+ |
_queueMonitorInterval = queueMonitorInterval; |
56 |
|
// setup the reader & writer |
57 |
|
_socketIn = new BufferedReader(new InputStreamReader(_socket.getInputStream())); |
58 |
|
_socketOut = new PrintWriter(_socket.getOutputStream(), true); |
143 |
|
// register the DataHandler's queue, giving the host list |
144 |
|
_packetSorter.register(dh.getQueue(), _hostList); |
145 |
|
// startup a monitor on the DataHandler's queue, every minute |
146 |
< |
dh.getQueue().startMonitor(60*1000, _packetSorter.getQueue(), _name); |
146 |
> |
String queueName = _name + " TCPHandler:"+_socket.getInetAddress().getHostName(); |
147 |
> |
dh.getQueue().startMonitor(_queueMonitorInterval*1000, _packetSorter.getQueue(), queueName); |
148 |
|
// start up the DataHandler |
149 |
|
dh.start(); |
150 |
|
// Hold a reference to the DataHandler, so we can stop it later |
335 |
|
* The host list the Client has requested |
336 |
|
*/ |
337 |
|
private String _hostList; |
338 |
+ |
|
339 |
+ |
/** |
340 |
+ |
* The interval at which to monitor our Queue |
341 |
+ |
*/ |
342 |
+ |
private int _queueMonitorInterval; |
343 |
|
|
344 |
|
//---STATIC ATTRIBUTES--- |
345 |
|
|