Class RuntimeProcess

  • All Implemented Interfaces:
    IAdaptable, IProcess, ITerminate

    public class RuntimeProcess
    extends PlatformObject
    implements IProcess
    Standard implementation of an IProcess that wrappers a system process (java.lang.Process).

    Clients may subclass this class. Clients that need to replace the implementation of a streams proxy associated with an IProcess should subclass this class. Generally clients should not instantiate this class directly, but should instead call DebugPlugin.newProcess(...), which can delegate to an IProcessFactory if one is referenced by the associated launch configuration.

    See Also:
    IProcess, IProcessFactory
    • Constructor Detail

      • RuntimeProcess

        public RuntimeProcess​(ILaunch launch,
                              Process process,
                              String name,
                              Map<String,​String> attributes)
        Constructs a RuntimeProcess on the given system process with the given name, adding this process to the given launch.
        launch - the parent launch of this process
        process - underlying system process
        name - the label used for this process
        attributes - map of attributes used to initialize the attributes of this process, or null if none
    • Method Detail

      • setLaunch

        protected void setLaunch​(ILaunch launch)
        Sets the launch this process is contained in
        launch - the launch this process is contained in
      • getLaunch

        public ILaunch getLaunch()
        Description copied from interface: IProcess
        Returns the launch this element originated from.
        Specified by:
        getLaunch in interface IProcess
        the launch this process is contained in
        See Also:
      • getSystemProcess

        protected Process getSystemProcess()
        Returns the underlying system process associated with this process.
        system process
      • terminate

        public void terminate()
                       throws DebugException
        Description copied from interface: ITerminate
        Causes this element to terminate, generating a TERMINATE event. Implementations may be blocking or non-blocking.
        Specified by:
        terminate in interface ITerminate
        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:
      • terminated

        protected void terminated()
        Notification that the system process associated with this process has terminated.
      • getStreamsProxy

        public IStreamsProxy getStreamsProxy()
        Description copied from interface: IProcess
        Returns a proxy to the standard input, output, and error streams for this process, or null if not supported.
        Specified by:
        getStreamsProxy in interface IProcess
        a streams proxy, or null if not supported
        See Also:
      • createStreamsProxy

        protected IStreamsProxy createStreamsProxy()
        Creates and returns the streams proxy associated with this process.
        streams proxy
      • fireCreationEvent

        protected void fireCreationEvent()
        Fires a creation event.
      • fireEvent

        protected void fireEvent​(DebugEvent event)
        Fires the given debug event.
        event - debug event to fire
      • fireTerminateEvent

        protected void fireTerminateEvent()
        Fires a terminate event.
      • fireChangeEvent

        protected void fireChangeEvent()
        Fires a change event.
      • getAdapter

        public <T> T getAdapter​(Class<T> adapter)
        Description copied from class: PlatformObject
        Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.

        This implementation of the method declared by IAdaptable passes the request along to the platform's adapter manager; roughly Platform.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:
        getAdapter in interface IAdaptable
        getAdapter in class PlatformObject
        Type Parameters:
        T - the class type
        adapter - the class to adapt to
        the adapted object or null
        See Also: