Package org.apache.jmeter.gui.action
Class Restart
java.lang.Object
org.apache.jmeter.gui.action.AbstractAction
org.apache.jmeter.gui.action.AbstractActionWithNoRunningTest
org.apache.jmeter.gui.action.Restart
- All Implemented Interfaces:
Command
,MenuCreator
@AutoService({Command.class,MenuCreator.class})
public class Restart
extends AbstractActionWithNoRunningTest
implements MenuCreator
Restart JMeter
Based on https://dzone.com/articles/programmatically-restart-java
- Since:
- 5.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jmeter.gui.plugin.MenuCreator
MenuCreator.MENU_LOCATION
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Sun property pointing the main class and its arguments. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called to handleActionEvent
only if no test is runningMenuItems to be added in location menuJMenu[]
void
Update Top Level menu on Locale Changeboolean
localeChanged
(MenuElement menu) static void
restartApplication
(Runnable runBeforeRestart) Restart the current Java applicationMethods inherited from class org.apache.jmeter.gui.action.AbstractActionWithNoRunningTest
doAction
Methods inherited from class org.apache.jmeter.gui.action.AbstractAction
getParentFrame, popupCheckExistingFileListener, popupShouldSave
-
Field Details
-
SUN_JAVA_COMMAND
Sun property pointing the main class and its arguments. Might not be defined on non Hotspot VM implementations.- See Also:
-
-
Constructor Details
-
Restart
public Restart()
-
-
Method Details
-
doActionAfterCheck
Description copied from class:AbstractActionWithNoRunningTest
Called to handleActionEvent
only if no test is running- Specified by:
doActionAfterCheck
in classAbstractActionWithNoRunningTest
- Parameters:
e
-ActionEvent
- See Also:
-
restartApplication
Restart the current Java application- Parameters:
runBeforeRestart
- some custom code to be run before restarting
-
getActionNames
- Specified by:
getActionNames
in interfaceCommand
- See Also:
-
getMenuItemsAtLocation
Description copied from interface:MenuCreator
MenuItems to be added in location menu- Specified by:
getMenuItemsAtLocation
in interfaceMenuCreator
- Parameters:
location
- in top menu- Returns:
- array of
JMenuItem
-
getTopLevelMenus
- Specified by:
getTopLevelMenus
in interfaceMenuCreator
- Returns:
- array of JMenu to be put as top level menu between Options and Help
-
localeChanged
- Specified by:
localeChanged
in interfaceMenuCreator
- Parameters:
menu
- MenuElement- Returns:
- true if menu was concerned by Locale change
-
localeChanged
public void localeChanged()Description copied from interface:MenuCreator
Update Top Level menu on Locale Change- Specified by:
localeChanged
in interfaceMenuCreator
-