Kieker 1.11

kieker.tools.bridge.connector.tcp
Class TCPMultiServerConnector

java.lang.Object
  extended by kieker.tools.bridge.connector.AbstractConnector
      extended by kieker.tools.bridge.connector.tcp.TCPMultiServerConnector
All Implemented Interfaces:
IServiceConnector

public class TCPMultiServerConnector
extends AbstractConnector

TCP server connector supporting multiple clients.

Since:
1.8
Author:
Reiner Jung

Field Summary
static java.lang.String PORT
          Constant holds name for the port property .
 
Fields inherited from class kieker.tools.bridge.connector.AbstractConnector
configuration, lookupEntityMap
 
Constructor Summary
TCPMultiServerConnector(Configuration configuration, java.util.concurrent.ConcurrentMap<java.lang.Integer,LookupEntity> lookupEntityMap)
          Create a TCPMultiServerConnector.
 
Method Summary
 void close()
          Stop all service threads to handle TCP communication and empty the record queue.
 IMonitoringRecord deserializeNextRecord()
          Implements the deserializeNextRecord interface.
 void initialize()
          Initializes internal queues and an executor pool for communication.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PORT

public static final java.lang.String PORT
Constant holds name for the port property .

Constructor Detail

TCPMultiServerConnector

public TCPMultiServerConnector(Configuration configuration,
                               java.util.concurrent.ConcurrentMap<java.lang.Integer,LookupEntity> lookupEntityMap)
Create a TCPMultiServerConnector.

Parameters:
configuration - Kieker configuration including setup for connectors
lookupEntityMap - IMonitoringRecord constructor and TYPES-array to id map
Method Detail

initialize

public void initialize()
                throws ConnectorDataTransmissionException
Initializes internal queues and an executor pool for communication.

Throws:
ConnectorDataTransmissionException - when the server socket cannot be acquired
See Also:
IServiceConnector.initialize()

close

public void close()
           throws ConnectorDataTransmissionException
Stop all service threads to handle TCP communication and empty the record queue.

Throws:
ConnectorDataTransmissionException - if the thread shutdown is interrupted or fails, the graceful wait to empty the queue fails or the queue is not emptied after a waiting period

deserializeNextRecord

public IMonitoringRecord deserializeNextRecord()
                                        throws ConnectorDataTransmissionException,
                                               ConnectorEndOfDataException
Implements the deserializeNextRecord interface. Fetches deserialized data from the recordQeue which is filled by the connection listener threads.

Returns:
one IMonitoringRecord per call
Throws:
ConnectorDataTransmissionException - if the record reading is interrupted
ConnectorEndOfDataException - if end of all data streams are reached

Kieker 1.11

Copyright 2015 Kieker Project, http://kieker-monitoring.net