m_logger.info(JVM.getInstance().toString()); m_logger.info("time zone is {}", new SimpleDateFormat("z (Z)").format(new Date()));
/** * Get a JVM instance that represents the current JVM. * * @return The instance. */ public static JVM getInstance() { return new JVM(); }
/** * Constructor. * * @param logger Logger to which output should be directed. * @param usage Usage message. * @throws GrinderException If a problem occurred. */ protected AbstractMainClass(Logger logger, String usage) throws GrinderException { m_usage = new FixedWidthFormatter(FixedWidthFormatter.Align.LEFT, FixedWidthFormatter.Flow.WORD_WRAP, 80).format(usage); m_logger = logger; if (!JVM.getInstance().haveRequisites(m_logger)) { throw new LoggedInitialisationException("Unsupported JVM"); } }
/** * Check the JVM is the right version, has the right optional components * installed, and so on. If there are problems, report them to the logger and * return {@code false}. * * @param logger * Where to report any problems. * @return {@code true} => we have everything. * @exception VersionException * If the JVM's version could not be parsed. */ public boolean haveRequisites(Logger logger) throws VersionException { final String name = "The Grinder " + GrinderBuild.getVersionString(); if (!isAtLeastVersion(1, 6)) { logger.error("Fatal Error - incompatible version of Java ({})%n" + "{} requires at least Java SE 6.", this, name); return false; } return true; }
m_logger.info(JVM.getInstance().toString()); m_logger.info("time zone is {}", new SimpleDateFormat("z (Z)").format(new Date()));