private void updatePath() { if (path != null && path.startsWith(HOME_VAR)) { path = SystemInstance.get().getHome().getDirectory().getAbsolutePath() + path.substring(HOME_VAR.length()); } }
private void updatePath() { if (path != null && path.startsWith(HOME_VAR)) { path = SystemInstance.get().getHome().getDirectory().getAbsolutePath() + path.substring(HOME_VAR.length()); } }
public static URL serverRouterConfigurationURL() { final File confDir = SystemInstance.get().getHome().getDirectory(); final File configFile = new File(confDir, "conf/" + routerConfigurationName()); if (configFile.exists()) { try { return configFile.toURI().toURL(); } catch (final MalformedURLException e) { // let return null } } return null; }
private File deployedDir() { return new File(SystemInstance.get().getHome().getDirectory(), "deployed"); }
protected File resolve(final String cmd) { if (cmd == null || cmd.trim().isEmpty()) { return SystemInstance.get().getBase().getDirectory(); } final String path = cmd.trim(); final File workingFile = new File(path); if ((!path.startsWith(HOME) && !path.startsWith(BASE) && workingFile.getPath().equals(workingFile.getAbsolutePath())) || path.startsWith("..")) { throw new IllegalArgumentException("path should start with " + BASE + " or " + HOME + " or be relative"); } if (path.startsWith(HOME)) { return new File(path.replace(HOME, SystemInstance.get().getHome().getDirectory().getAbsolutePath())); } else if (path.startsWith(BASE)) { return new File(path.replace(BASE, SystemInstance.get().getBase().getDirectory().getAbsolutePath())); } return new File(SystemInstance.get().getBase().getDirectory().getAbsolutePath(), path); } }
protected File resolve(final String cmd) { if (cmd == null || cmd.trim().isEmpty()) { return SystemInstance.get().getBase().getDirectory(); } String path = cmd.trim(); File workingFile = new File(path); if ((!path.startsWith(HOME) && !path.startsWith(BASE) && workingFile.getPath().equals(workingFile.getAbsolutePath())) || path.startsWith("..")) { throw new IllegalArgumentException("path should start with " + BASE + " or " + HOME + " or be relative"); } if (path.startsWith(HOME)) { return new File(path.replace(HOME, SystemInstance.get().getHome().getDirectory().getAbsolutePath())); } else if (path.startsWith(BASE)) { return new File(path.replace(BASE, SystemInstance.get().getBase().getDirectory().getAbsolutePath())); } return new File(SystemInstance.get().getBase().getDirectory().getAbsolutePath(), path); } }
private Class<?> loadOpenEJBClass() throws Exception { final ClassPath classPath = SystemInstance.get().getClassPath(); final ClassLoader classLoader = classPath.getClassLoader(); try { return classLoader.loadClass("org.apache.openejb.OpenEJB"); } catch (final Exception e) { try { checkOpenEjbHome(SystemInstance.get().getHome().getDirectory()); final FileUtils home = SystemInstance.get().getHome(); classPath.addJarsToPath(home.getDirectory("lib")); } catch (final Exception e2) { throw new Exception("Could not load OpenEJB libraries. Exception: " + e2.getClass().getName() + " " + e2.getMessage()); } try { return classLoader.loadClass("org.apache.openejb.OpenEJB"); } catch (final Exception e2) { throw new Exception("Could not load OpenEJB class after embedding libraries. Exception: " + e2.getClass().getName() + " " + e2.getMessage()); } } }
private Class forcefulLoad(ClassPath classPath, ClassLoader classLoader) throws Exception { try { File libsDir; String libsPath = SystemInstance.get().getProperty("openejb.libs"); if (libsPath != null){ libsDir = new File(libsPath); } else { checkOpenEjbHome(SystemInstance.get().getHome().getDirectory()); FileUtils home = SystemInstance.get().getHome(); libsDir = home.getDirectory("lib"); } classPath.addJarsToPath(libsDir); } catch (Exception e2) { throw new Exception("Could not load OpenEJB libraries. Exception: " + e2.getClass().getName() + " " + e2.getMessage()); } try { return classLoader.loadClass(className); } catch (Exception e2) { throw new Exception("Could not load class '"+className+"' after embedding libraries. Exception: " + e2.getClass().getName() + " " + e2.getMessage()); } }
private Class<?> loadOpenEJBClass() throws Exception { final ClassPath classPath = SystemInstance.get().getClassPath(); final ClassLoader classLoader = classPath.getClassLoader(); try { return classLoader.loadClass("org.apache.openejb.OpenEJB"); } catch (final Exception e) { try { checkOpenEjbHome(SystemInstance.get().getHome().getDirectory()); final FileUtils home = SystemInstance.get().getHome(); classPath.addJarsToPath(home.getDirectory("lib")); } catch (final Exception e2) { throw new Exception("Could not load OpenEJB libraries. Exception: " + e2.getClass().getName() + " " + e2.getMessage()); } try { return classLoader.loadClass("org.apache.openejb.OpenEJB"); } catch (final Exception e2) { throw new Exception("Could not load OpenEJB class after embedding libraries. Exception: " + e2.getClass().getName() + " " + e2.getMessage()); } } }
private Class<?> loadOpenEJBClass() throws Exception { ClassPath classPath = SystemInstance.get().getClassPath(); ClassLoader classLoader = classPath.getClassLoader(); try { return classLoader.loadClass("org.apache.openejb.OpenEJB"); } catch (Exception e) { try { checkOpenEjbHome(SystemInstance.get().getHome().getDirectory()); FileUtils home = SystemInstance.get().getHome(); classPath.addJarsToPath(home.getDirectory("lib")); } catch (Exception e2) { throw new Exception("Could not load OpenEJB libraries. Exception: " + e2.getClass().getName() + " " + e2.getMessage()); } try { return classLoader.loadClass("org.apache.openejb.OpenEJB"); } catch (Exception e2) { throw new Exception("Could not load OpenEJB class after embedding libraries. Exception: " + e2.getClass().getName() + " " + e2.getMessage()); } } }
public void init(Properties props) throws Exception { this.props = props; SystemInstance system = SystemInstance.get(); File home = system.getHome().getDirectory(); system.setProperty("openejb.deployments.classpath.include", ".*/"+home.getName()+"/lib/.*"); system.setProperty("openejb.deployments.classpath.require.descriptor", "true"); system.setProperty("openejb.deployments.classpath.filter.systemapps", "false"); OpenEJB.init(props, new ServerFederation()); if (System.getProperty("openejb.nobanner") == null) { System.out.println("[init] OpenEJB Remote Server"); } if (manager == null){ manager = ServiceManager.getManager(); } manager.init(); }
File libs = system.getHome().getDirectory("lib"); system.getClassPath().addJarsToPath(libs); initServer(system);
File libs = system.getHome().getDirectory("lib"); system.getClassPath().addJarsToPath(libs); initServer();
file = SystemInstance.get().getHome().getFile(path); if (file != null && file.exists() && file.isFile()) { return file.getAbsolutePath();
file = SystemInstance.get().getHome().getFile(path); if (file != null && file.exists() && file.isFile()) { return file.getAbsolutePath();
file = SystemInstance.get().getHome().getFile(path); if (file != null && file.exists() && file.isFile()) { return file.getAbsolutePath();
@Override public void init(final Properties props) throws Exception { this.props = props; final SystemInstance system = SystemInstance.get(); final File home = system.getHome().getDirectory(); system.setProperty(DeploymentFilterable.CLASSPATH_INCLUDE, system.getProperty(DeploymentFilterable.CLASSPATH_INCLUDE, ".*/" + home.getName() + "/lib/.*")); system.setProperty(DeploymentFilterable.CLASSPATH_REQUIRE_DESCRIPTOR, system.getProperty(DeploymentFilterable.CLASSPATH_REQUIRE_DESCRIPTOR, "true")); system.setProperty(DeploymentFilterable.CLASSPATH_FILTER_SYSTEMAPPS, system.getProperty(DeploymentFilterable.CLASSPATH_FILTER_SYSTEMAPPS, "false")); OpenEJB.init(props, new ServerFederation()); if (SystemInstance.get().getOptions().get("openejb.nobanner", (String) null) == null) { System.out.println("[init] OpenEJB Remote Server"); } if (manager == null) { manager = ServiceManager.getManager(); } manager.init(); }
System.setProperty("openejb.home", SystemInstance.get().getHome().getDirectory().getAbsolutePath()); System.setProperty("openejb.base", SystemInstance.get().getBase().getDirectory().getAbsolutePath());