Kieker 1.9

kieker.tools.bridge.connector.tcp
Class TCPSingleServerConnector

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

public class TCPSingleServerConnector
extends AbstractConnector

TCP server connector supporting one client. All operations provided by this connector must run in the same thread.

Since:
1.8
Author:
Reiner Jung

Field Summary
static String PORT
          Constant holding the name of the port configuration property.
 
Constructor Summary
TCPSingleServerConnector(Configuration configuration, ConcurrentMap<Integer,LookupEntity> lookupEntityMap)
          Create a TCPSingleServerConnector.
 
Method Summary
 void close()
          Close the server connection.
 IMonitoringRecord deserializeNextRecord()
          De-serialize an object reading from the input stream.
 void initialize()
          Initializes a server socket and data stream for a single connection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PORT

public static final String PORT
Constant holding the name of the port configuration property.

Constructor Detail

TCPSingleServerConnector

public TCPSingleServerConnector(Configuration configuration,
                                ConcurrentMap<Integer,LookupEntity> lookupEntityMap)
Create a TCPSingleServerConnector.

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 a server socket and data stream for a single connection.

Throws:
ConnectorDataTransmissionException - it the socket could not be established

close

public void close()
           throws ConnectorDataTransmissionException
Close the server connection.

Throws:
ConnectorDataTransmissionException - if the closing fails

deserializeNextRecord

public IMonitoringRecord deserializeNextRecord()
                                        throws ConnectorDataTransmissionException,
                                               ConnectorEndOfDataException
De-serialize an object reading from the input stream.

Returns:
the de-serialized IMonitoringRecord object or null if the stream was terminated by the client.
Throws:
ConnectorDataTransmissionException - if an unknown id is received which cannot be mapped to an IMonitoringRecord
ConnectorEndOfDataException - if the end of the data stream is reached

Kieker 1.9

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