Permalink
Browse files

AS7-5008 removed dependency to process-controller's usage() method. It

was not used consitently and this process is not intended for direct
invocation.
  • Loading branch information...
Bernd Eckenfels
Bernd Eckenfels committed Nov 7, 2012
1 parent 97c6fd9 commit 6fd3887808315f5dd9d1d8fad52a802ace009a51
Showing with 2 additions and 18 deletions.
  1. +2 −18 host-controller/src/main/java/org/jboss/as/host/controller/Main.java
@@ -23,7 +23,6 @@
package org.jboss.as.host.controller;
import static org.jboss.as.host.controller.HostControllerMessages.MESSAGES;
-import static org.jboss.as.process.Main.usage;
import java.io.File;
import java.io.IOException;
@@ -204,7 +203,6 @@ public static HostControllerEnvironment determineEnvironment(String[] args, Inpu
pmPort = Integer.valueOf(port);
} catch (NumberFormatException e) {
System.err.println(MESSAGES.invalidValue(CommandLineConstants.PROCESS_CONTROLLER_BIND_PORT, "Integer", port));
- usage();
return null;
}
} else if (arg.startsWith(CommandLineConstants.PROCESS_CONTROLLER_BIND_PORT)) {
@@ -223,7 +221,6 @@ public static HostControllerEnvironment determineEnvironment(String[] args, Inpu
pmAddress = InetAddress.getByName(addr);
} catch (UnknownHostException e) {
System.err.println(MESSAGES.unknownHostValue(CommandLineConstants.PROCESS_CONTROLLER_BIND_ADDR, addr));
- usage();
return null;
}
} else if (arg.startsWith(CommandLineConstants.PROCESS_CONTROLLER_BIND_ADDR)) {
@@ -300,7 +297,6 @@ public static HostControllerEnvironment determineEnvironment(String[] args, Inpu
int idx = arg.indexOf('=');
if (idx == arg.length() - 1) {
System.err.println(MESSAGES.argumentExpected(arg));
- usage();
return null;
}
String value = idx > -1 ? arg.substring(idx + 1) : args[++i];
@@ -313,7 +309,6 @@ public static HostControllerEnvironment determineEnvironment(String[] args, Inpu
int idx = arg.indexOf('=');
if (idx == arg.length() - 1) {
System.err.println(MESSAGES.argumentExpected(arg));
- usage();
return null;
}
String value = idx > -1 ? arg.substring(idx + 1) : args[++i];
@@ -346,7 +341,6 @@ public static HostControllerEnvironment determineEnvironment(String[] args, Inpu
int idx = arg.indexOf('=');
if (idx == arg.length() - 1) {
System.err.println(MESSAGES.argumentExpected(arg));
- usage();
return null;
}
String value = idx > -1 ? arg.substring(idx + 1) : args[++i];
@@ -369,7 +363,6 @@ public static HostControllerEnvironment determineEnvironment(String[] args, Inpu
int idx = arg.indexOf('=');
if (idx == arg.length() - 1) {
System.err.println(MESSAGES.argumentExpected(arg));
- usage();
return null;
}
String value = idx > -1 ? arg.substring(idx + 1) : args[++i];
@@ -380,12 +373,10 @@ public static HostControllerEnvironment determineEnvironment(String[] args, Inpu
modulePath = args[++i];
} else {
System.err.println(MESSAGES.invalidOption(arg));
- usage();
return null;
}
} catch (IndexOutOfBoundsException e) {
System.err.println(MESSAGES.argumentExpected(arg));
- usage();
return null;
}
}
@@ -396,14 +387,12 @@ public static HostControllerEnvironment determineEnvironment(String[] args, Inpu
}
private static String parseValue(final String arg, final String key) {
- String value = null;
int splitPos = key.length();
if (arg.length() <= splitPos + 1 || arg.charAt(splitPos) != '=') {
- usage();
+ return null;
} else {
- value = arg.substring(splitPos + 1);
+ return arg.substring(splitPos + 1);
}
- return value;
}
private static boolean processProperties(final String arg, final String urlSpec, Map<String, String> hostSystemProperties) {
@@ -420,11 +409,9 @@ private static boolean processProperties(final String arg, final String urlSpec,
return true;
} catch (MalformedURLException e) {
System.err.println(MESSAGES.malformedUrl(arg));
- usage();
return false;
} catch (IOException e) {
System.err.println(MESSAGES.unableToLoadProperties(url));
- usage();
return false;
}
}
@@ -434,7 +421,6 @@ private static Integer parsePort(final String value, final String key) {
return Integer.valueOf(value);
} catch (NumberFormatException e) {
System.err.println(MESSAGES.invalidValue(key, "Integer", value));
- usage();
return null;
}
}
@@ -444,7 +430,6 @@ private static InetAddress parseAddress(final String value, final String key) {
return InetAddress.getByName(value);
} catch (UnknownHostException e) {
System.err.println(MESSAGES.unknownHostValue(key, value));
- usage();
return null;
}
}
@@ -589,7 +574,6 @@ private void setBindAddress(String key, String value) {
} catch (UnknownHostException e) {
parseFailed = true;
System.out.println(MESSAGES.invalidValue(key, "InetAddress", value));
- usage();
}
}
}

0 comments on commit 6fd3887

Please sign in to comment.