private Pair<String, Procedure<String[]>> getDeployCommand(String[] args, Runnable exitFailureMethod) { if (args.length == 0) { usage(); exitFailureMethod.run(); } Procedure<String[]> command = commandMap.get(args[0]); if (command == null) { System.out.println("No command w/ name " + args[0] + " has been defined in this distribution: " + commandMap.keysView().makeString("[", ", ", "]")); System.out.println("See the usage for more details"); usage(); exitFailureMethod.run(); } return Tuples.pair(args[0], command); }
public Platform valueOf(String dbPlatformStr) { try { ImmutableHierarchicalConfiguration platformConfig = platformConfigs.get(dbPlatformStr); String resolvedDbPlatformClass = null; if (platformConfig != null) { resolvedDbPlatformClass = platformConfig.getString("class"); } if (resolvedDbPlatformClass == null) { resolvedDbPlatformClass = dbPlatformStr; } return (Platform) Class.forName(resolvedDbPlatformClass).newInstance(); } catch (InstantiationException e) { throw new DeployerRuntimeException(e); } catch (IllegalAccessException e) { throw new DeployerRuntimeException(e); } catch (ClassNotFoundException e) { throw new DeployerRuntimeException("Could not find platform named " + dbPlatformStr + "; no class found and name was not in the list of default platform strings: " + platformConfigs.keysView()); } }
public Platform valueOf(String dbPlatformStr) { try { ImmutableHierarchicalConfiguration platformConfig = platformConfigs.get(dbPlatformStr); String resolvedDbPlatformClass = null; if (platformConfig != null) { resolvedDbPlatformClass = platformConfig.getString("class"); } if (resolvedDbPlatformClass == null) { resolvedDbPlatformClass = dbPlatformStr; } return (Platform) Class.forName(resolvedDbPlatformClass).newInstance(); } catch (InstantiationException e) { throw new DeployerRuntimeException(e); } catch (IllegalAccessException e) { throw new DeployerRuntimeException(e); } catch (ClassNotFoundException e) { throw new DeployerRuntimeException("Could not find platform named " + dbPlatformStr + "; no class found and name was not in the list of default platform strings: " + platformConfigs.keysView()); } }