com.bluemarsh.jswat.breakpoint
Interface Breakpoint

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
DefaultBreakpoint

public interface Breakpoint
extends java.io.Serializable

Interface Breakpoint defines the methods applicable to a breakpoint. Breakpoints have several states, including enabled, disabled, expired, and resolved. Breakpoints have several optional elements. First they have a "skip" count, which tells the breakpoint not to stop until it has been hit a certain number of times. Then breakpoints may expire after a number of hits, in which case they will no longer stop.

All concrete breakpoint implementations should set a "breakpoint" property in their com.sun.jdi.request.EventRequest object. This is used by the breakpoint manager to retrieve the breakpoint object from the event request object.

Author:
Nathan Fiedler

Field Summary
static long serialVersionUID
          serial version
 
Method Summary
 void addCondition(Condition condition)
          Add the given condition to this breakpoint.
 void addMonitor(Monitor monitor)
          Add the given monitor to this breakpoint.
 java.util.ListIterator conditions()
          Returns an iterator of the conditions associated with this breakpoint.
 void deleteOnExpire()
          Ensures that this breakpoint will be deleted when it has expired.
 void destroy()
          Tear down this breakpoint in preparation for deletion.
 com.sun.jdi.request.EventRequest eventRequest()
          Returns the event request for this breakpoint, if the breakpoint has been resolved.
 BreakpointGroup getBreakpointGroup()
          Gets the breakpoint group to which this breakpoint belongs.
 int getExpireCount()
          Return the number of times this breakpoint can be hit before it expires and no longer stops.
 java.lang.Object getProperty(java.lang.String key)
          Retrieves the named property.
 int getSkipCount()
          Return the number of times this breakpoint can be hit before it starts stopping the debuggee VM.
 int getSuspendPolicy()
          Retrieve the suspend policy for this breakpoint.
 BreakpointUI getUIAdapter()
          Returns the user interface widget for customizing this breakpoint.
 boolean hasExpired()
          Returns true if the breakpoint has expired and will no longer cause execution to halt.
 void init()
          Initialize the breakpoint so it may operate normally.
 boolean isEnabled()
          Returns true if and only if the breakpoint is enabled and the group containing this breakpoint is also enabled.
 boolean isResolved()
          Returns true if the breakpoint has been resolved against the intended object in the debuggee VM.
 boolean isSkipping()
          Returns true if this breakpoint is currently skipping.
 java.util.ListIterator monitors()
          Returns an iterator of the monitors associated with this breakpoint.
 void removeCondition(Condition condition)
          Remove the given condition from this breakpoint.
 void removeMonitor(Monitor monitor)
          Remove the given monitor from this breakpoint.
 void reset()
          Reset the stopped count to zero and clear any other attributes such that this breakpoint can be used again for a new session.
 void setBreakpointGroup(BreakpointGroup group)
          Sets the breakpoint group to which this breakpoint will belong.
 void setEnabled(boolean enabled)
          Enables or disables this breakpoint, according to the parameter.
 void setExpireCount(int expireCount)
          Set the number of times this breakpoint can be hit before it expires and no longer stops.
 void setProperty(java.lang.String key, java.lang.Object value)
          Stores a named property in this breakpoint.
 void setSkipCount(int skipCount)
          Set the number of times this breakpoint can be hit before it starts stopping the debuggee VM.
 void setSuspendPolicy(int policy)
          Set the suspend policy for the request.
 java.lang.String toString(boolean terse)
          Returns a String representation of this.
 

Field Detail

serialVersionUID

public static final long serialVersionUID
serial version
Method Detail

addCondition

public void addCondition(Condition condition)
Add the given condition to this breakpoint. That is, when the shouldStop() method is called, this breakpoint should check if this condition is satisfied or not.
Parameters:
condition - condition for this breakpoint to stop.

addMonitor

public void addMonitor(Monitor monitor)
Add the given monitor to this breakpoint. That is, when the stopped() method is called, this breakpoint will execute this monitor.
Parameters:
monitor - monitor for this breakpoint to execute.

conditions

public java.util.ListIterator conditions()
Returns an iterator of the conditions associated with this breakpoint.
Returns:
ListIterator of Condition objects.

deleteOnExpire

public void deleteOnExpire()
Ensures that this breakpoint will be deleted when it has expired.

destroy

public void destroy()
Tear down this breakpoint in preparation for deletion.

eventRequest

public com.sun.jdi.request.EventRequest eventRequest()
Returns the event request for this breakpoint, if the breakpoint has been resolved.
Returns:
breakpoint's event request, or null if unresolved.

getBreakpointGroup

