br.com.oncast.dev.lobo.eval
Class ExecutionContext

java.lang.Object
  extended by br.com.oncast.dev.lobo.eval.ExecutionContext

public class ExecutionContext
extends java.lang.Object

Controls the information collected during profiling evaluation.


Method Summary
 void endMetric(java.lang.String metricName)
          Ends a metric interval on the metric identified by metricName.
 void endMetricIfOpened(java.lang.String metricName)
          Ends a metric interval on the metric identified by metricName if opened.
static ExecutionContext getInstance()
          Returns the singleton's instance.
 ProfileReport getReport()
          Returns the last report evaluated.
 void reset()
          Resets the execution context.
 void startMetric(java.lang.String metricName, MetricType type)
          Starts a metric interval evaluation.
 void switchCase(java.lang.Class<?> clazz)
          Switches the case being evaluated.
 void switchMetric(java.lang.String metricName)
          Switches metric intervals on the metric identified by metricName.
It first closes the referred metric and then closes it, but in a faster away.
 void switchScenario(java.lang.reflect.Method method)
          Swithces the scenario being evaluated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ExecutionContext getInstance()
Returns the singleton's instance.

Returns:
the singleton's instance.

switchCase

public void switchCase(java.lang.Class<?> clazz)
Switches the case being evaluated.

Parameters:
clazz - the class that codes the profile case.

switchScenario

public void switchScenario(java.lang.reflect.Method method)
Swithces the scenario being evaluated.

Parameters:
method - the method that codes the profile scenario.

startMetric

public void startMetric(java.lang.String metricName,
                        MetricType type)
Starts a metric interval evaluation.

Parameters:
metricName - the name of the metric to have its interval evaluation started.
type - the type of the metric.

switchMetric

public void switchMetric(java.lang.String metricName)
Switches metric intervals on the metric identified by metricName.
It first closes the referred metric and then closes it, but in a faster away.

Parameters:
metricName - the name of the metric to be switched.

endMetric

public void endMetric(java.lang.String metricName)
               throws MetricIntervalUnstartedException
Ends a metric interval on the metric identified by metricName.

Parameters:
metricName - the name of the metric to have its last interval ended.
Throws:
MetricIntervalUnstartedException - if the metric had no opened metric intervals.

endMetricIfOpened

public void endMetricIfOpened(java.lang.String metricName)
Ends a metric interval on the metric identified by metricName if opened.

Parameters:
metricName - the name of the metric to have its last interval ended.

getReport

public ProfileReport getReport()
Returns the last report evaluated.

Returns:
the last report evaluated.

reset

public void reset()
Resets the execution context.