Package org.eclipse.debug.core
Class Launch
java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.eclipse.debug.core.Launch
- All Implemented Interfaces:
IAdaptable,IDebugEventSetListener,ILaunch,ILaunchConfigurationListener,ILaunchListener,IDisconnect,ITerminate
public class Launch
extends PlatformObject
implements ILaunch, IDisconnect, ILaunchListener, ILaunchConfigurationListener, IDebugEventSetListener
A launch is the result of launching a debug session
and/or one or more system processes. This class provides
a public implementation of
ILaunch for client
use.
Clients may instantiate this class. Clients may subclass this class.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLaunch(ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator) Constructs a launch with the specified attributes. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDebugTarget(IDebugTarget target) Adds the given debug target to this launch.voidaddProcess(IProcess process) Adds the given process to this launch.protected voidaddProcesses(IProcess[] processes) Adds the given processes to this launch.booleanReturns whether any processes or targets can be disconnected.booleanReturns whether this element can be terminated.voidDisconnects this element from its target.protected voidNotifies listeners that this launch has changed.protected voidNotifies listeners that this launch has terminated.<T> TgetAdapter(Class<T> adapter) Returns an object which is an instance of the given class associated with this object.getAttribute(String key) Returns the value of a client defined attribute.Object[]Returns the children of this launch - a collection of one or more debug targets and processes, possibly empty.Returns the primary (first) debug target associated with this launch, ornullif no debug target is associated with this launch.Returns all the debug targets associated with this launch, or an empty collection if no debug targets are associated with this launch.protected List<IDebugTarget> Returns the debug targets associated with this launch, in its internal form - a listReturns the configuration that was launched, ornullif no configuration was launched.protected ILaunchManagerReturns the launch manager.Returns the mode of this launch - one of the mode constants defined by the launch manager.IProcess[]Returns the processes that were launched, or an empty collection if no processes were launched.Returns the processes associated with this launch, in its internal form - a list.Returns the source locator to use for locating source elements for the debug target associated with this launch, ornullif source lookup is not supported.voidhandleDebugEvents(DebugEvent[] events) Notifies this listener of the given debug events.booleanReturns whether this launch contains at least one process or debug target.booleanReturns whether all of the contained targets and processes are disconnected.booleanReturns whether this element is terminated.voidlaunchAdded(ILaunch launch) Notifies this listener that the specified launch has been added.voidlaunchChanged(ILaunch launch) Notifies this listener that the specified launch has changed.voidlaunchConfigurationAdded(ILaunchConfiguration configuration) The given launch configuration has been created.voidlaunchConfigurationChanged(ILaunchConfiguration configuration) The given launch configuration has changed in some way.voidlaunchConfigurationRemoved(ILaunchConfiguration configuration) The given launch configuration has been deleted.voidlaunchRemoved(ILaunch launch) Notifies this listener that the specified launch has been removed.voidremoveDebugTarget(IDebugTarget target) Removes the given debug target from this launch.voidremoveProcess(IProcess process) Removes the given process from this launch.voidsetAttribute(String key, String value) Sets the value of a client defined attribute.voidsetSourceLocator(ISourceLocator sourceLocator) Sets the source locator to use for locating source elements for the debug target associated with this launch, ornullif source lookup is not supported.voidCauses this element to terminate, generating aTERMINATEevent.
-
Constructor Details
-
Launch
Constructs a launch with the specified attributes.- Parameters:
launchConfiguration- the configuration that was launchedmode- the mode of this launch - run or debug (constants defined byILaunchManager)locator- the source locator to use for this debug session, ornullif not supported
-
-
Method Details
-
canTerminate
public boolean canTerminate()Description copied from interface:ITerminateReturns whether this element can be terminated.- Specified by:
canTerminatein interfaceITerminate- Returns:
- whether this element can be terminated
- See Also:
-
getChildren
Description copied from interface:ILaunchReturns the children of this launch - a collection of one or more debug targets and processes, possibly empty.- Specified by:
getChildrenin interfaceILaunch- Returns:
- an array (element type:
IDebugTargetorIProcess), or an empty array - See Also:
-
getDebugTarget
Description copied from interface:ILaunchReturns the primary (first) debug target associated with this launch, ornullif no debug target is associated with this launch. All debug targets associated with this launch may be retrieved bygetDebugTargets().- Specified by:
getDebugTargetin interfaceILaunch- Returns:
- the primary debug target associated with this launch, or
null - See Also:
-
getProcesses
Description copied from interface:ILaunchReturns the processes that were launched, or an empty collection if no processes were launched.- Specified by:
getProcessesin interfaceILaunch- Returns:
- array of processes
- See Also:
-
getProcesses0
Returns the processes associated with this launch, in its internal form - a list.- Returns:
- list of processes
-
getSourceLocator
Description copied from interface:ILaunchReturns the source locator to use for locating source elements for the debug target associated with this launch, ornullif source lookup is not supported.- Specified by:
getSourceLocatorin interfaceILaunch- Returns:
- the source locator
- See Also:
-
setSourceLocator
Description copied from interface:ILaunchSets the source locator to use for locating source elements for the debug target associated with this launch, ornullif source lookup is not supported.- Specified by:
setSourceLocatorin interfaceILaunch- Parameters:
sourceLocator- source locator ornull- See Also:
-
isTerminated
public boolean isTerminated()Description copied from interface:ITerminateReturns whether this element is terminated.- Specified by:
isTerminatedin interfaceITerminate- Returns:
- whether this element is terminated
- See Also:
-
terminate
Description copied from interface:ITerminateCauses this element to terminate, generating aTERMINATEevent. Implementations may be blocking or non-blocking.- Specified by:
terminatein interfaceITerminate- Throws:
DebugException- on failure. Reasons include:- TARGET_REQUEST_FAILED - The request failed in the target
- NOT_SUPPORTED - The capability is not supported by the target
- See Also:
-
getLaunchMode
Description copied from interface:ILaunchReturns the mode of this launch - one of the mode constants defined by the launch manager.- Specified by:
getLaunchModein interfaceILaunch- Returns:
- the launch mode
- See Also:
-
getLaunchConfiguration
Description copied from interface:ILaunchReturns the configuration that was launched, ornullif no configuration was launched.- Specified by:
getLaunchConfigurationin interfaceILaunch- Returns:
- the launched configuration or
null - See Also:
-
setAttribute
Description copied from interface:ILaunchSets the value of a client defined attribute.- Specified by:
setAttributein interfaceILaunch- Parameters:
key- the attribute keyvalue- the attribute value- See Also:
-
getAttribute
Description copied from interface:ILaunchReturns the value of a client defined attribute.- Specified by:
getAttributein interfaceILaunch- Parameters:
key- the attribute key- Returns:
- value the attribute value, or
nullif undefined - See Also:
-
getDebugTargets
Description copied from interface:ILaunchReturns all the debug targets associated with this launch, or an empty collection if no debug targets are associated with this launch. The primary debug target is the first in the collection (if any).- Specified by:
getDebugTargetsin interfaceILaunch- Returns:
- array of debug targets
- See Also:
-
getDebugTargets0
Returns the debug targets associated with this launch, in its internal form - a list- Returns:
- list of debug targets
-
addDebugTarget
Description copied from interface:ILaunchAdds the given debug target to this launch. Has no effect if the given debug target is already associated with this launch. Registered listeners are notified that this launch has changed.- Specified by:
addDebugTargetin interfaceILaunch- Parameters:
target- debug target to add to this launch- See Also:
-
removeDebugTarget
Description copied from interface:ILaunchRemoves the given debug target from this launch. Has no effect if the given debug target is not already associated with this launch. Registered listeners are notified that this launch has changed.- Specified by:
removeDebugTargetin interfaceILaunch- Parameters:
target- debug target to remove from this launch- See Also:
-
addProcess
Description copied from interface:ILaunchAdds the given process to this launch. Has no effect if the given process is already associated with this launch. Registered listeners are notified that this launch has changed.- Specified by:
addProcessin interfaceILaunch- Parameters:
process- the process to add to this launch- See Also:
-
removeProcess
Description copied from interface:ILaunchRemoves the given process from this launch. Has no effect if the given process is not already associated with this launch. Registered listeners are notified that this launch has changed.- Specified by:
removeProcessin interfaceILaunch- Parameters:
process- the process to remove from this launch- See Also:
-
addProcesses
Adds the given processes to this launch.- Parameters:
processes- processes to add
-
fireChanged
protected void fireChanged()Notifies listeners that this launch has changed. Has no effect of this launch has not yet been properly created/initialized. -
fireTerminate
protected void fireTerminate()Notifies listeners that this launch has terminated. Has no effect of this launch has not yet been properly created/initialized. -
hasChildren
public boolean hasChildren()Description copied from interface:ILaunchReturns whether this launch contains at least one process or debug target.- Specified by:
hasChildrenin interfaceILaunch- Returns:
- whether this launch contains at least one process or debug target
- See Also:
-
canDisconnect
public boolean canDisconnect()Returns whether any processes or targets can be disconnected. Ones that are already terminated or disconnected are ignored.- Specified by:
canDisconnectin interfaceIDisconnect- Returns:
- whether this element can currently disconnect
- See Also:
-
disconnect
Description copied from interface:IDisconnectDisconnects this element from its target. Generally, disconnecting ends a debug session with a debug target, but allows the target program to continue running.- Specified by:
disconnectin interfaceIDisconnect- Throws:
DebugException- on failure. Reasons include:- TARGET_REQUEST_FAILED - The request failed in the target
- NOT_SUPPORTED - The capability is not supported by the target
- See Also:
-
isDisconnected
public boolean isDisconnected()Returns whether all of the contained targets and processes are disconnected. Processes that don't support disconnecting are not counted.- Specified by:
isDisconnectedin interfaceIDisconnect- Returns:
- whether this element is disconnected
- See Also:
-
launchRemoved
Description copied from interface:ILaunchListenerNotifies this listener that the specified launch has been removed.- Specified by:
launchRemovedin interfaceILaunchListener- Parameters:
launch- the removed launch
-
getLaunchManager
Returns the launch manager.- Returns:
- the launch manager.
-
launchAdded
Description copied from interface:ILaunchListenerNotifies this listener that the specified launch has been added.- Specified by:
launchAddedin interfaceILaunchListener- Parameters:
launch- the newly added launch
-
launchChanged
Description copied from interface:ILaunchListenerNotifies this listener that the specified launch has changed. For example, a process or debug target has been added to the launch.- Specified by:
launchChangedin interfaceILaunchListener- Parameters:
launch- the changed launch
-
launchConfigurationAdded
Description copied from interface:ILaunchConfigurationListenerThe given launch configuration has been created.- Specified by:
launchConfigurationAddedin interfaceILaunchConfigurationListener- Parameters:
configuration- the newly created launch configuration
-
launchConfigurationChanged
Description copied from interface:ILaunchConfigurationListenerThe given launch configuration has changed in some way. The configuration may be a working copy.- Specified by:
launchConfigurationChangedin interfaceILaunchConfigurationListener- Parameters:
configuration- the launch configuration that has changed
-
launchConfigurationRemoved
Description copied from interface:ILaunchConfigurationListenerThe given launch configuration has been deleted.The launch configuration no longer exists. Data stored in the configuration can no longer be accessed, however handle-only attributes of the launch configuration can be retrieved.
- Specified by:
launchConfigurationRemovedin interfaceILaunchConfigurationListener- Parameters:
configuration- the deleted launch configuration
-
handleDebugEvents
Description copied from interface:IDebugEventSetListenerNotifies this listener of the given debug events. All of the events in the given event collection occurred at the same location the program be run or debugged.- Specified by:
handleDebugEventsin interfaceIDebugEventSetListener- Parameters:
events- the debug events
-
getAdapter
Description copied from class:PlatformObjectReturns an object which is an instance of the given class associated with this object. Returnsnullif no such object can be found.This implementation of the method declared by
IAdaptablepasses the request along to the platform's adapter manager; roughlyPlatform.getAdapterManager().getAdapter(this, adapter). Subclasses may override this method (however, if they do so, they should invoke the method on their superclass to ensure that the Platform's adapter manager is consulted).- Specified by:
getAdapterin interfaceIAdaptable- Overrides:
getAdapterin classPlatformObject- Type Parameters:
T- the class type- Parameters:
adapter- the class to adapt to- Returns:
- the adapted object or
null - See Also:
-