Kieker 1.9

kieker.tools.bridge
Class ServiceContainer

java.lang.Object
  extended by kieker.tools.bridge.ServiceContainer

public class ServiceContainer
extends Object

Container for the Kieker Data Bridge handling the startup and shutdown of Kieker and the service connector.

Since:
1.8
Author:
Reiner Jung

Field Summary
static long DEFAULT_LISTENER_UPDATE_INTERVAL
          Update interval for the process listener.
 
Constructor Summary
ServiceContainer(Configuration configuration, IServiceConnector service, boolean respawn)
           
 
Method Summary
 void addListener(IServiceListener listener)
          Add an update state listener.
 long getRecordCount()
           
 boolean isRespawn()
           
 void run()
          Main loop of the Kieker bridge.
 void setListenerUpdateInterval(long listenerUpdateInterval)
          Set the update interval for the listener information.
 void shutdown()
          Safely end bridge loop.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LISTENER_UPDATE_INTERVAL

public static final long DEFAULT_LISTENER_UPDATE_INTERVAL
Update interval for the process listener. The process listener is mainly used in verbose mode or in UI applications utilizing a ServiceContainer.

See Also:
Constant Field Values
Constructor Detail

ServiceContainer

public ServiceContainer(Configuration configuration,
                        IServiceConnector service,
                        boolean respawn)
Parameters:
configuration - A configuration object for Kieker monitoring
service - A service component to handle incoming data
respawn - Respawn the connector if it fails (this construct is debatable it should be handled by the connector itself)
Method Detail

run

public void run()
         throws ConnectorDataTransmissionException
Main loop of the Kieker bridge.

Throws:
ConnectorDataTransmissionException - if deserializeNextRecord exits with a ConnectorDataTransmissionException

shutdown

public void shutdown()
              throws ConnectorDataTransmissionException
Safely end bridge loop. This routine should only be called from the shutdown hook thread in the main part of a server. In other cases it will result in strange runtime errors.

Throws:
ConnectorDataTransmissionException - An error occurred during data transmission and in this particular case while closing the data transmission.

addListener

public void addListener(IServiceListener listener)
Add an update state listener.

Parameters:
listener - an object implementing the IServiceListener interface

setListenerUpdateInterval

public void setListenerUpdateInterval(long listenerUpdateInterval)
Set the update interval for the listener information. The default is 100 records.

Parameters:
listenerUpdateInterval - the new update interval in number of records

getRecordCount

public long getRecordCount()

isRespawn

public boolean isRespawn()

Kieker 1.9

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