Skip to content

Commit

Permalink
Merge pull request #2 from mrovnanik/master
Browse files Browse the repository at this point in the history
Pulling David's commit regarding ECFI (moqui.runtime and moqui.conf)
  • Loading branch information
mrovnanik authored Jul 15, 2016
2 parents 4572ff0 + 9ae8887 commit b82cdc1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,10 @@ class ExecutionContextFactoryImpl implements ExecutionContextFactory {
}

protected MNode initBaseConfig(MNode runtimeConfXmlRoot) {
// always set the full moqui.runtime, moqui.conf system properties for use in various places
System.setProperty("moqui.runtime", runtimePath)
System.setProperty("moqui.conf", runtimeConfPath)
// don't set the moqui.runtime and moqui.conf system properties as before, causes conflict with multiple moqui instances in one JVM
// NOTE: moqui.runtime is set in MoquiStart and in MoquiContextListener (if there is an embedded runtime directory)
// System.setProperty("moqui.runtime", runtimePath)
// System.setProperty("moqui.conf", runtimeConfPath)

logger.info("Initializing Moqui ExecutionContextFactoryImpl\n - runtime directory: ${this.runtimePath}\n - runtime config: ${this.runtimeConfPath}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1298,9 +1298,9 @@ class WebFacadeImpl implements WebFacade {
session.setAttribute("moqui.error.parameters", parms)
}

static DiskFileItemFactory makeDiskFileItemFactory(ServletContext context) {
DiskFileItemFactory makeDiskFileItemFactory(ServletContext context) {
// NOTE: consider keeping this factory somewhere to be more efficient, if it even makes a difference...
File repository = new File(System.getProperty("moqui.runtime") + "/tmp")
File repository = new File(eci.ecfi.runtimePath + "/tmp")
if (!repository.exists()) repository.mkdir()

DiskFileItemFactory factory = new DiskFileItemFactory(DiskFileItemFactory.DEFAULT_SIZE_THRESHOLD, repository)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class EntityDatasourceFactoryImpl implements EntityDatasourceFactory {
} else if (datasourceNode.hasChild("inline-jdbc")) {
// special thing for embedded derby, just set an system property; for derby.log, etc
if (datasourceNode.attribute("database-conf-name") == "derby" && !System.getProperty("derby.system.home")) {
System.setProperty("derby.system.home", System.getProperty("moqui.runtime") + "/db/derby")
System.setProperty("derby.system.home", efi.ecfi.runtimePath + "/db/derby")
logger.info("Set property derby.system.home to [${System.getProperty("derby.system.home")}]")
}

Expand Down

0 comments on commit b82cdc1

Please sign in to comment.