Extension SDK

oracle.ide.runner
Interface Runner


public interface Runner

The Runner class provides methods that interact with the runner. It is used by the runner, debugger, profiler, and code coach.


Method Summary
 void addTerminateMenu(RunProcess runProcess)
          Adds a terminate menu item for the given RunProcess to the Run -> Terminate submenu.
 boolean couldNodeBeRunnable(Node node)
          Returns true if there is a StarterFactory registered for the class of the given node.
 boolean couldNodeBeRunnable(Node node, java.lang.Class starterFactorySubClass)
          Returns true if there is a StarterFactory registered for the class of the given node and the StarterFactory is an instanceof the specified subclass.
 java.lang.Class[] getClassesWithRegisteredStarterFactory()
          Returns an array of target classes for which there are one or more StarterFactory registered.
 Folder getProcessesFolder()
          Returns the folder within the run manager that contains active processes.
 StarterFactory[] getRegisteredStarterFactories(java.lang.Class targetClass)
          Returns an array of StarterFactory that have been registered for the given target class.
 StarterFactory[] getRegisteredStarterFactories(java.lang.Class targetClass, java.lang.Class starterFactorySubClass)
          Returns an array of StarterFactory that have been registered for the given target class, and that are instanceof the specified subclass.
 Folder getRunManagerFolder()
          Returns the Run Manager Folder
 NavigatorWindow getRunManagerWindow()
          Returns the Run Manager Window
 javax.swing.JMenu getRunMenu()
          Returns the run menu that the Run Manager has added to the main menu bar.
 StarterFactory[] getStarterFactoriesForTarget(java.lang.Class targetClass)
          Returns an array of StarterFactory that have been registered for a class that is the same as the given target class or one of its superclasses.
 StarterFactory[] getStarterFactoriesForTarget(java.lang.Class targetClass, java.lang.Class starterFactorySubClass)
          Returns an array of StarterFactory that have been registered for a class that is the same as the given target class or one of its superclasses, and that are instanceof the specified subclass.
 IdeAction getViewRunManagerAction()
          Return the action for View | Run Manager.
 boolean isRunManagerVisible()
          Returns true if the run manager is visible
 boolean isRunning(Project project)
          This methods checks if any application in the specified project are running.
 void registerStarterFactory(java.lang.Class targetClass, StarterFactory starterFactory)
          Registers the specified StarterFactory as a StarterFactory that can create a Starter that may start processes with the specified type of target.
 void removeTerminateMenu(RunProcess runProcess)
          Removes the terminate menu item for the given RunProcess from the Run -> Terminate submenu.
 boolean selectProcess(RunProcess runProcess)
          Selects the given process in the Run Manager window.
 boolean terminate(Project project, boolean force)
          This methods requests the runner to terminate all processe running under the specified project.
 void unregisterStarterFactory(java.lang.Class targetClass, StarterFactory starterFactory)
          Unregisters the specified StarterFactory for the specified type of target.
 void viewRunManager()
          Shows the Run Manager window.
 

Method Detail

isRunning

public boolean isRunning(Project project)
This methods checks if any application in the specified project are running. If the project parameter is null, the method checks if any application under any project is running.

Returns:
true if there is an application running.

terminate

public boolean terminate(Project project,
                         boolean force)
This methods requests the runner to terminate all processe running under the specified project. If the project parameter is null, the method tries to terminate all running processes. If the force parameter is false, the user is asked to confirm termination of any running process.

Returns:
true if termination was not cancelled.

getRunMenu

public javax.swing.JMenu getRunMenu()
Returns the run menu that the Run Manager has added to the main menu bar.

Returns:
the run menu

getRunManagerWindow

public NavigatorWindow getRunManagerWindow()
Returns the Run Manager Window


getRunManagerFolder

public Folder getRunManagerFolder()
Returns the Run Manager Folder


getProcessesFolder

public Folder getProcessesFolder()
Returns the folder within the run manager that contains active processes.

Returns:
the processes folder

viewRunManager

public void viewRunManager()
Shows the Run Manager window.


isRunManagerVisible

public boolean isRunManagerVisible()
Returns true if the run manager is visible


getViewRunManagerAction

public IdeAction getViewRunManagerAction()
Return the action for View | Run Manager.


selectProcess

public boolean selectProcess(RunProcess runProcess)
Selects the given process in the Run Manager window.

Parameters:
runProcess - the process to be selected.

