Top Description Fields Constructors Methods
io.vertx.core.impl.launcher.commands

public Class ExecUtils

extends Object
Class Inheritance
Imports
io.vertx.core.impl.Utils, java.util.List

A couple of utility methods easing process creation.
Author
Clement Escoffier

Field Summary

Modifier and TypeField and Description
private static final String
private static String
osName

The os.name property is mandatory (from the Java Virtual Machine specification).

public static final int
PROCESS_ERROR_EXIT_CODE

Error code used when a spawn process cannot be found, created, or stopped smoothly.

private static final String
public static final int
SYSTEM_CONFIGURATION_EXIT_CODE

Error code used when the system configuration does not satisfy the requirements (java not found for example).

public static final int
VERTX_DEPLOYMENT_EXIT_CODE

Error code used when a deployment failed.

public static final int
VERTX_INITIALIZATION_EXIT_CODE

Error code used when vert.x cannot be initialized.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
addArgument(List<String>
the list of arguments
args
,
String
the argument to add
argument
)

Adds an argument to the given list.

public static void
exit(int
the code, 0 for success. By convention a non zero value if return to denotes an error.
code
)

Exits the JVM with the given exit code.

public static void
exitBecauseOfProcessIssue()

Exits the JVM and indicate an issue with a process creation or termination.

public static void
exitBecauseOfSystemConfigurationIssue()

Exits the JVM and indicate an issue with the system configuration.

public static void
exitBecauseOfVertxDeploymentIssue()

Exits the JVM and indicate an issue during the deployment of the main verticle.

public static void
exitBecauseOfVertxInitializationIssue()

Exits the JVM and indicate an issue during the Vert.x initialization.

public static boolean

Returns:

true if the current operating system belongs to the "linux" family.
isLinux
()

public static boolean

Returns:

true if the current operating system belongs to the "windows" family.
isWindows
()

public static String

Returns:

the quoted argument
quoteArgument
(final String
the argument to be quoted
argument
)

Puts quotes around the given String if necessary.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DOUBLE_QUOTEback to summary
private static final String DOUBLE_QUOTE
osNameback to summary
private static String osName

The os.name property is mandatory (from the Java Virtual Machine specification).

PROCESS_ERROR_EXIT_CODEback to summary
public static final int PROCESS_ERROR_EXIT_CODE

Error code used when a spawn process cannot be found, created, or stopped smoothly.

SINGLE_QUOTEback to summary
private static final String SINGLE_QUOTE
SYSTEM_CONFIGURATION_EXIT_CODEback to summary
public static final int SYSTEM_CONFIGURATION_EXIT_CODE

Error code used when the system configuration does not satisfy the requirements (java not found for example).

VERTX_DEPLOYMENT_EXIT_CODEback to summary
public static final int VERTX_DEPLOYMENT_EXIT_CODE

Error code used when a deployment failed.

VERTX_INITIALIZATION_EXIT_CODEback to summary
public static final int VERTX_INITIALIZATION_EXIT_CODE

Error code used when vert.x cannot be initialized.

Constructor Detail

ExecUtilsback to summary
public ExecUtils()

Method Detail

addArgumentback to summary
public static void addArgument(List<String> args, String argument)

Adds an argument to the given list. It automatically adds quotes to the argument if necessary.

Parameters
args:List<String>

the list of arguments

argument:String

the argument to add

exitback to summary
public static void exit(int code)

Exits the JVM with the given exit code.

Parameters
code:int

the code, 0 for success. By convention a non zero value if return to denotes an error.

exitBecauseOfProcessIssueback to summary
public static void exitBecauseOfProcessIssue()

Exits the JVM and indicate an issue with a process creation or termination.

exitBecauseOfSystemConfigurationIssueback to summary
public static void exitBecauseOfSystemConfigurationIssue()

Exits the JVM and indicate an issue with the system configuration.

exitBecauseOfVertxDeploymentIssueback to summary
public static void exitBecauseOfVertxDeploymentIssue()

Exits the JVM and indicate an issue during the deployment of the main verticle.

exitBecauseOfVertxInitializationIssueback to summary
public static void exitBecauseOfVertxInitializationIssue()

Exits the JVM and indicate an issue during the Vert.x initialization.

isLinuxback to summary
public static boolean isLinux()
Returns:boolean

true if the current operating system belongs to the "linux" family.

isWindowsback to summary
public static boolean isWindows()
Returns:boolean

true if the current operating system belongs to the "windows" family.

quoteArgumentback to summary
public static String quoteArgument(final String argument)

Puts quotes around the given String if necessary.

If the argument doesn't include spaces or quotes, return it as is. If it contains double quotes, use single quotes - else surround the argument by double quotes.

Parameters
argument:String

the argument to be quoted

Returns:String

the quoted argument

Exceptions
IllegalArgumentException:
If argument contains both types of quotes