/** * Gets either system property or environment variable with given name. * * @param name Name of the system property or environment variable. * @param dflt Default value. * @return Value of the system property or environment variable. * Returns {@code null} if neither can be found for given name. */ @Nullable public static String getString(String name, String dflt) { String val = getString(name); return val == null ? dflt : val; }
/** * Gets either system property or environment variable with given name. * The result is transformed to {@code boolean} using {@code Boolean.valueOf()} method. * * @param name Name of the system property or environment variable. * @return Boolean value of the system property or environment variable. * Returns {@code False} in case neither system property * nor environment variable with given name is found. */ public static boolean getBoolean(String name) { return getBoolean(name, false); }
String ntfStr = GridSystemProperties.getString(GG_LIFECYCLE_EMAIL_NOTIFY); String locHost = GridSystemProperties.getString(GG_LOCAL_HOST); String depModeName = GridSystemProperties.getString(GG_DEP_MODE_OVERRIDE); String fromEmail = GridSystemProperties.getString(GG_SMTP_FROM); String smtpHost = GridSystemProperties.getString(GG_SMTP_HOST); String smtpUsername = GridSystemProperties.getString(GG_SMTP_USERNAME); String smtpPwd = GridSystemProperties.getString(GG_SMTP_PWD); int smtpPort = GridSystemProperties.getInteger(GG_SMTP_PORT,-1); myCfg.setSmtpSsl(GridSystemProperties.getBoolean(GG_SMTP_SSL)); String adminEmails = GridSystemProperties.getString(GG_ADMIN_EMAILS); if (!GridSystemProperties.getBoolean(GG_NO_SHUTDOWN_HOOK, false)) { try { Runtime.getRuntime().addShutdownHook(shutdownHook = new Thread() {
boolean notifyEnabled = GridSystemProperties.getBoolean(GG_UPDATE_NOTIFIER, true); String intervalStr = GridSystemProperties.getString(GG_STARVATION_CHECK_INTERVAL);
int jmxPort = GridSystemProperties.getInteger(GG_JMX_PORT, -1);
private static final int MAX_REMAP_CNT = GridSystemProperties.getInteger(GG_NEAR_GET_MAX_REMAPS, DFLT_MAX_REMAP_CNT);
/** * Gets either system property or environment variable with given name. * The result is transformed to {@code boolean} using {@code Boolean.valueOf()} method. * * @param name Name of the system property or environment variable. * @param dflt Default value. * @return Boolean value of the system property or environment variable. * Returns default value in case neither system property * nor environment variable with given name is found. */ public static boolean getBoolean(String name, boolean dflt) { String val = getString(name); return val == null ? dflt : Boolean.valueOf(val); }
/** * @param sb Sb. */ private static void appendJvmId(SB sb) { if (getBoolean(GG_MBEAN_APPEND_JVM_ID)) { String gridId = Integer.toHexString(Grid.class.getClassLoader().hashCode()) + "_" + ManagementFactory.getRuntimeMXBean().getName(); sb.a("jvmId=").a(gridId).a(','); } }
private static final int MAX_REMAP_CNT = getInteger(GG_NEAR_GET_MAX_REMAPS, DFLT_MAX_REMAP_CNT);
/** * Gets either system property or environment variable with given name. * The result is transformed to {@code int} using {@code Integer.parseInt()} method. * * @param name Name of the system property or environment variable. * @param dflt Default value * @return Integer value of the system property or environment variable. * Returns default value in case neither system property * nor environment variable with given name is found. */ public static int getInteger(String name, int dflt) { String s = getString(name); if (s == null) return dflt; int res; try { res = Integer.parseInt(s); } catch (NumberFormatException ignore) { res = dflt; } return res; }
/** {@inheritDoc} */ @Override public void onKernalStart() throws GridException { if (ctx.config().isDaemon()) return; if (!getBoolean(GG_SKIP_CONFIGURATION_CONSISTENCY_CHECK)) { for (GridNode n : ctx.discovery().remoteNodes()) checkGgfsOnRemoteNode(n); } for (GridGgfsContext ggfsCtx : ggfsCache.values()) for (GridGgfsManager mgr : ggfsCtx.managers()) mgr.onKernalStart(); }
/** * Gets either system property or environment variable with given name. * The result is transformed to {@code long} using {@code Long.parseLong()} method. * * @param name Name of the system property or environment variable. * @param dflt Default value * @return Integer value of the system property or environment variable. * Returns default value in case neither system property * nor environment variable with given name is found. */ public static long getLong(String name, long dflt) { String s = getString(name); if (s == null) return dflt; long res; try { res = Long.parseLong(s); } catch (NumberFormatException ignore) { res = dflt; } return res; }
return; if (!getBoolean(GG_SKIP_CONFIGURATION_CONSISTENCY_CHECK)) { for (GridNode n : ctx.discovery().remoteNodes()) checkCache(n);
/** * Gets either system property or environment variable with given name. * The result is transformed to {@code double} using {@code Double.parseDouble()} method. * * @param name Name of the system property or environment variable. * @param dflt Default value * @return Integer value of the system property or environment variable. * Returns default value in case neither system property * nor environment variable with given name is found. */ public static double getDouble(String name, double dflt) { String s = getString(name); if (s == null) return dflt; double res; try { res = Double.parseDouble(s); } catch (NumberFormatException ignore) { res = dflt; } return res; } }
if (!getBoolean(GG_SKIP_CONFIGURATION_CONSISTENCY_CHECK)) { for (GridNode n : ctx.discovery().remoteNodes()) checkStreamer(n);
/** * Tries to resolve GridGain installation home folder. * * @return Installation home folder. * @throws GridException If GridGain home folder was not set. */ public static String resolveGridGainHome() throws GridException { String var = GridSystemProperties.getString(GG_HOME); if (var != null) return var; else throw new GridException("Failed to resolve GridGain home folder " + "(please set 'GRIDGAIN_HOME' environment or system variable)"); }
/** {@inheritDoc} */ @Override public String apply(String oldPath) { if (!F.isEmpty(U.GRIDGAIN_LOG_DIR)) return U.nodeIdLogFileName(nodeId, new File(U.GRIDGAIN_LOG_DIR, "gridgain.log").getAbsolutePath()); if (oldPath != null) // fileName could be null if GRIDGAIN_HOME is not defined. return U.nodeIdLogFileName(nodeId, oldPath); String tmpDir = GridSystemProperties.getString("java.io.tmpdir"); if (tmpDir != null) return U.nodeIdLogFileName(nodeId, new File(tmpDir, "gridgain.log").getAbsolutePath()); System.err.println("Failed to get tmp directory for log file."); return null; } }
String ggHome0 = GridSystemProperties.getString(GG_HOME);
locHost = null; String sysLocHost = GridSystemProperties.getString(GG_LOCAL_HOST);
runInitScript(); if (getString(GG_H2_DEBUG_CONSOLE) != null) { Connection c = DriverManager.getConnection(dbUrl);