站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 4.1.0

DebuggerManager (NetBeans Debugger Core API) - NetBeans API Javadoc 4.1.0

 

org.netbeans.api.debugger
Class DebuggerManager

java.lang.Object
  extended byorg.netbeans.api.debugger.DebuggerManager

public final class DebuggerManager
extends Object

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(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.
 List lookup(String folder, Class service)
          Returns list of services of given type from given folder.
 Object lookupFirst(String folder, Class 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 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

PROP_BREAKPOINTS_INIT

public static final String PROP_BREAKPOINTS_INIT
Name of property for the set of breakpoints in the system.

See Also:
Constant Field Values

PROP_BREAKPOINTS

public static final String PROP_BREAKPOINTS
Name of property for the set of breakpoints in the system.

See Also:
Constant Field Values

PROP_CURRENT_ENGINE

public static final String PROP_CURRENT_ENGINE
Name of property for current debugger engine.

See Also:
Constant Field Values

PROP_CURRENT_SESSION

public static final String PROP_CURRENT_SESSION
Name of property for current debugger session.

See Also:
Constant Field Values

PROP_SESSIONS

public static final String PROP_SESSIONS
Name of property for set of running debugger sessions.

See Also:
Constant Field Values

PROP_DEBUGGER_ENGINES

public static final String PROP_DEBUGGER_ENGINES
Name of property for set of running debugger engines.

See Also:
Constant Field Values

PROP_WATCHES

public static final String PROP_WATCHES
Name of property for the set of watches in the system.

See Also:
Constant Field Values

PROP_WATCHES_INIT

public static final String PROP_WATCHES_INIT
Name of property for the set of watches in the system.

See Also:
Constant Field Values
Method Detail

getDebuggerManager

public static DebuggerManager getDebuggerManager()
Returns default instance of DebuggerManager.

Returns:
default instance of DebuggerManager

getActionsManager

public ActionsManager getActionsManager()

lookup

public List lookup(String folder,
                   Class service)
Returns list of services of given type from given folder.

Parameters:
service - a type of service to look for
Returns:
list of services of given type

lookupFirst

public Object lookupFirst(String folder,
                          Class service)
Returns one service of given type from given folder.

Parameters:
service - a type of service to look for
Returns:
ne service of given type

startDebugging

public DebuggerEngine[] startDebugging(DebuggerInfo info)
Start a new debugging for given 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).

Parameters:
info - debugger startup info
Returns:
DebuggerEngines started for given info

finishAllSessions

public void finishAllSessions()
Kills all Sessions and DebuggerEngines.


getCurrentSession

public Session getCurrentSession()
Returns current debugger session or null.

Returns:
current debugger session or null

setCurrentSession

public void setCurrentSession(Session session)
Sets current debugger session.

Parameters:
session - a session to be current

getSessions

public Session[] getSessions()
Returns set of running debugger sessions.

Returns:
set of running debugger sessions

getDebuggerEngines

public DebuggerEngine[] getDebuggerEngines()
Returns set of running debugger engines.

Returns:
set of running debugger engines

getCurrentEngine

public DebuggerEngine getCurrentEngine()
Returns current debugger engine or null.

Returns:
current debugger engine or null

addBreakpoint

public void addBreakpoint(Breakpoint breakpoint)
Adds a new breakpoint.

Parameters:
breakpoint - a new breakpoint

removeBreakpoint

public void removeBreakpoint(Breakpoint breakpoint)
Removes breakpoint.

Parameters:
breakpoint - a breakpoint to be removed

getBreakpoints

public Breakpoint[] getBreakpoints()
Gets all registered breakpoints.

Returns:
all breakpoints

createWatch

public Watch createWatch(String expr)
Creates a watch with its expression set to an initial value. Also allows creation of a hidden watch (not presented to the user), for example for internal use in the editor to obtain values of variables under the mouse pointer.

Parameters:
expr - expression to watch for (the format is the responsibility of the debugger plug-in implementation, but it is typically a variable name).
Returns:
the new watch

getWatches

public Watch[] getWatches()
Gets all shared watches in the system.

Returns:
all watches

removeAllWatches

public void removeAllWatches()
Removes all watches from the system.


addDebuggerListener

public void addDebuggerListener(DebuggerManagerListener l)
This listener notificates about changes of breakpoints, watches and threads.

Parameters:
l - listener object.

removeDebuggerListener

public void removeDebuggerListener(DebuggerManagerListener l)
Removes debugger listener.

Parameters:
l - listener object.

addDebuggerListener

public void addDebuggerListener(String propertyName,
                                DebuggerManagerListener l)
Add a debuggerManager listener to changes of watches and breakpoints.

Parameters:
propertyName - a name of property to listen on
l - the debuggerManager listener to add

removeDebuggerListener

public void removeDebuggerListener(String propertyName,
                                   DebuggerManagerListener l)
Remove a debuggerManager listener to changes of watches and breakpoints.

Parameters:
propertyName - a name of property to listen on
l - the debuggerManager listener to remove

 

Built on May 4 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.