[Ejtools-cvs] CVS: applications/deployment/src/main/net/sourceforge/ejtools/deploy Main.java,NONE,1.
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-04-21 18:49:46
|
Update of /cvsroot/ejtools/applications/deployment/src/main/net/sourceforge/ejtools/deploy In directory usw-pr-cvs1:/tmp/cvs-serv19424/src/main/net/sourceforge/ejtools/deploy Added Files: Main.java Log Message: Initial Import --- NEW FILE: Main.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package net.sourceforge.ejtools.deploy; // Standard Imports import java.io.File; import java.net.URL; import java.net.URLClassLoader; import java.security.AccessController; import java.security.Permission; import java.security.PrivilegedExceptionAction; import java.util.LinkedList; /** * Description of the Class * * @author letiembl * @created 21 mars 2002 * @todo Javadoc to complete * @todo Add log4j logs */ public class Main { /** * The main program for the Main class * * @param args The command line arguments * @exception Exception Description of Exception */ public static void main(String[] args) throws Exception { File pluginDir = new File("../lib/ext"); LinkedList list = new LinkedList(); File[] plugins = pluginDir.listFiles(); for (int i = 0; i < plugins.length; i++) { System.out.println(plugins[i].toURL()); list.add(plugins[i].toURL()); } pluginDir = new File("../lib"); plugins = pluginDir.listFiles(); for (int i = 0; i < plugins.length; i++) { System.out.println(plugins[i].toURL()); list.add(plugins[i].toURL()); } URL[] pluginURLs = (URL[]) list.toArray(new URL[list.size()]); Thread.currentThread().setContextClassLoader(new URLClassLoader(pluginURLs, Thread.currentThread().getContextClassLoader())); System.setSecurityManager( new SecurityManager() { public void checkPermission(Permission p) { } public void checkPermission(Permission perm, Object context) { } }); AccessController.doPrivileged( new PrivilegedExceptionAction() { public Object run() throws Exception { java.beans.Beans.instantiate(Thread.currentThread().getContextClassLoader(), "net.sourceforge.ejtools.deploy.DeploymentBrowser"); return null; } }); } } |