private SystemInstance(Properties properties) throws Exception { this.components = new HashMap<Class, Object>(); this.internalProperties.putAll(System.getProperties()); this.internalProperties.putAll(properties); this.options = new Options(internalProperties, new Options(System.getProperties())); this.home = new FileUtils("openejb.home", "user.dir", this.internalProperties); this.base = new FileUtils("openejb.base", "openejb.home", this.internalProperties); this.classPath = ClassPathFactory.createClassPath(this.internalProperties.getProperty("openejb.loader", "context")); this.classLoader = classPath.getClassLoader(); this.internalProperties.setProperty("openejb.home", home.getDirectory().getCanonicalPath()); this.internalProperties.setProperty("openejb.base", base.getDirectory().getCanonicalPath()); System.setProperty("derby.system.home", base.getDirectory().getCanonicalPath()); // set the magic system property that causes derby to use explicity // file sync instead of relying on vm support for file open rws System.setProperty("derby.storage.fileSyncTransactionLog", "true"); }
@SuppressWarnings("checkstyle:needbraces") public static ClassPath createClassPath(final String name) { if (name.equalsIgnoreCase("tomcat")) return new TomcatClassPath(); if (name.equalsIgnoreCase("tomcat-common")) return new TomcatClassPath(); if (name.equalsIgnoreCase("tomcat-system")) return new TomcatClassPath(); if (name.equalsIgnoreCase("tomcat-webapp")) return new WebAppClassPath(); if (name.equalsIgnoreCase("bootstrap") && isSystemSupported()) return new SystemClassPath(); if (name.equalsIgnoreCase("system") && isSystemSupported()) return new SystemClassPath(); if (name.equalsIgnoreCase("thread")) return new ContextClassPath(); if (name.equalsIgnoreCase("context")) return new ContextClassPath(); return new ContextClassPath(); }
this.home = new FileUtils("openejb.home", "user.dir", this.internalProperties); this.base = new FileUtils("openejb.base", "openejb.home", this.internalProperties); this.classPath = ClassPathFactory.createClassPath(this.internalProperties.getProperty("openejb.loader", "context")); this.classLoader = classPath.getClassLoader();
this.home = new FileUtils("openejb.home", "user.dir", this.internalProperties); this.base = new FileUtils("openejb.base", "openejb.home", this.internalProperties); this.classPath = ClassPathFactory.createClassPath(this.internalProperties.getProperty("openejb.loader", "context")); this.classLoader = classPath.getClassLoader(); final String homeDirCanonicalPath;