ch.elca.el4j.services.statistics.detailed.processing
Interface MeasureCollectorService

All Known Implementing Classes:
NonPersistentMeasureCollectorService

public interface MeasureCollectorService

Local service (both in container and in clients) allowing to collect measures in the system.

A measure is made of a collection of MeasureItem objects. A measure may be started by a client or on a server and sub-measures are then added by MeasureInvoker.
In order to group the diverse sub-measures of a same global measure, they are all identified by the same identifier. A sequence number is used to identify the order of the diverse sub-measures (starting at 1 for the global measure).

The id and sequence of the current measure (or sub-measures) are stored in the LEAF DetailedStatisticsSharedContextHolder object (keys defined by CONTEXT_NAME_ID and CONTEXT_NAME_SEQ).

So the MeasureInvoker (wherever it is) starts a measure if there is no defined CONTEXT_NAME_ID or it increases the sequence number to create a sub-measure. This class was ported from Leaf 2. Original authors: YMA,DBA. Leaf2 package name: ch.elca.leaf.services.measuring

Author:
Rashid Waraich (RWA)
See Also:
MeasureItem, MeasureInterceptor
File-location:
MeasureCollectorService
Last check-in date:
2009-08-04 15:17:52 +0200 (Di, 04. Aug 2009) by swismer for revision 3880

Field Summary
static String CONTEXT_NAME_ID
          DetailedStatisticsSharedContextHolder key for saving the measure MeasureID object.
static String CONTEXT_NAME_SEQ
          DetailedStatisticsSharedContextHolder key for saving the measure sequence.
 
Method Summary
 void add(MeasureItem item)
          Adds a new measure.
 void delete(int amount)
          Deletes all measures.
 List<MeasureItem> getAllMeasureItems()
          Returns a List of all the measures.
 List<MeasureItem> getFirstMeasureItems()
           
 void writeMeasures()
          Inserts the locally stored measures in permanent storage.
 

Field Detail

CONTEXT_NAME_ID

static final String CONTEXT_NAME_ID
DetailedStatisticsSharedContextHolder key for saving the measure MeasureID object.

See Also:
Constant Field Values

CONTEXT_NAME_SEQ

static final String CONTEXT_NAME_SEQ
DetailedStatisticsSharedContextHolder key for saving the measure sequence.

See Also:
Constant Field Values
Method Detail

add

void add(MeasureItem item)
Adds a new measure.

Parameters:
item - the measure to add

delete

void delete(int amount)
Deletes all measures.

Parameters:
amount - Dummy paramater, not used for non persistant collector (will simply be ignored). Perhaps required later if other CollectorServices are also ported.

getAllMeasureItems

List<MeasureItem> getAllMeasureItems()
Returns a List of all the measures.

Returns:
the list of measures

writeMeasures

void writeMeasures()
Inserts the locally stored measures in permanent storage.


getFirstMeasureItems

List<MeasureItem> getFirstMeasureItems()
Returns:
The MeasureIds of the collected MeasureItems.


Copyright © 2005-2011 ELCA. All Rights Reserved.