public BreakpointGroup getBreakpointGroup()
Gets the breakpoint group to which this breakpoint belongs.
Returns:
parent breakpoint group, always non-null.
See Also:
setBreakpointGroup(com.bluemarsh.jswat.breakpoint.BreakpointGroup)

getExpireCount

public int getExpireCount()
Return the number of times this breakpoint can be hit before it expires and no longer stops.
Returns:
number of times this breakpoint can be hit before it expires; zero means it will never expire.

getProperty

public java.lang.Object getProperty(java.lang.String key)
Retrieves the named property.
Parameters:
key - name of property to retrieve.
Returns:
Property, or null if none found.

getSkipCount

public int getSkipCount()
Return the number of times this breakpoint can be hit before it starts stopping the debuggee VM. That is, the breakpoint will be hit N times before it stops.
Returns:
number of times this breakpoint will be hit before it stops; zero means it will not skip.

getSuspendPolicy

public int getSuspendPolicy()
Retrieve the suspend policy for this breakpoint. The returned value will be one of the com.sun.jdi.request.EventRequest constants for suspending threads.
Returns:
suspend policy, one of the EventRequest suspend constants.
See Also:
setSuspendPolicy(int)

getUIAdapter

public BreakpointUI getUIAdapter()
Returns the user interface widget for customizing this breakpoint.
Returns:
Breakpoint user interface adapter.

hasExpired

public boolean hasExpired()
Returns true if the breakpoint has expired and will no longer cause execution to halt.
Returns:
true if this breakpoint has expired, false otherwise.

init

public void init()
Initialize the breakpoint so it may operate normally.

isEnabled

public boolean isEnabled()
Returns true if and only if the breakpoint is enabled and the group containing this breakpoint is also enabled.
Returns:
true if this breakpoint is enabled, false otherwise.
See Also:
setEnabled(boolean)

isResolved

public boolean isResolved()
Returns true if the breakpoint has been resolved against the intended object in the debuggee VM. How a breakpoint resolves itself depends on the type of the breakpoint.
Returns:
true if this breakpoint has resolved, false otherwise.

isSkipping

public boolean isSkipping()
Returns true if this breakpoint is currently skipping. That is, the skipCount is greater than zero and the stoppedCount is less than the skipCount.
Returns:
true if the breakpoint is skipping hits.

monitors

public java.util.ListIterator monitors()
Returns an iterator of the monitors associated with this breakpoint.
Returns:
ListIterator of Monitor objects.

removeCondition

public void removeCondition(Condition condition)
Remove the given condition from this breakpoint. This condition should no longer be associated with this breakpoint. If the condition is not a part of this breakpoint, nothing happens.
Parameters:
condition - condition to remove from this breakpoint.

removeMonitor

public void removeMonitor(Monitor monitor)
Remove the given monitor from this breakpoint. This monitor should no longer be associated with this breakpoint. If the monitor is not a part of this breakpoint, nothing happens.
Parameters:
monitor - monitor to remove from this breakpoint.

reset

public void reset()
Reset the stopped count to zero and clear any other attributes such that this breakpoint can be used again for a new session. This does not change the enabled-ness of the breakpoint.

setBreakpointGroup

public void setBreakpointGroup(BreakpointGroup group)
Sets the breakpoint group to which this breakpoint will belong.
Parameters:
group - new parent breakpoint group.
See Also:
getBreakpointGroup()

setEnabled

public void setEnabled(boolean enabled)
Enables or disables this breakpoint, according to the parameter.
Parameters:
enabled - True if breakpoint should be enabled, false if breakpoint should be disabled.
See Also:
isEnabled()

setExpireCount

public void setExpireCount(int expireCount)
Set the number of times this breakpoint can be hit before it expires and no longer stops.
Parameters:
expireCount - number of times this breakpoint can be hit before it expires; zero to never expire

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object value)
Stores a named property in this breakpoint.
Parameters:
key - name of property to set.
value - value of property.

setSkipCount

public void setSkipCount(int skipCount)
Set the number of times this breakpoint can be hit before it starts stopping the debuggee VM. That is, the breakpoint will be hit skipCount times before it stops.
Parameters:
skipCount - number of times this breakpoint will be hit before it stops; zero to disable skipping

setSuspendPolicy

public void setSuspendPolicy(int policy)
Set the suspend policy for the request. Use one of the com.sun.jdi.request.EventRequest constants for suspending threads.
Parameters:
policy - one of the EventRequest suspend constants.

toString

public java.lang.String toString(boolean terse)
Returns a String representation of this.
Parameters:
terse - true to keep the description terse.