protected boolean isInternalDebug() { if (internalDebug == null) { synchronized (ScriptingExpression.class) { if (internalDebug == null) { // almost no cost but cache just in case internalDebug = LastaDiProperties.getInstance().isInternalDebug(); } } } return internalDebug; } }
protected static void setupScriptEngine() { new Thread(() -> { /* first getEngineByName() costs about 0.5 seconds so initialize it background */ final Class<?> engineType = LastaDiProperties.getInstance().getDiXmlScriptExpressionEngineType(); if (engineType == null) { /* use default */ new ScriptEngineManager().getEngineByName("javascript"); /* initialize static resources */ } }).start(); }
protected boolean isInternalDebug() { return LastaDiProperties.getInstance().isInternalDebug(); }
protected String filterEnvSwitching(String path) { return LastaDiProperties.getInstance().resolveLastaEnvPath(path); }
protected String filterEnvSwitching(String path) { return LastaDiProperties.getInstance().resolveLastaEnvPath(path); }
protected void setupPropertiesSmartPackage() { LastaDiProperties.getInstance().getSmartPackageList().forEach(pkg -> { addRootPackageName(pkg); }); }
protected boolean needsPlainPropertyInjection(PropertyDesc propDesc) { final Method writeMethod = propDesc.getWriteMethod(); if (writeMethod == null) { // e.g. getter only or public field, are out of target return false; } // the property has setter final String fqcn = writeMethod.getDeclaringClass().getName(); if (fqcn.startsWith("org.lastaflute.") || fqcn.startsWith("org.dbflute.")) { return true; } final String specified1 = LastaDiProperties.getInstance().getPlainPropertyInjectionPackage1(); if (specified1 != null && fqcn.startsWith(specified1)) { return true; } return false; } }
public void close() throws SQLException { if (closed) { return; } if (LastaDiProperties.getInstance().isInternalDebug()) { logger.debug("#fw_debug Closed the logical connection: {}", xaConnection); } if (tx == null) { connectionPool.checkIn(this); } else { connectionPool.checkInTx(tx); } }
protected static void setupSmartDeployMode() { final String smartDeployMode = LastaDiProperties.getInstance().getSmartDeployMode(); if (smartDeployMode != null) { SmartDeployMode.setValue(SmartDeployMode.codeOf(smartDeployMode)); // with logging } else { logger.info("*Not found smart deploy mode property so use default mode: {}", SmartDeployMode.getValue()); } }
protected ExpressionEngine prepareEngine() { final Class<?> engineType = LastaDiProperties.getInstance().getDiXmlScriptExpressionEngineType(); final ExpressionEngine engine; if (engineType != null) { // TODO jflute lastaflute: [E] fitting: DI :: expression engine property error handling engine = (ExpressionEngine) LdiClassUtil.newInstance(engineType); } else { // mainly here engine = createDefaultEngine(); } return engine; }