1 23 24 package com.sun.enterprise.cli.commands; 25 26 import com.sun.enterprise.cli.framework.*; 27 28 import java.util.Vector ; 29 30 public class JvmOptionsCommand extends GenericCommand { 31 32 private static final String ERROR_MSG = "error-msg"; 33 private static final String LINE_SEPARATOR = 34 System.getProperty("line.separator"); 35 36 protected void handleReturnValue(Object retVal) { 37 final String [] invalidOptions = (String [])retVal; 38 if (invalidOptions.length > 0) 39 { 40 printErrorMsg(); 41 printInvalidJvmOptions(invalidOptions); 42 throw new RuntimeException (); 43 } 44 } 45 46 void printErrorMsg() { 47 final String key = (String )((Vector )getProperty(ERROR_MSG)).get(0); 48 CLILogger.getInstance().printError(getLocalizedString(key)); 49 } 50 51 void printInvalidJvmOptions(Object [] oa) { 52 StringBuffer sb = new StringBuffer (""); 53 for (int i = 0; i < oa.length; i++) { 54 sb.append(oa[i].toString()); 55 if (i < oa.length - 1) { 56 sb.append(LINE_SEPARATOR); 58 } 59 } 60 CLILogger.getInstance().printError(sb.toString()); 61 } 62 } 63 | Popular Tags |