1 19 20 package org.netbeans; 21 22 import java.io.File ; 23 import java.io.IOException ; 24 import java.util.List ; 25 import java.util.Set ; 26 import java.util.jar.JarFile ; 27 import java.util.jar.Manifest ; 28 import org.openide.modules.Dependency; 29 30 36 public abstract class ModuleInstaller { 37 38 39 protected ModuleInstaller() {} 40 41 51 public abstract void prepare(Module m) throws InvalidException; 52 53 60 public abstract void dispose(Module m); 61 62 75 public abstract void load(List <Module> modules); 76 77 82 public abstract void unload(List <Module> modules); 83 84 87 public abstract boolean closing(List <Module> modules); 88 89 92 public abstract void close(List <Module> modules); 93 94 105 public void refineDependencies(Module m, Set <Dependency> dependencies) {} 106 107 125 public boolean shouldDelegateResource(Module m, Module parent, String pkg) { 126 return true; 127 } 128 129 140 public Manifest loadManifest(File jar) throws IOException { 141 JarFile jarFile = new JarFile (jar, false); 142 try { 143 Manifest m = jarFile.getManifest(); 144 if (m == null) throw new IOException ("No manifest found in " + jar); return m; 146 } finally { 147 jarFile.close(); 148 } 149 } 150 151 159 public void refineClassLoader(Module m, List parents) { 160 } 162 163 169 public String [] refineProvides (Module m) { 170 return null; 171 } 172 173 180 public boolean isSpecialResource(String pkg) { 181 return false; 182 } 183 184 } 185 | Popular Tags |