private RunMode(boolean dynamic, boolean prettyFail, boolean cacheAssets, boolean minifyAssets) { this.dynamic = dynamic; this.prettyFail = prettyFail; this.value = name().toLowerCase(); this.cacheAssets = cacheAssets; this.minifyAssets = minifyAssets; }
private RunMode(boolean dynamic, boolean prettyFail, boolean cacheAssets, boolean minifyAssets) { this.dynamic = dynamic; this.prettyFail = prettyFail; this.value = name().toLowerCase(); this.cacheAssets = cacheAssets; this.minifyAssets = minifyAssets; }
/** * Parse the run mode * * @param s the string to parse * @return the corresponding run mode or null if none can be matched * @throws NullPointerException if the string argument is null */ public static RunMode parse(String s) throws NullPointerException { if (s == null) { throw new NullPointerException("No null string argument accepted"); } for (RunMode runMode : ALL) { String name = runMode.name(); if (name.equalsIgnoreCase(s)) { return runMode; } } return null; }
/** * Parse the run mode * * @param s the string to parse * @return the corresponding run mode or null if none can be matched * @throws NullPointerException if the string argument is null */ public static RunMode parse(String s) throws NullPointerException { if (s == null) { throw new NullPointerException("No null string argument accepted"); } for (RunMode runMode : ALL) { String name = runMode.name(); if (name.equalsIgnoreCase(s)) { return runMode; } } return null; }
public ModuleContextImpl(Logger log, BridgeContext bridgeContext, ResourceResolver resolver) { // ModuleRuntime<?> lifeCycle; if (bridgeContext.getRunMode().isDynamic()) { ReadFileSystem<?> sourcePath = bridgeContext.getSourcePath(); log.info("Initializing live module at " + sourcePath.getDescription()); lifeCycle = new ModuleRuntime.Dynamic(log, Thread.currentThread().getContextClassLoader(), sourcePath); } else { log.info("Initializing module in " + bridgeContext.getRunMode().name().toLowerCase() + " mode"); ReadFileSystem<?> classPath = bridgeContext.getClassPath(); lifeCycle = new ModuleRuntime.Static(log, Thread.currentThread().getContextClassLoader(), classPath); } // this.bridgeContext = bridgeContext; this.resolver = resolver; this.runtime = lifeCycle; }
public ModuleContextImpl(Logger log, BridgeContext bridgeContext, ResourceResolver resolver) { // ModuleRuntime<?> lifeCycle; if (bridgeContext.getRunMode().isDynamic()) { ReadFileSystem<?> sourcePath = bridgeContext.getSourcePath(); log.info("Initializing live module at " + sourcePath.getDescription()); lifeCycle = new ModuleRuntime.Dynamic(log, Thread.currentThread().getContextClassLoader(), sourcePath); } else { log.info("Initializing module in " + bridgeContext.getRunMode().name().toLowerCase() + " mode"); ReadFileSystem<?> classPath = bridgeContext.getClassPath(); lifeCycle = new ModuleRuntime.Static(log, Thread.currentThread().getContextClassLoader(), classPath); } // this.bridgeContext = bridgeContext; this.resolver = resolver; this.runtime = lifeCycle; }