sofya.ed.structural
Class BranchInstrumentationConfiguration

java.lang.Object
  extended by sofya.ed.structural.BranchInstrumentationConfiguration
All Implemented Interfaces:
ActiveComponent

public class BranchInstrumentationConfiguration
extends java.lang.Object
implements ActiveComponent

A branch instrumentation configuration stores the types of branches that have been selected for instrumentation or observation by an event dispatcher.

Version:
03/16/2006
Author:
Alex Kinneer

Field Summary
protected  boolean ready
          Flag indicating whether the configuration is considered in a ready state.
 
Constructor Summary
BranchInstrumentationConfiguration()
          Creates a new branch configuration.
 
Method Summary
 boolean areCallBranchesActive()
          Reports whether call branches are selected.
 boolean areEntryBranchesActive()
          Reports whether entry branches are selected.
 boolean areIfBranchesActive()
          Reports whether if branches are selected.
 boolean areSummaryBranchesActive()
          Reports whether summary branches are selected.
 boolean areSwitchBranchesActive()
          Reports whether switch branches are selected.
 boolean areThrowsBranchesActive()
          Reports whether throws branches are selected.
 java.util.List configure(java.util.List params)
          Configures this component from command line parameters.
 int getTypeFlags()
          Gets the bitmask corresponding to the types of branches currently selected.
 boolean isReady()
          Reports whether this component is ready for the event dispatcher to begin dispatching events.
 void register(EventDispatcherConfiguration edConfig)
          Registers this component with the event dispatcher.
 void release()
          Notifies this component that its current lifecycle has expired and that it should commit any stored state and release resources.
 void reset()
          Notifies this component to clear its configuration and reset any internal state.
 void setCallBranchesActive(boolean enable)
          Sets whether call branches are selected.
 void setEntryBranchesActive(boolean enable)
          Sets whether entry branches are selected.
 void setIfBranchesActive(boolean enable)
          Sets whether if branches are selected.
 void setSummaryBranchesActive(boolean enable)
          Sets whether summary branches are selected.
 void setSwitchBranchesActive(boolean enable)
          Sets whether switch branches are selected.
 void setThrowsBranchesActive(boolean enable)
          Sets whether throws branches are selected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ready

protected boolean ready
Flag indicating whether the configuration is considered in a ready state.

Constructor Detail

BranchInstrumentationConfiguration

public BranchInstrumentationConfiguration()
Creates a new branch configuration.

No branches are activated by default.

Method Detail

register

public void register(EventDispatcherConfiguration edConfig)
Description copied from interface: ActiveComponent

Registers this component with the event dispatcher.

This method is called each time an event dispatcher prepares to initiate a new event stream, caused by a call to ProgramEventDispatcher.startDispatcher().

Specified by:
register in interface ActiveComponent
Parameters:
edConfig - The current configuration of system global resources and settings that the component may (and should) use as appropriate.

configure

public java.util.List configure(java.util.List params)
Description copied from interface: ActiveComponent

Configures this component from command line parameters.

This method provides a component the opportunity to define and process command line parameters required to configure itself. Components participate in a processing chain, initiated in Sofya-provided event dispatchers by calling this method on the processing strategy. The processing strategies provided by Sofya in turn invoke this method on any listeners implementing this interface.

Specified by:
configure in interface ActiveComponent
Parameters:
params - A list of command line tokens that have not yet been processed by any previous components.
Returns:
The list of parameters, with any recognized parameters and associated values removed. This enables the chaining of parameter processing.

reset

public void reset()
Description copied from interface: ActiveComponent

Notifies this component to clear its configuration and reset any internal state.

Calls to this method are chained similary to the ActiveComponent.configure(java.util.List) method. This method is invoked by the event dispatcher prior to reconfiguration. Normally it should be used to clear any configuration state to avoid using stale values.

Specified by:
reset in interface ActiveComponent

isReady

public boolean isReady()
Description copied from interface: ActiveComponent

Reports whether this component is ready for the event dispatcher to begin dispatching events.

Calls to this method are chained similarly to the ActiveComponent.configure(java.util.List) method. The event dispatcher will fail with an error if a client invokes ProgramEventDispatcher.startDispatcher() when any attached component returns false from this method.

Specified by:
isReady in interface ActiveComponent
Returns:
true if this component is ready for the event dispatcher to begin dispatching events, false otherwise.

release

public void release()
Description copied from interface: ActiveComponent

Notifies this component that its current lifecycle has expired and that it should commit any stored state and release resources.

Calls to this method are chained similary to the ActiveComponent.configure(java.util.List) method. This method is invoked directly by a client of the event dispatcher. Normally, it should be used to release any resources that were required to persist over multiple runs of the event dispatcher.

Specified by:
release in interface ActiveComponent

areIfBranchesActive

public boolean areIfBranchesActive()
Reports whether if branches are selected.

Returns:
true if if branches are selected, false otherwise.

setIfBranchesActive

public void setIfBranchesActive(boolean enable)
Sets whether if branches are selected.

Parameters:
enable - true to select if branches, false to ignore.

areSwitchBranchesActive

public boolean areSwitchBranchesActive()
Reports whether switch branches are selected.

Returns:
true if switch branches are selected, false otherwise.

setSwitchBranchesActive

public void setSwitchBranchesActive(boolean enable)
Sets whether switch branches are selected.

Parameters:
enable - true to select switch branches, false to ignore.

areThrowsBranchesActive

public boolean areThrowsBranchesActive()
Reports whether throws branches are selected.

Returns:
true if throws branches are selected, false otherwise.

setThrowsBranchesActive

public void setThrowsBranchesActive(boolean enable)
Sets whether throws branches are selected.

Parameters:
enable - true to select throws branches, false to ignore.

areCallBranchesActive

public boolean areCallBranchesActive()
Reports whether call branches are selected.

Returns:
true if call branches are selected, false otherwise.

setCallBranchesActive

public void setCallBranchesActive(boolean enable)
Sets whether call branches are selected.

Parameters:
enable - true to select call branches, false to ignore.

areEntryBranchesActive

public boolean areEntryBranchesActive()
Reports whether entry branches are selected.

Returns:
true if entry branches are selected, false otherwise.

setEntryBranchesActive

public void setEntryBranchesActive(boolean enable)
Sets whether entry branches are selected.

Parameters:
enable - true to select entry branches, false to ignore.

areSummaryBranchesActive

public boolean areSummaryBranchesActive()
Reports whether summary branches are selected.

Returns:
true if summary branches are selected, false otherwise.

setSummaryBranchesActive

public void setSummaryBranchesActive(boolean enable)
Sets whether summary branches are selected.

Parameters:
enable - true to select summary branches, false to ignore.

getTypeFlags

public int getTypeFlags()
Gets the bitmask corresponding to the types of branches currently selected.

Used for communicating configuration information to certain other components. To be phased out at a future date.

Returns:
The bitmask indicating which branch types have been selected in this configuration.