TPTP 4.0.0 Monitoring Tools Project
Public API Specification

org.eclipse.hyades.logging.adapter
Interface IProcessUnit

All Superinterfaces:
IComponent
All Known Subinterfaces:
ICBEFilter, IExtractor, IFilter, IFormatter, IMessageFilter, IOutputter, IParser, ISensor
All Known Implementing Classes:
CBEFileOutputter, CBEFormatter, CBELogOutputter, CBEstdoutOutputter, Extractor, LogImportOutputter, Outputter, Parser, ProcessUnit, Sensor, SerializedCBEFormatter

public interface IProcessUnit
extends IComponent

This interface represents a generic processing unit in the Generic Log Adapter architecture. It receives data from a preceding processing unit, processes it, and passes the processed data to the next processing unit.


Method Summary
 java.lang.Object[] flushEventItems(java.lang.Object[] msgs)
          When a context is running, some processing units may decide to cache or buffer data for various reasons such as performance.
 java.lang.Object[] processEventItems(java.lang.Object[] msgs)
          Main processing for the processing unit is done by this method.
 java.lang.Object[] testProcessEventItems(java.lang.Object[] msgs)
          In order to avoid runtime failures a context should invoke this test method.
 
Methods inherited from interface org.eclipse.hyades.logging.adapter.IComponent
getComponents, getConfiguration, getContextConfiguration, getDescription, getExecutableClassName, getImplementationCreationDate, getImplementationVersion, getImplementationVersionDescription, getLogger, getLoggingLevel, getName, getParent, getRole, getRoleCreationDate, getRoleVersion, getRoleVersionDescription, getUniqueID, init, log, log, setComponents, setConfiguration, setContextConfiguration, setDescription, setExecutableClassName, setImplemenationCreationDate, setImplementationVersion, setImplementationVersionDescription, setLogger, setLoggingLevel, setName, setParent, setRole, setRoleCreationDate, setRoleVersion, setRoleVersionDescription, setUniqueID, start, stop, update, update
 

Method Detail

processEventItems

public java.lang.Object[] processEventItems(java.lang.Object[] msgs)
Main processing for the processing unit is done by this method. The contract with the implementation is return an Object[] for further processing. The array should normally be typed more strongly than Object. A typical pattern is to implement this method by invoking a more strongly typed method.

Parameters:
msgs - - the input messages as an array of Objects
Returns:
the processed data as an array of Objects

flushEventItems

public java.lang.Object[] flushEventItems(java.lang.Object[] msgs)
When a context is running, some processing units may decide to cache or buffer data for various reasons such as performance. This method provides the behaviour to clear the content of these buffers. For example if a processing unit needs to hold data across calls to the processEventItems then this method will call final processing of those buffered event. An example is the Extractor which may need to process mulitple blocks of data from the Sensor. A flush will indicate to the Extractor that it is getting no more data and may want to deal with what is has. A more detailed example would be when data is being processed in a long running context, the notion of the end of that long running process may cause final processing of buffered data, thus indicating things like end of file for example in a Sensor.

Parameters:
msgs - - the input messages as an array of Objects
Returns:
the flushed data as an array of Objects

testProcessEventItems

public java.lang.Object[] testProcessEventItems(java.lang.Object[] msgs)
                                         throws AdapterInvalidConfig
In order to avoid runtime failures a context should invoke this test method. An implementation should test for the appropriate types it will consume and produce thus simulating a runtime environment. If a type is not supported an exception should be thrown.

Parameters:
msgs - - the sample input messages as an array of Objects
Returns:
sample processed data as an array of Objects
Throws:
AdapterInvalidConfig - exception if the wrong type of objects are passed in

TPTP 4.0.0 Monitoring Tools Project
Public API Specification