|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsofya.ed.structural.processors.AbstractProcessingStrategy
sofya.ed.structural.processors.AbstractSocketProcessingStrategy
sofya.ed.structural.processors.BranchCoverageProcessingStrategy
public class BranchCoverageProcessingStrategy
Processing strategy to receive branch coverage probes and dispatch branch coverage events.
| Field Summary |
|---|
| Fields inherited from class sofya.ed.structural.processors.AbstractSocketProcessingStrategy |
|---|
isSbjDispatcher, PREEMPTIVE, traceLock |
| Fields inherited from class sofya.ed.structural.processors.AbstractProcessingStrategy |
|---|
instMode, sbjout, stderr, stdout |
| Constructor Summary | |
|---|---|
BranchCoverageProcessingStrategy()
Creates a new instance of the processing strategy with a trace handler as the default coverage listener manager. |
|
BranchCoverageProcessingStrategy(CoverageListenerManager clm)
Creates a new instance of the processing strategy. |
|
| 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. |
void |
dispatcherStarting()
Message sent by the event dispatcher to indicate that it is about to start receiving data to publish its event stream. |
void |
dispatcherStopped()
Message sent by the event dispatcher to indicate that it has stopped receiving data used to publish its event stream. |
void |
doHandshake(java.net.Socket sbjSocket)
Executes the handshake procedure with the socket probe. |
CoverageListenerManager |
getCoverageListenerManager()
Gets the coverage listener manager to be used. |
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 |
processProbes(java.net.Socket sbjSocket,
ControlData cntrl)
The standard trace processing loop, used for all subjects except other event dispatchers. |
void |
processProbesSynchronized(java.net.Socket sbjSocket,
ControlData cntrl)
The synchronized trace processing loop. |
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 |
setCoverageListenerManager(CoverageListenerManager clm)
Sets the coverage listener manager to be used. |
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 sofya.ed.structural.processors.AbstractSocketProcessingStrategy |
|---|
openSignalSocket, parseMethodSignature |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BranchCoverageProcessingStrategy()
public BranchCoverageProcessingStrategy(CoverageListenerManager clm)
clm - Coverage listener manager to be used to retrieve coverage
listeners to which events will be dispatched.| Method Detail |
|---|
public CoverageListenerManager getCoverageListenerManager()
public void setCoverageListenerManager(CoverageListenerManager clm)
clm - Coverage listener manager to be used to retrieve coverage
listeners to which events will be dispatched.public void register(EventDispatcherConfiguration edConfig)
AbstractProcessingStrategyRegisters this component with the event dispatcher.
register in interface ActiveComponentregister in class AbstractSocketProcessingStrategyedConfig - The current configuration of system global resources
and settings that the component will use as appropriate.public java.util.List configure(java.util.List params)
ActiveComponentConfigures 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.
configure in interface ActiveComponentconfigure in class AbstractSocketProcessingStrategyparams - A list of command line tokens that have not yet
been processed by any previous components.
public void reset()
ActiveComponentNotifies 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.
reset in interface ActiveComponentreset in class AbstractSocketProcessingStrategypublic boolean isReady()
ActiveComponentReports 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.
isReady in interface ActiveComponenttrue if this component is ready for the event
dispatcher to begin dispatching events, false otherwise.public void release()
ActiveComponentNotifies 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.
release in interface ActiveComponentrelease in class AbstractSocketProcessingStrategypublic void dispatcherStarting()
SocketProcessingStrategyThis message provides the processing strategy an opportunity to take some action prior to handling the event stream, such as issuing a message to listeners.
dispatcherStarting in interface SocketProcessingStrategypublic void dispatcherStopped()
SocketProcessingStrategyThis message provides the processing strategy an opportunity to take some action after handling the event stream, such as issuing a message to listeners.
dispatcherStopped in interface SocketProcessingStrategy
public void doHandshake(java.net.Socket sbjSocket)
throws java.io.IOException,
AbstractEventDispatcher.ExecException
SocketProcessingStrategyThis method should check whether the type of instrumentation indicated by the socket probe is appropriate for this processing strategy. If it is not, an error response should be sent to the socket probe and an exception thrown. Otherwise, the integer code for the form of instrumentation to be processed should be returned.
doHandshake in interface SocketProcessingStrategysbjSocket - Main communications socket which is connected to the
socket probe.
java.io.IOException - If there is any error communicating through
the socket.
AbstractEventDispatcher.ExecException - If the instrumentation in the subject is not
appropriate for this type of filter.
public void processProbes(java.net.Socket sbjSocket,
ControlData cntrl)
SocketProcessingStrategyThe run loop waits for the subject to negotiate a socket connection
and then begins processing trace messages until the socket stream is
closed. If the subject is not instrumented, this loop will be killed
while waiting for the subject to connect when the main thread calls
ProgramEventDispatcher.stopServer().
A standard trace processing loop is provided distinct from the
synchronized version so that the cost of synchronization is not
incurred for all subjects. This also avoids complications related to
determining when to strip timestamps from trace messages. The cost of
this implementation is that you must remember to update both this
method and SocketProcessingStrategy.processProbesSynchronized(java.net.Socket, sofya.ed.structural.ControlData) when
making changes to how trace messages are processed.
processProbes in interface SocketProcessingStrategy
public void processProbesSynchronized(java.net.Socket sbjSocket,
ControlData cntrl)
SocketProcessingStrategyThe processing performed by this run loop should be functionally
equivalent to that of SocketProcessingStrategy.processProbes(java.net.Socket, sofya.ed.structural.ControlData). The only
difference is that this loop should synchronize access to the
listeners.
Note: This method is only expected to synchronize two threads. The event dispatcher will never execute this method from more than two threads, as there is no reason to do so.
processProbesSynchronized in interface SocketProcessingStrategypublic boolean areIfBranchesActive()
BranchInstrumentationStrategyif branches are selected.
areIfBranchesActive in interface BranchInstrumentationStrategytrue if if branches are selected,
false otherwise.public void setIfBranchesActive(boolean enable)
BranchInstrumentationStrategyif branches are selected.
setIfBranchesActive in interface BranchInstrumentationStrategyenable - true to select if branches,
false to ignore.public boolean areSwitchBranchesActive()
BranchInstrumentationStrategyswitch branches are selected.
areSwitchBranchesActive in interface BranchInstrumentationStrategytrue if switch branches are selected,
false otherwise.public void setSwitchBranchesActive(boolean enable)
BranchInstrumentationStrategyswitch branches are selected.
setSwitchBranchesActive in interface BranchInstrumentationStrategyenable - true to select switch branches,
false to ignore.public boolean areThrowsBranchesActive()
BranchInstrumentationStrategythrows branches are selected.
areThrowsBranchesActive in interface BranchInstrumentationStrategytrue if throws branches are selected,
false otherwise.public void setThrowsBranchesActive(boolean enable)
BranchInstrumentationStrategythrows branches are selected.
setThrowsBranchesActive in interface BranchInstrumentationStrategyenable - true to select throws branches,
false to ignore.public boolean areCallBranchesActive()
BranchInstrumentationStrategy
areCallBranchesActive in interface BranchInstrumentationStrategytrue if call branches are selected,
false otherwise.public void setCallBranchesActive(boolean enable)
BranchInstrumentationStrategy
setCallBranchesActive in interface BranchInstrumentationStrategyenable - true to select call branches,
false to ignore.public boolean areEntryBranchesActive()
BranchInstrumentationStrategy
areEntryBranchesActive in interface BranchInstrumentationStrategytrue if entry branches are selected,
false otherwise.public void setEntryBranchesActive(boolean enable)
BranchInstrumentationStrategy
setEntryBranchesActive in interface BranchInstrumentationStrategyenable - true to select entry branches,
false to ignore.public boolean areSummaryBranchesActive()
BranchInstrumentationStrategy
areSummaryBranchesActive in interface BranchInstrumentationStrategytrue if summary branches are selected,
false otherwise.public void setSummaryBranchesActive(boolean enable)
BranchInstrumentationStrategy
setSummaryBranchesActive in interface BranchInstrumentationStrategyenable - true to select summary branches,
false to ignore.public int getTypeFlags()
BranchInstrumentationStrategyUsed for communicating configuration information to certain other components. To be phased out at a future date.
getTypeFlags in interface BranchInstrumentationStrategy
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||