Eclipse JDT
Release 3.1

org.eclipse.jdt.debug.core
Interface IJavaBreakpoint

All Superinterfaces:
IAdaptable, IBreakpoint
All Known Subinterfaces:
IJavaClassPrepareBreakpoint, IJavaExceptionBreakpoint, IJavaLineBreakpoint, IJavaMethodBreakpoint, IJavaMethodEntryBreakpoint, IJavaPatternBreakpoint, IJavaStratumLineBreakpoint, IJavaTargetPatternBreakpoint, IJavaWatchpoint

public interface IJavaBreakpoint
extends IBreakpoint

A breakpoint specific to the Java debug model. A Java breakpoint supports:

Clients are not intended to implement this interface

Since:
2.0

Field Summary
static int SUSPEND_THREAD
          Default suspend policy constant indicating a breakpoint will suspend only the thread in which it occurred.
static int SUSPEND_VM
          Suspend policy constant indicating a breakpoint will suspend the target VM when hit.
 
Fields inherited from interface org.eclipse.debug.core.model.IBreakpoint
BREAKPOINT_MARKER, ENABLED, ID, LINE_BREAKPOINT_MARKER, PERSISTED, REGISTERED
 
Method Summary
 void addInstanceFilter(IJavaObject object)
          Adds the given object to the list of objects in which this breakpoint is restricted to suspend execution.
 int getHitCount()
          Returns this breakpoint's hit count or, -1 if this breakpoint does not have a hit count.
 IJavaObject[] getInstanceFilters()
          Returns the current set of active instance filters.
 int getSuspendPolicy()
          Returns the suspend policy used by this breakpoint, one of SUSPEND_VM or SUSPEND_THREAD.
 IJavaThread getThreadFilter(IJavaDebugTarget target)
          Returns the thread in the given target in which this breakpoint is enabled or null if this breakpoint is enabled in all threads in the given target.
 IJavaThread[] getThreadFilters()
          Returns all thread filters set on this breakpoint.
 String getTypeName()
          Returns the fully qualified name of the type this breakpoint is located in, or null if this breakpoint is not located in a specific type - for example, a pattern breakpoint.
 boolean isInstalled()
          Returns whether this breakpoint is installed in at least one debug target.
 void removeInstanceFilter(IJavaObject object)
          Removes the given object from the list of objects in which this breakpoint is restricted to suspend execution.
 void removeThreadFilter(IJavaDebugTarget target)
          Removes this breakpoint's thread filter in the given target, if any.
 void setHitCount(int count)
          Sets the hit count attribute of this breakpoint.
 void setSuspendPolicy(int suspendPolicy)
          Sets whether all threads in the target VM will be suspended when this breakpoint is hit.
 void setThreadFilter(IJavaThread thread)
          Restricts this breakpoint to suspend only in the given thread when encounterd in the given thread's target.
 boolean supportsInstanceFilters()
          Returns whether this breakpoints supports instance filters.
 boolean supportsThreadFilters()
          Returns whether this breakpoints supports thread filters.
 
Methods inherited from interface org.eclipse.debug.core.model.IBreakpoint
delete, getMarker, getModelIdentifier, isEnabled, isPersisted, isRegistered, setEnabled, setMarker, setPersisted, setRegistered
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

SUSPEND_VM

public static final int SUSPEND_VM
Suspend policy constant indicating a breakpoint will suspend the target VM when hit.

See Also:
Constant Field Values

SUSPEND_THREAD

public static final int SUSPEND_THREAD
Default suspend policy constant indicating a breakpoint will suspend only the thread in which it occurred.

See Also:
Constant Field Values
Method Detail

isInstalled

public boolean isInstalled()
                    throws CoreException
Returns whether this breakpoint is installed in at least one debug target.

Returns:
whether this breakpoint is installed
Throws:
CoreException - if unable to access the property on this breakpoint's underlying marker

getTypeName

public String getTypeName()
                   throws CoreException
Returns the fully qualified name of the type this breakpoint is located in, or null if this breakpoint is not located in a specific type - for example, a pattern breakpoint.

Returns:
the fully qualified name of the type this breakpoint is located in, or null
Throws:
CoreException - if unable to access the property from this breakpoint's underlying marker

getHitCount

public int getHitCount()
                throws CoreException
