class RequirementsVerifier implements ServletContextListener {

    private static final Logger LOGGER = Logger.getLogger(RequirementsVerifier.class);
    private static final boolean systemRequirementCheckEnabled = Config.getInstance().getPropertyAsBoolean(ConfigKey.SYSTEM_REQUIREMENT_CHECK_ENABLED);
    private static boolean failedValidation = false;

    private static synchronized void setFailedValidation(boolean value) {
        failedValidation = value;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void contextInitialized(final ServletContextEvent event) {<FILL_FUNCTION_BODY>}

    /**
     * {@inheritDoc}
     */
    @Override
    public void contextDestroyed(final ServletContextEvent event) {
        /* Intentionally blank to satisfy interface */
    }

    public static boolean failedValidation() {
        return failedValidation;
    }
}

        LOGGER.info("Initializing requirements verifier");
        if (Runtime.getRuntime().maxMemory()/1024/1024 <= 3584) {
            if (systemRequirementCheckEnabled) {
                setFailedValidation(true);
                // too complicated to calculate (Eden, Survivor, Tenured) and different type names between Java versions.
                // Therefore, safely assume anything above 3.5GB available max memory is likely to be 4GB or higher.
                final String message = "Dependency-Track requires a minimum of 4GB RAM (heap). Cannot continue. To fix, specify -Xmx4G (or higher) when executing Java.";
                LOGGER.error(message);
                throw new RequirementsException(message);
            } else {
                final String message = "Dependency-Track requires a minimum of 4GB RAM (heap). We highly recommand to use 4GB RAM. Dependency-Track will continue to start, but may not function properly. https://docs.dependencytrack.org/getting-started/deploy-docker/#container-requirements-api-server";
                LOGGER.warn(message);
            }
        }
        if (Runtime.getRuntime().availableProcessors() < 2) {
            if (systemRequirementCheckEnabled) {
                setFailedValidation(true);
                final String message = "Dependency-Track requires a minimum of 2 CPU cores. Cannot continue. To fix, specify -Xmx4G (or higher) when executing Java.";
                LOGGER.error(message);
                throw new RequirementsException(message);
            } else {
                final String message = "Dependency-Track requires a minimum of 2 CPU cores. We highly recommand to use 2 CPU cores. Dependency-Track will continue to start, but may not function properly. https://docs.dependencytrack.org/getting-started/deploy-docker/#container-requirements-api-server";
                LOGGER.warn(message);
            }
        }
    
<no_super_class>