|
org.netbeans.api.debugger/1 1.26.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.api.debugger.DebuggerManager
public final class DebuggerManager
The root class of Debugger APIs. DebuggerManager manages list of
Sessions,
Breakpoints and
Watches.
| Description | |
| Functionality |
Start & finish debugging:
DebuggerManager manages a process of starting a new debugging (
startDebugging(org.netbeans.api.debugger.DebuggerInfo)). It cooperates with all installed
DebuggerEngineProviders to create a new
Session (or Sessions) and a new
DebuggerEngine (or Engines).
It supports kill all sessions too (finishAllSessions()).
Sessions management: DebuggerManager keeps list of all Sessions (getSessions()),
and manages current session (getCurrentSession(),
setCurrentSession(org.netbeans.api.debugger.Session)).
Engine management: DebuggerManager provides current engine ( getCurrentEngine()).
Current engine is derivated from current session. So,
debuggerManager.getCurrentEngine () == debuggerManager.
getCurrentSession.getCurrentEngine ()
should be always true.
Breakpoints management: DebuggerManager keeps list of all shared breakpoints ( getBreakpoints()).
Breakpoint can be added (addBreakpoint(org.netbeans.api.debugger.Breakpoint)) and removed
(removeBreakpoint(org.netbeans.api.debugger.Breakpoint)).
Watches management: DebuggerManager keeps list of all shared watches ( getWatches()).
Watch can be created & added (createWatch(java.lang.String)).
Support for listening: DebuggerManager propagates all changes to two type of listeners - general PropertyChangeListener and specific
DebuggerManagerListener.
|
| Clinents / Providers |
DebuggerCore module should be the only one provider of this abstract class.
This class should be called from debugger plug-in modules and from debugger
UI modules.
|
| Lifecycle |
The only one instance of DebuggerManager should exist, and it should be
created in getDebuggerManager() method.
|
| Evolution | No method should be removed from this class, but some functionality can be added. |
| Field Summary | |
|---|---|
static String |
PROP_BREAKPOINTS
Name of property for the set of breakpoints in the system. |
static String |
PROP_BREAKPOINTS_INIT
Name of property for the set of breakpoints in the system. |
static String |
PROP_CURRENT_ENGINE
Name of property for current debugger engine. |
static String |
PROP_CURRENT_SESSION
Name of property for current debugger session. |
static String |
PROP_DEBUGGER_ENGINES
Name of property for set of running debugger engines. |
static String |
PROP_SESSIONS
Name of property for set of running debugger sessions. |
static String |
PROP_WATCHES
Name of property for the set of watches in the system. |
static String |
PROP_WATCHES_INIT
Name of property for the set of watches in the system. |
| Method Summary | ||
|---|---|---|
void |
addBreakpoint(Breakpoint breakpoint)
Adds a new breakpoint. |
|
void |
addDebuggerListener(DebuggerManagerListener l)
This listener notificates about changes of breakpoints, watches and threads. |
|
void |
addDebuggerListener(String propertyName,
DebuggerManagerListener l)
Add a debuggerManager listener to changes of watches and breakpoints. |
|
Watch |
createWatch(int index,
String expr)
Creates a watch with its expression set to an initial value and add it at the specific position |
|
Watch |
createWatch(String expr)
Creates a watch with its expression set to an initial value. |
|
void |
finishAllSessions()
Kills all Sessions and
DebuggerEngines. |
|
ActionsManager |
getActionsManager()
|
|
Breakpoint[] |
getBreakpoints()
Gets all registered breakpoints. |
|
DebuggerEngine |
getCurrentEngine()
Returns current debugger engine or null. |
|
Session |
getCurrentSession()
Returns current debugger session or null. |
|
DebuggerEngine[] |
getDebuggerEngines()
Returns set of running debugger engines. |
|
static DebuggerManager |
getDebuggerManager()
Returns default instance of DebuggerManager. |
|
Session[] |
getSessions()
Returns set of running debugger sessions. |
|
Watch[] |
getWatches()
Gets all shared watches in the system. |
|
static ContextProvider |
join(ContextProvider cp1,
ContextProvider cp2)
Join two lookups together. |
|
|
lookup(String folder,
Class<T> service)
Returns list of services of given type from given folder. |
|
|
lookupFirst(String folder,
Class<T> service)
Returns one service of given type from given folder. |
|
void |
removeAllWatches()
Removes all watches from the system. |
|
void |
removeBreakpoint(Breakpoint breakpoint)
Removes breakpoint. |
|
void |
removeDebuggerListener(DebuggerManagerListener l)
Removes debugger listener. |
|
void |
removeDebuggerListener(String propertyName,
DebuggerManagerListener l)
Remove a debuggerManager listener to changes of watches and breakpoints. |
|
void |
reorderWatches(int[] permutation)
Reorders watches with given permutation. |
|
void |
setCurrentSession(Session session)
Sets current debugger session. |
|
DebuggerEngine[] |
startDebugging(DebuggerInfo info)
Start a new debugging for given DebuggerInfo. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PROP_BREAKPOINTS_INIT
public static final String PROP_BREAKPOINTS
public static final String PROP_CURRENT_ENGINE
public static final String PROP_CURRENT_SESSION
public static final String PROP_SESSIONS
public static final String PROP_DEBUGGER_ENGINES
public static final String PROP_WATCHES
public static final String PROP_WATCHES_INIT
| Method Detail |
|---|
public static DebuggerManager getDebuggerManager()
public ActionsManager getActionsManager()
public <T> List<? extends T> lookup(String folder,
Class<T> service)
lookup in interface ContextProviderservice - a type of service to look forfolder - a folder name or null
public <T> T lookupFirst(String folder,
Class<T> service)
lookupFirst in interface ContextProviderservice - a type of service to look forfolder - a folder name or null
public static ContextProvider join(ContextProvider cp1,
ContextProvider cp2)
lookup method will additionally implement Customizer.
cp1 - first lookupcp2 - second lookup
public DebuggerEngine[] startDebugging(DebuggerInfo info)
DebuggerInfo. DebuggerInfo provides
information needed to start new debugging. DebuggerManager finds
all SessionProviders and
DelegatingSessionProviders
installed for given DebuggerInfo, and creates a new
Session(s).
After that it looks for all
DebuggerEngineProviders and
DelegatingDebuggerEngineProviders
installed for Session, and crates a new
DebuggerEngine(s).
Cancellable),
this startup sequence can be canceled via Thread.interrupt() while
startDebugging() method is waiting for the action providers.
info - debugger startup info
public void finishAllSessions()
Sessions and
DebuggerEngines.
public Session getCurrentSession()
null.
nullpublic void setCurrentSession(Session session)
session - a session to be currentpublic Session[] getSessions()
public DebuggerEngine[] getDebuggerEngines()
public DebuggerEngine getCurrentEngine()
null.
nullpublic void addBreakpoint(Breakpoint breakpoint)
breakpoint - a new breakpointpublic void removeBreakpoint(Breakpoint breakpoint)
breakpoint - a breakpoint to be removedpublic Breakpoint[] getBreakpoints()
public Watch createWatch(String expr)
expr - expression to watch for (the format is the responsibility
of the debugger plug-in implementation, but it is typically
a variable name).
public Watch createWatch(int index,
String expr)
index - the position at which the specified watch is to be insertedexpr - expression to watch for (the format is the responsibility
of the debugger plug-in implementation, but it is typically
a variable name).
ArrayIndexOutOfBoundsException - if the index is out of range
(index < 0 || index > getWatches().length)public Watch[] getWatches()
public void removeAllWatches()
public void reorderWatches(int[] permutation)
throws IllegalArgumentException
permutation - The permutation with the length of current watches list
IllegalArgumentException - if the permutation is not valid permutationpublic void addDebuggerListener(DebuggerManagerListener l)
l - listener object.public void removeDebuggerListener(DebuggerManagerListener l)
l - listener object.
public void addDebuggerListener(String propertyName,
DebuggerManagerListener l)
propertyName - a name of property to listen onl - the debuggerManager listener to add
public void removeDebuggerListener(String propertyName,
DebuggerManagerListener l)
propertyName - a name of property to listen onl - the debuggerManager listener to remove
|
org.netbeans.api.debugger/1 1.26.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||