Returns this breakpoint's hit count or, -1 if this breakpoint does not have a hit count.

Returns:
this breakpoint's hit count, or -1
Throws:
CoreException - if unable to access the property from this breakpoint's underlying marker

setHitCount

public void setHitCount(int count)
                 throws CoreException
Sets the hit count attribute of this breakpoint. If this breakpoint is currently disabled and the hit count is set greater than -1, this breakpoint is automatically enabled.

Parameters:
count - the new hit count
Throws:
CoreException - if unable to set the property on this breakpoint's underlying marker

setSuspendPolicy

public void setSuspendPolicy(int suspendPolicy)
                      throws CoreException
Sets whether all threads in the target VM will be suspended when this breakpoint is hit. When SUSPEND_VM the target VM is suspended, and when SUSPEND_THREAD only the thread in which this breakpoint occurred is suspended.

Parameters:
suspendPolicy - one of SUSPEND_VM or SUSPEND_THREAD
Throws:
CoreException - if unable to set the property on this breakpoint's underlying marker

getSuspendPolicy

public int getSuspendPolicy()
                     throws CoreException
Returns the suspend policy used by this breakpoint, one of SUSPEND_VM or SUSPEND_THREAD.

Returns:
one of SUSPEND_VM or SUSPEND_THREAD
Throws:
CoreException - if unable to access the property from this breakpoint's underlying marker

setThreadFilter

public void setThreadFilter(IJavaThread thread)
                     throws CoreException
Restricts this breakpoint to suspend only in the given thread when encounterd in the given thread's target. A breakpoint can only be resticted to one thread per target. Any previous thread filter for the same target is lost. A thread filter is not persisted across workbench invocations.

Throws:
CoreException - if unable to set the thread filter

removeThreadFilter

public void removeThreadFilter(IJavaDebugTarget target)
                        throws CoreException
Removes this breakpoint's thread filter in the given target, if any. Has no effect if this breakpoint does not have a filter in the given target.

Parameters:
target - the target whose thread filter will be removed
Throws:
CoreException - if unable to remove the thread filter

getThreadFilter

public IJavaThread getThreadFilter(IJavaDebugTarget target)
                            throws CoreException
Returns the thread in the given target in which this breakpoint is enabled or null if this breakpoint is enabled in all threads in the given target.

Returns:
the thread in the given target that this breakpoint is enabled for
Throws:
CoreException - if unable to determine this breakpoint's thread filter

getThreadFilters

public IJavaThread[] getThreadFilters()
                               throws CoreException
Returns all thread filters set on this breakpoint.

Returns:
the threads that this breakpoint is resticted to
Throws:
CoreException - if unable to determine this breakpoint's thread filters

addInstanceFilter

public void addInstanceFilter(IJavaObject object)
                       throws CoreException
Adds the given object to the list of objects in which this breakpoint is restricted to suspend execution. Has no effect if the object has already been added. Note that clients should first ensure that a breakpoint supports instance filters.

Note: This implementation will add more than one filter. However, if there is more than one instance filter for a debug target, the breakpoint will never be hit in that target, as the current context cannot be two different instances at the same time.

Parameters:
object - instance filter to add
Throws:
CoreException - if unable to add the given instance filter
Since:
2.1

removeInstanceFilter

public void removeInstanceFilter(IJavaObject object)
                          throws CoreException
Removes the given object from the list of objects in which this breakpoint is restricted to suspend execution. Has no effect if the object has not yet been added as an instance filter.

Parameters:
object - instance filter to remove
Throws:
CoreException - if unable to remove the given instance filter
Since:
2.1

supportsInstanceFilters

public boolean supportsInstanceFilters()
Returns whether this breakpoints supports instance filters.

Returns:
whether this breakpoints supports instance filters
Since:
3.0

getInstanceFilters

public IJavaObject[] getInstanceFilters()
                                 throws CoreException
Returns the current set of active instance filters.

Returns:
the current set of active instance filters.
Throws:
CoreException - if unable to retrive the list
Since:
2.1

supportsThreadFilters

public boolean supportsThreadFilters()
Returns whether this breakpoints supports thread filters.

Returns:
whether this breakpoints supports thread filters
Since:
3.0

Eclipse JDT
Release 3.1

Copyright (c) IBM Corp. and others 2000, 2005. All Rights Reserved.