addTerminateMenu

public void addTerminateMenu(RunProcess runProcess)
Adds a terminate menu item for the given RunProcess to the Run -> Terminate submenu.

Parameters:
runProcess - the RunProcess that needs a terminate menu

removeTerminateMenu

public void removeTerminateMenu(RunProcess runProcess)
Removes the terminate menu item for the given RunProcess from the Run -> Terminate submenu.

Parameters:
runProcess - the RunProcess that has a terminate menu that should be removed

registerStarterFactory

public void registerStarterFactory(java.lang.Class targetClass,
                                   StarterFactory starterFactory)
Registers the specified StarterFactory as a StarterFactory that can create a Starter that may start processes with the specified type of target.

For example, if the targetClass param specifies JavaNode, then the starterFactory param should be able to create a Starter that may be able to start some processes where the target is a JavaNode.

A StarterFactory or its corresponding Starter may refuse to start a process at any time for any reason. For example, the StarterFactory associated with the Starter that starts Java applications would be registered with the target class JavaNode, but would refuse to start a process if the target class did not contain a "main" method.

More than one starter factory can be registered for the same target class. For example, the StarterFactory corresponding to the Starter that starts Java applications and the StarterFactory corresponding to the Starter that starts Java servlets would both be registered for the target class JavaNode. The last StarterFactory registered for a given class has first chance.

Also, one starter factory can be registered for more than one target class. For example, it may make sense to have one StarterFactory and corresponding Starter that starts both Java servlets and JSP pages. That single StarterFactory would be registered for the target classes JavaNode and JspSourceNode.

Parameters:
targetClass - the class of the target element
starterFactory - the starterFactory to register

unregisterStarterFactory

public void unregisterStarterFactory(java.lang.Class targetClass,
                                     StarterFactory starterFactory)
Unregisters the specified StarterFactory for the specified type of target.

A new StarterFactory that wants to obscure, modify, or extend the behavior of an existing StarterFactory may unregister the existing StarterFactory.

Parameters:
targetClass - the class of the target element
starterFactory - the starterFactory to unregister

getClassesWithRegisteredStarterFactory

public java.lang.Class[] getClassesWithRegisteredStarterFactory()
Returns an array of target classes for which there are one or more StarterFactory registered.

Returns:
an array of Class

getRegisteredStarterFactories

public StarterFactory[] getRegisteredStarterFactories(java.lang.Class targetClass)
Returns an array of StarterFactory that have been registered for the given target class.

Parameters:
targetClass - the class of the target element
Returns:
an array of StarterFactory

getRegisteredStarterFactories

public StarterFactory[] getRegisteredStarterFactories(java.lang.Class targetClass,
                                                      java.lang.Class starterFactorySubClass)
Returns an array of StarterFactory that have been registered for the given target class, and that are instanceof the specified subclass.

Parameters:
targetClass - the class of the target element
starterFactorySubClass - a subclass of StarterFactory
Returns:
an array of StarterFactory

getStarterFactoriesForTarget

public StarterFactory[] getStarterFactoriesForTarget(java.lang.Class targetClass)
Returns an array of StarterFactory that have been registered for a class that is the same as the given target class or one of its superclasses.

Parameters:
targetClass - the class of the target element
Returns:
an array of StarterFactory

getStarterFactoriesForTarget

public StarterFactory[] getStarterFactoriesForTarget(java.lang.Class targetClass,
                                                     java.lang.Class starterFactorySubClass)
Returns an array of StarterFactory that have been registered for a class that is the same as the given target class or one of its superclasses, and that are instanceof the specified subclass.

Parameters:
targetClass - the class of the target element
starterFactorySubClass - a subclass of StarterFactory
Returns:
an array of StarterFactory

couldNodeBeRunnable

public boolean couldNodeBeRunnable(Node node)
Returns true if there is a StarterFactory registered for the class of the given node.

Returns:
true if a StarterFactory has been registered; false otherwise.

couldNodeBeRunnable

public boolean couldNodeBeRunnable(Node node,
                                   java.lang.Class starterFactorySubClass)
Returns true if there is a StarterFactory registered for the class of the given node and the StarterFactory is an instanceof the specified subclass.

Parameters:
starterFactorySubClass - a subclass of StarterFactory
Returns:
true if a StarterFactory has been registered; false otherwise.

Extension SDK

 

Copyright ©1997, 2003, Oracle. All rights reserved.