1 28 29 package org.objectweb.util.explorer.parser.lib; 30 31 import java.net.URL ; 32 import java.util.Iterator ; 33 import java.util.List ; 34 import java.util.Vector ; 35 36 import org.objectweb.util.explorer.core.common.lib.BasicLoggable; 37 import org.objectweb.util.explorer.core.common.lib.ClassResolver; 38 import org.objectweb.util.explorer.explorerConfig.Jar; 39 import org.objectweb.util.explorer.explorerConfig.Node; 40 import org.objectweb.util.explorer.explorerConfig.beans.ExplorerBean; 41 import org.objectweb.util.explorer.parser.api.ExplorerParser; 42 import org.objectweb.util.explorer.parser.api.NodeParser; 43 44 52 public class JarManager 53 extends BasicLoggable 54 implements ExplorerParser, NodeParser 55 { 56 57 63 69 75 79 protected void loadJars(List jarList){ 80 Vector urlList = new Vector (); 81 Iterator it = jarList.iterator(); 82 while(it.hasNext()){ 83 String jarUrl = ((Jar)it.next()).getUrl(); 84 try { 85 urlList.add(new URL (jarUrl)); 86 } catch (java.net.MalformedURLException e) { 87 getTrace().info(jarUrl + " : Malformed URL!"); 88 } 89 } 90 if (!urlList.isEmpty()) { 91 ClassResolver.addContext((URL []) urlList.toArray(new URL [0])); 92 } 93 } 94 95 101 104 public void parseExplorer(ExplorerBean explorer) { 105 loadJars(explorer.getJarList()); 106 } 107 108 114 117 public void parseNode(Object key, Node node) { 118 loadJars(node.getJarList()); 119 } 120 } 121 | Popular Tags |