sofya.ed.structural
Class BlockInstrumentationConfiguration

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

public class BlockInstrumentationConfiguration
extends java.lang.Object
implements ActiveComponent

A basic block instrumentation configuration stores the types of basic blocks that have been selected for instrumentation or observation by an event dispatcher.

Version:
03/16/2006
Author:
Alex Kinneer

Constructor Summary
BlockInstrumentationConfiguration()
          Creates a new basic block configuration.
 
Method Summary
 boolean areCallBlocksActive()
          Reports whether call blocks are selected.
 boolean areCodeBlocksActive()
          Reports whether general basic blocks are selected; general basic blocks are any basic blocks corresponding to actual program code other than method call blocks.
 boolean areEntryBlocksActive()
          Reports whether entry blocks are selected.
 boolean areExitBlocksActive()
          Reports whether exit blocks 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 basic blocks 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 setCallBlocksActive(boolean enable)
          Sets whether call blocks are selected.
 void setCodeBlocksActive(boolean enable)
          Sets whether general basic blocks are selected; general basic blocks are any basic blocks corresponding to actual program code other than method call blocks.
 void setEntryBlocksActive(boolean enable)
          Sets whether entry blocks are selected.
 void setExitBlocksActive(boolean enable)
          Sets whether exit blocks are selected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockInstrumentationConfiguration

public BlockInstrumentationConfiguration()
Creates a new basic block configuration.

No basic blocks 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

areCodeBlocksActive

public boolean areCodeBlocksActive()
Reports whether general basic blocks are selected; general basic blocks are any basic blocks corresponding to actual program code other than method call blocks.

Returns:
true if general basic blocks are selected, false otherwise.

setCodeBlocksActive

public void setCodeBlocksActive(boolean enable)
Sets whether general basic blocks are selected; general basic blocks are any basic blocks corresponding to actual program code other than method call blocks.

Parameters:
enable - true to select general basic blocks, false to ignore.

areEntryBlocksActive

public boolean areEntryBlocksActive()
Reports whether entry blocks are selected.

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

setEntryBlocksActive

public void setEntryBlocksActive(boolean enable)
Sets whether entry blocks are selected.

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

areExitBlocksActive

public boolean areExitBlocksActive()
Reports whether exit blocks are selected.

Returns:
true if exit blocks are selected, false otherwise.

setExitBlocksActive

public void setExitBlocksActive(boolean enable)
Sets whether exit blocks are selected.

Parameters:
enable - true to select exit blocks, false to ignore.

areCallBlocksActive

public boolean areCallBlocksActive()
Reports whether call blocks are selected.

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

setCallBlocksActive

public void setCallBlocksActive(boolean enable)
Sets whether call blocks are selected.

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

getTypeFlags

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

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

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