|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bluemarsh.jswat.DefaultManager | +--com.bluemarsh.jswat.breakpoint.BreakpointManager
Class BreakpointManager defines is responsible for managing groups of breakpoints. It does not contain any breakpoints directly, but rather contains the groups which contain the breakpoints. The breakpoint manager acts as a factory for creating all types of breakpoints.
The breakpoint manager contains a breakpoint group called "Default". This default breakpoint group takes all the new breakpoints that are not associated with any other group.
Field Summary | |
protected com.bluemarsh.util.IntHashtable |
breakpointsTable
Table of all breakpoints, keyed by a unique number. |
protected BreakpointGroup |
defaultGroup
The default breakpoint group, into which all new groups and breakpoints will go by default. |
protected com.sun.jdi.request.EventRequestManager |
eventManager
The EventRequestManager for this session. |
protected int |
lastBreakpointNumber
Value representing the last number assigned to a new breakpoint. |
protected com.bluemarsh.util.EventListenerList |
listeners
List of breakpoint listeners. |
protected boolean |
listeningForClassPrepare
If true, indicates we are presently listening for class prepare events from the debuggee VM. |
protected static Category |
logCategory
Reporting category. |
protected Session |
owningSession
Session that owns this breakpoint manager. |
Fields inherited from class com.bluemarsh.jswat.DefaultManager |
swat |
Fields inherited from interface com.bluemarsh.jswat.event.VMEventListener |
PRIORITY_BREAKPOINT, PRIORITY_DEFAULT, PRIORITY_HIGH, PRIORITY_HIGHEST, PRIORITY_LOW, PRIORITY_LOWEST, PRIORITY_SESSION |
Constructor Summary | |
BreakpointManager()
Creates a BreakpointManager with the default parameters. |
Method Summary | |
void |
activate(Session session)
Ready this breakpoint manager for handling breakpoint requests. |
void |
addBreakListener(BreakpointListener listener)
Add a breakpoint listener to this manager object. |
void |
addBreakpoint(Breakpoint bp)
Adds the given breakpoint to this breakpoint group. |
void |
addGroupListener(GroupListener listener)
Add a breakpoint group listener to this manager object. |
void |
addNewBreakpoint(Breakpoint bp)
Adds the given breakpoint to this breakpoint group and initializes and resolves it. |
int |
breakpointCount(boolean recurse)
Returns a count of the breakpoints under this manager. |
java.util.Iterator |
breakpoints(boolean recurse)
Returns an iterator over the set of breakpoints under this manager. |
void |
close(Session session)
Called when the Session is about to close down. |
Breakpoint |
createBreakpoint(java.lang.String classPattern,
int line)
Creates a Breakpoint to stop at the specified line within the specified class. |
Breakpoint |
createBreakpoint(java.lang.String classPattern,
java.lang.String methodId,
java.util.List methodArgs)
Creates a Breakpoint to stop at the specified method within the specified class. |
BreakpointGroup |
createBreakpointGroup(java.lang.String name)
Creates a new breakpoint group and adds it to this manager. |
BreakpointGroup |
createBreakpointGroup(java.lang.String name,
BreakpointGroup parent)
Creates a new breakpoint group and adds it to the given breakpoint group. |
void |
createExceptionCatch()
Creates a Breakpoint to stop when any uncaught exception is thrown. |
Breakpoint |
createExceptionCatch(java.lang.String classPattern)
Creates a Breakpoint to stop when the specified exception occurs. |
void |
deactivate(Session session)
Prepare the breakpoint manager for disconnection from the virtual machine we're debugging. |
void |
disableBreakpoint(Breakpoint bp)
Disables the given breakpoint and notifies any listeners. |
void |
disableBreakpointGroup(BreakpointGroup group)
Disables the given breakpoint group and notifies any listeners. |
void |
enableBreakpoint(Breakpoint bp)
Enables the given breakpoint and notifies any listeners. |
void |
enableBreakpointGroup(BreakpointGroup group)
Enables the given breakpoint group and notifies any listeners. |
boolean |
eventOccurred(com.sun.jdi.event.Event e)
Invoked when a VM event has occurred. |
protected void |
fireChange(Breakpoint bp,
int type)
Let all the change listeners know of a recent change in the breakpoints. |
protected void |
fireGroupChange(BreakpointGroup group,
int type)
Let all the group change listeners know of a recent change in the breakpoint groups. |
Breakpoint |
getBreakpoint(int n)
Retrieve the nth breakpoint. |
Breakpoint |
getBreakpoint(com.sun.jdi.ReferenceType cls,
int line)
Look through the existing breakpoints to see if there is one with the given class type and line number. |
int |
getBreakpointNumber(Breakpoint bp)
Retrieve the number assigned to the given breakpoint. |
BreakpointGroup |
getDefaultGroup()
Returns the default breakpoint group. |
java.util.Iterator |
groups(boolean recurse)
Returns an iterator over the set of groups under this manager. |
void |
init(Session session)
Called after the Session has instantiated this mananger. |
protected void |
listenForClassPrepareEvents()
Listen to all class prepare events. |
Breakpoint |
parseBreakpointSpec(com.bluemarsh.util.StringTokenizer tokenizer)
Try to parse the given user breakpoint specification into it's component parts and create a Breakpoint object. |
void |
removeBreakListener(BreakpointListener listener)
Remove a break listener from the listener list. |
void |
removeBreakpoint(Breakpoint bp)
Removes the given breakpoint from this breakpoint manager. |
void |
removeBreakpointGroup(BreakpointGroup group)
Removes the given breakpoint group from this breakpoint manager. |
void |
removeGroupListener(GroupListener listener)
Remove a breakpoint group listener from the listener list. |
void |
resolveBreakpoint(ResolvableBreakpoint bp)
Try to resolve the given breakpoint. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static Category logCategory
protected com.sun.jdi.request.EventRequestManager eventManager
protected com.bluemarsh.util.EventListenerList listeners
protected Session owningSession
protected boolean listeningForClassPrepare
protected BreakpointGroup defaultGroup
protected com.bluemarsh.util.IntHashtable breakpointsTable
lastBreakpointNumber
protected int lastBreakpointNumber
breakpointsTable
Constructor Detail |
public BreakpointManager()
Method Detail |
public void activate(Session session)
activate
in class DefaultManager
session
- Session being activated.public void addBreakListener(BreakpointListener listener)
listener
- new listener to add notification listpublic void addBreakpoint(Breakpoint bp)
bp
- breakpoint to add.public void addGroupListener(GroupListener listener)
listener
- new listener to add notification listpublic void addNewBreakpoint(Breakpoint bp) throws ResolveException
bp
- breakpoint to add.ResolveException
- Thrown if error resolving breakpoint.public int breakpointCount(boolean recurse)
recurse
- true to include subgroup counts, false to ignore
subgroups.public java.util.Iterator breakpoints(boolean recurse)
recurse
- true to recurse through all the groups.public void close(Session session)
close
in class DefaultManager
session
- Session being closed.public Breakpoint createBreakpoint(java.lang.String classPattern, int line) throws java.lang.ClassNotFoundException, ResolveException
classPattern
- class name pattern.line
- line within class at which to stop.java.lang.ClassNotFoundException
- Thrown if the class pattern was invalid.ResolveException
- Thrown if error resolving breakpoint request.public Breakpoint createBreakpoint(java.lang.String classPattern, java.lang.String methodId, java.util.List methodArgs) throws java.lang.ClassNotFoundException, MalformedMemberNameException, ResolveException
classPattern
- class name pattern.methodId
- name of method.methodArgs
- list of argument types in method.java.lang.ClassNotFoundException
- Thrown if the class pattern was invalid.ResolveException
- Thrown if error resolving breakpoint request.public BreakpointGroup createBreakpointGroup(java.lang.String name)
name
- new breakpoint group's name.public BreakpointGroup createBreakpointGroup(java.lang.String name, BreakpointGroup parent)
name
- new breakpoint group's name.parent
- parent breakpoint group.public Breakpoint createExceptionCatch(java.lang.String classPattern) throws java.lang.ClassNotFoundException, ResolveException
classPattern
- name of the exception to catch.java.lang.ClassNotFoundException
- Thrown if the class pattern was invalid.ResolveException
- Thrown if error resolving breakpoint request.public void createExceptionCatch()
java.lang.IllegalStateException
- Thrown if the session is not currently active.public void deactivate(Session session)
activate
method.deactivate
in class DefaultManager
session
- Session being deactivated.public void disableBreakpoint(Breakpoint bp)
bp
- Breakpoint to disable.public void disableBreakpointGroup(BreakpointGroup group)
group
- breakpoint group to disable.public void enableBreakpoint(Breakpoint bp)
bp
- Breakpoint to enable.public void enableBreakpointGroup(BreakpointGroup group)
group
- breakpoint group to enable.public boolean eventOccurred(com.sun.jdi.event.Event e)
eventOccurred
in interface VMEventListener
e
- VM event (class prepare event)protected void fireChange(Breakpoint bp, int type)
bp
- breakpointtype
- breakpoint event typeprotected void fireGroupChange(BreakpointGroup group, int type)
group
- breakpoint group.type
- breakpoint group event type.public Breakpoint getBreakpoint(com.sun.jdi.ReferenceType cls, int line)
cls
- class type.line
- line number.public Breakpoint getBreakpoint(int n)
n
- breakpoint number.n
value.public int getBreakpointNumber(Breakpoint bp)
bp
- breakpoint.public BreakpointGroup getDefaultGroup()
public java.util.Iterator groups(boolean recurse)
recurse
- true to iterate over all subgroups.public void init(Session session)
Session.getManager()
.init
in class DefaultManager
session
- Session initializing this manager.protected void listenForClassPrepareEvents()
public Breakpoint parseBreakpointSpec(com.bluemarsh.util.StringTokenizer tokenizer) throws java.lang.ClassNotFoundException, java.lang.IllegalArgumentException, MalformedMemberNameException, java.lang.NumberFormatException, ResolveException
tokenizer
- String tokenizer to parse.java.lang.ClassNotFoundException
- Thrown if class name is invalid or missing.java.lang.IllegalArgumentException
- Thrown if specification is missing.MalformedMemberNameException
- Thrown if method name is invalid or missing.java.lang.NumberFormatException
- Thrown if line number is invalid or missing.ResolveException
- Thrown if there was a problem resolving the breakpoint.public void removeBreakListener(BreakpointListener listener)
listener
- listener to remove from notification listpublic void removeBreakpoint(Breakpoint bp)
bp
- breakpoint to remove.public void removeBreakpointGroup(BreakpointGroup group)
group
- breakpoint group to remove.java.lang.IllegalArgumentException
- Thrown if the group is the default group.public void removeGroupListener(GroupListener listener)
listener
- listener to remove from notification listpublic void resolveBreakpoint(ResolvableBreakpoint bp) throws ResolveException
bp
- breakpoint to be resolved.ResolveException
- Thrown if error resolving breakpoint.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |