org.ow2.clif.analyze.lib.egui
Class AnalyzerImpl

java.lang.Object
  extended by org.ow2.clif.analyze.lib.egui.AnalyzerImpl
All Implemented Interfaces:
org.objectweb.fractal.api.control.BindingController, AnalyzerExternalAccess

public class AnalyzerImpl
extends java.lang.Object
implements org.objectweb.fractal.api.control.BindingController, AnalyzerExternalAccess

Implementation of Analyzer for Eclipse GUI.

Author:
Grégory CALONNIER, Jordan BRUNIER

Field Summary
 
Fields inherited from interface org.ow2.clif.analyze.api.AnalyzerExternalAccess
ANALYZER_EXTERNAL_ACCESS
 
Constructor Summary
AnalyzerImpl()
          Constructor
 
Method Summary
 void bindFc(java.lang.String clientItfName, java.lang.Object serverItf)
           
 void closeEventIterator(java.io.Serializable iteratorKey)
          Discards the iterator associated to the given key, possibly releasing resources.
 long countEvents(java.lang.String testName, java.lang.String bladeId, java.lang.String eventTypeLabel, EventFilter filter)
          Counts the number of available events matching a given filter.
 java.util.Properties getBladeProperties(java.lang.String testName, java.lang.String bladeId)
          Gets the java system properties for the given blade from the given test run
 java.lang.String[] getEventFieldLabels(java.lang.String testName, java.lang.String bladeId, java.lang.String eventTypeLabel)
          Gets the labels of fields hold by a given event type.
 java.io.Serializable getEventIterator(java.lang.String testName, java.lang.String bladeId, java.lang.String eventTypeLabel, EventFilter filter)
          Creates an event iterator.
 BladeEvent[] getNextEvents(java.io.Serializable iteratorKey, int count)
          Gets next events from the given event iterator.
 BladeDescriptor[] getTestPlan(java.lang.String testName, BladeFilter filter)
          Gets the test plan definition for a given test run name.
 TestDescriptor[] getTests(TestFilter filter)
          Gets a list of test runs matching a given filter.
 java.lang.String[] listFc()
           
 java.lang.Object lookupFc(java.lang.String clientItfName)
           
 void unbindFc(java.lang.String clientItfName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnalyzerImpl

public AnalyzerImpl()
Constructor

Method Detail

lookupFc

public java.lang.Object lookupFc(java.lang.String clientItfName)
Specified by:
lookupFc in interface org.objectweb.fractal.api.control.BindingController

bindFc

public void bindFc(java.lang.String clientItfName,
                   java.lang.Object serverItf)
Specified by:
bindFc in interface org.objectweb.fractal.api.control.BindingController

unbindFc

public void unbindFc(java.lang.String clientItfName)
Specified by:
unbindFc in interface org.objectweb.fractal.api.control.BindingController

listFc

public java.lang.String[] listFc()
Specified by:
listFc in interface org.objectweb.fractal.api.control.BindingController

getTests

public TestDescriptor[] getTests(TestFilter filter)
                          throws ClifException
Gets a list of test runs matching a given filter.

Specified by:
getTests in interface AnalyzerExternalAccess
Parameters:
filter - the test run filter. If null, all available test runs are returned.
Returns:
an array of test run descriptors
Throws:
ClifException - the clif exception

getBladeProperties

public java.util.Properties getBladeProperties(java.lang.String testName,
                                               java.lang.String bladeId)
                                        throws ClifException
Gets the java system properties for the given blade from the given test run

Specified by:
getBladeProperties in interface AnalyzerExternalAccess
Parameters:
testName - the test run name
bladeId - the blade identifier
Returns:
the Java system properties for the given blade
Throws:
ClifException - the clif exception
See Also:
TestDescriptor.getName(), BladeDescriptor.getId()

getEventFieldLabels

public java.lang.String[] getEventFieldLabels(java.lang.String testName,
                                              java.lang.String bladeId,
                                              java.lang.String eventTypeLabel)
Gets the labels of fields hold by a given event type.

Specified by:
getEventFieldLabels in interface AnalyzerExternalAccess
Parameters:
testName - the test run name
bladeId - the blade identifier from the given test run
eventTypeLabel - the label of the event type
Returns:
an array of event field labels provided by the given event type

getEventIterator

public java.io.Serializable getEventIterator(java.lang.String testName,
                                             java.lang.String bladeId,
                                             java.lang.String eventTypeLabel,
                                             EventFilter filter)
                                      throws ClifException
Creates an event iterator.

Specified by:
getEventIterator in interface AnalyzerExternalAccess
Parameters:
testName - the test name to retrieve events from
bladeId - the blade identifier in this test to retrieve events from
eventTypeLabel - the type label of the retrieved events
filter - the filter object to be used for event selection. If null, the iterator will return all events. The filter object may throw a NoMoreEvent exception, in which case current iterator step stops and currently selected events are returned.
Returns:
the iterator key to be used to iterate on getting events, and then to discard the iterator when done
Throws:
ClifException - the given test, blade, or event type could not be found
See Also:
getNextEvents(Serializable, int), closeEventIterator(Serializable)

getNextEvents

public BladeEvent[] getNextEvents(java.io.Serializable iteratorKey,
                                  int count)
                           throws ClifException
Gets next events from the given event iterator.

Specified by:
getNextEvents in interface AnalyzerExternalAccess
Parameters:
iteratorKey - the key for the target event iterator
count - the number of event to get (at most)
Returns:
selected events
Throws:
ClifException
See Also:
getEventIterator(String, String, String, EventFilter), closeEventIterator(Serializable)

closeEventIterator

public void closeEventIterator(java.io.Serializable iteratorKey)
Discards the iterator associated to the given key, possibly releasing resources.

Specified by:
closeEventIterator in interface AnalyzerExternalAccess
Parameters:
iteratorKey - the key for the target event iterator

countEvents

public long countEvents(java.lang.String testName,
                        java.lang.String bladeId,
                        java.lang.String eventTypeLabel,
                        EventFilter filter)
                 throws ClifException
Counts the number of available events matching a given filter.

Specified by:
countEvents in interface AnalyzerExternalAccess
Parameters:
testName - the test name to retrieve events from
bladeId - the blade identifier in this test to retrieve events from
eventTypeLabel - the type label of the retrieved events
filter - the filter object to be used for event selection. If null, all events are counted. Counting stops before completion if the filter object throws a NoMoreEvent exception, in which case count value before exception is returned.
Returns:
the number of available blade events matching the provided filter.
Throws:
ClifException - the clif exception

getTestPlan

public BladeDescriptor[] getTestPlan(java.lang.String testName,
                                     BladeFilter filter)
                              throws ClifException
Description copied from interface: AnalyzerExternalAccess
Gets the test plan definition for a given test run name.

Specified by:
getTestPlan in interface AnalyzerExternalAccess
Parameters:
testName - the test run name
filter - retains only blades (injectors, probes) accepted by this filter. If null, all blades are retained.
Returns:
an array of descriptors for blades composing the test run and accepted by the optional filter.
Throws:
ClifException - the clif exception