Lines 93-99
Link Here
|
93 |
import org.openide.modules.Dependency; |
93 |
import org.openide.modules.Dependency; |
94 |
import org.openide.modules.InstalledFileLocator; |
94 |
import org.openide.modules.InstalledFileLocator; |
95 |
import org.openide.modules.SpecificationVersion; |
95 |
import org.openide.modules.SpecificationVersion; |
96 |
import org.openide.util.Exceptions; |
|
|
97 |
import org.openide.util.Parameters; |
96 |
import org.openide.util.Parameters; |
98 |
import org.openide.util.RequestProcessor; |
97 |
import org.openide.util.RequestProcessor; |
99 |
import org.openide.util.Utilities; |
98 |
import org.openide.util.Utilities; |
Lines 164-170
Link Here
|
164 |
* enable as needed. All discovered modules are returned. |
163 |
* enable as needed. All discovered modules are returned. |
165 |
* Write mutex only. |
164 |
* Write mutex only. |
166 |
*/ |
165 |
*/ |
167 |
public Set readInitial() { |
166 |
public Set<Module> readInitial() { |
168 |
ev.log(Events.START_READ); |
167 |
ev.log(Events.START_READ); |
169 |
final Set<Module> read = new HashSet<Module>(); |
168 |
final Set<Module> read = new HashSet<Module>(); |
170 |
try { |
169 |
try { |
Lines 175-180
Link Here
|
175 |
return read; |
174 |
return read; |
176 |
} |
175 |
} |
177 |
|
176 |
|
|
|
177 |
final Module createModule( |
178 |
File jarFile, ModuleHistory hist, boolean reloadable, boolean autoload, |
179 |
boolean eager, Integer startLevel |
180 |
) throws IOException { |
181 |
Module m; |
182 |
try { |
183 |
if (startLevel != null) { |
184 |
m = mgr.createBundle(jarFile, hist, reloadable, autoload, eager, startLevel); |
185 |
} else { |
186 |
m = mgr.create(jarFile, hist, reloadable, autoload, eager); |
187 |
} |
188 |
} catch (DuplicateException dupe) { |
189 |
// XXX should this be tolerated somehow? In case the original is |
190 |
// in fact scheduled for deletion anyway? |
191 |
throw new IOException(dupe); |
192 |
} |
193 |
return m; |
194 |
} |
195 |
|
178 |
/** |
196 |
/** |
179 |
* Try to find a module JAR by an XML-supplied name. |
197 |
* Try to find a module JAR by an XML-supplied name. |
180 |
* @param jar the JAR name (relative to an install dir, or a full path) |
198 |
* @param jar the JAR name (relative to an install dir, or a full path) |
Lines 427-432
Link Here
|
427 |
) { |
445 |
) { |
428 |
return Boolean.valueOf(v); |
446 |
return Boolean.valueOf(v); |
429 |
} else { |
447 |
} else { |
|
|
448 |
if (k == "startlevel") { // NOI18N |
449 |
return Integer.valueOf(v); |
450 |
} |
430 |
// Other properties are of type String. |
451 |
// Other properties are of type String. |
431 |
// Intern the smaller ones which are likely to be repeated somewhere. |
452 |
// Intern the smaller ones which are likely to be repeated somewhere. |
432 |
if (v.length() < 100) v = v.intern(); |
453 |
if (v.length() < 100) v = v.intern(); |
Lines 657-665
Link Here
|
657 |
Stamps.getModulesJARs().scheduleSave(this, "all-modules.dat", false); |
678 |
Stamps.getModulesJARs().scheduleSave(this, "all-modules.dat", false); |
658 |
} |
679 |
} |
659 |
|
680 |
|
|
|
681 |
@Override |
660 |
public void cacheReady() { |
682 |
public void cacheReady() { |
661 |
} |
683 |
} |
662 |
|
684 |
|
|
|
685 |
@Override |
663 |
public void flushCaches(DataOutputStream os) throws IOException { |
686 |
public void flushCaches(DataOutputStream os) throws IOException { |
664 |
ObjectOutputStream oss = new ObjectOutputStream(os); |
687 |
ObjectOutputStream oss = new ObjectOutputStream(os); |
665 |
for (Module m : mgr.getModules()) { |
688 |
for (Module m : mgr.getModules()) { |
Lines 957-962
Link Here
|
957 |
p.put("autoload", m.isAutoload()); // NOI18N |
980 |
p.put("autoload", m.isAutoload()); // NOI18N |
958 |
p.put("eager", m.isEager()); // NOI18N |
981 |
p.put("eager", m.isEager()); // NOI18N |
959 |
p.put("reloadable", m.isReloadable()); // NOI18N |
982 |
p.put("reloadable", m.isReloadable()); // NOI18N |
|
|
983 |
if (m.getStartLevel() > 0) { |
984 |
p.put("startlevel", m.getStartLevel()); // NOI18N |
985 |
} |
960 |
if (m.getHistory() instanceof ModuleHistory) { |
986 |
if (m.getHistory() instanceof ModuleHistory) { |
961 |
ModuleHistory hist = (ModuleHistory) m.getHistory(); |
987 |
ModuleHistory hist = (ModuleHistory) m.getHistory(); |
962 |
p.put("jar", hist.getJar()); // NOI18N |
988 |
p.put("jar", hist.getJar()); // NOI18N |
Lines 1087-1093
Link Here
|
1087 |
fileDeleted0(ev.getName(), ev.getExt()/*, ev.getTime()*/); |
1113 |
fileDeleted0(ev.getName(), ev.getExt()/*, ev.getTime()*/); |
1088 |
fileCreated0(fo.getName(), fo.getExt()/*, ev.getTime()*/); |
1114 |
fileCreated0(fo.getName(), fo.getExt()/*, ev.getTime()*/); |
1089 |
} |
1115 |
} |
1090 |
|
1116 |
|
1091 |
private void fileCreated0(String name, String ext/*, long time*/) { |
1117 |
private void fileCreated0(String name, String ext/*, long time*/) { |
1092 |
if ("xml".equals(ext)) { // NOI18N |
1118 |
if ("xml".equals(ext)) { // NOI18N |
1093 |
String codenamebase = name.replace('-', '.'); |
1119 |
String codenamebase = name.replace('-', '.'); |
Lines 1340-1353
Link Here
|
1340 |
boolean autoload = (autoloadB != null ? autoloadB.booleanValue() : false); |
1366 |
boolean autoload = (autoloadB != null ? autoloadB.booleanValue() : false); |
1341 |
Boolean eagerB = (Boolean)props.get("eager"); // NOI18N |
1367 |
Boolean eagerB = (Boolean)props.get("eager"); // NOI18N |
1342 |
boolean eager = (eagerB != null ? eagerB.booleanValue() : false); |
1368 |
boolean eager = (eagerB != null ? eagerB.booleanValue() : false); |
1343 |
Module m; |
1369 |
Integer startLevel = (Integer)props.get("startlevel"); // NOI18N |
1344 |
try { |
1370 |
ModuleHistory hist = new ModuleHistory(jar, "created from " + xmlfile); |
1345 |
m = mgr.create(jarFile, new ModuleHistory(jar, "created from " + xmlfile), reloadable, autoload, eager); |
1371 |
Module m = createModule(jarFile, hist, reloadable, autoload, eager, startLevel); |
1346 |
} catch (DuplicateException dupe) { |
|
|
1347 |
// XXX should this be tolerated somehow? In case the original is |
1348 |
// in fact scheduled for deletion anyway? |
1349 |
throw (IOException) new IOException(dupe.toString()).initCause(dupe); |
1350 |
} |
1351 |
m.addPropertyChangeListener(this); |
1372 |
m.addPropertyChangeListener(this); |
1352 |
// Mark the status as disabled for the moment, so in step 3 it will be turned on |
1373 |
// Mark the status as disabled for the moment, so in step 3 it will be turned on |
1353 |
// if in dirtyprops it was marked enabled. |
1374 |
// if in dirtyprops it was marked enabled. |
Lines 1641-1647
Link Here
|
1641 |
Boolean eagerB = (Boolean) props.get("eager"); // NOI18N |
1662 |
Boolean eagerB = (Boolean) props.get("eager"); // NOI18N |
1642 |
boolean eager = eagerB != null ? eagerB.booleanValue() : false; |
1663 |
boolean eager = eagerB != null ? eagerB.booleanValue() : false; |
1643 |
NbInstaller.register(name, props.get("deps")); // NOI18N |
1664 |
NbInstaller.register(name, props.get("deps")); // NOI18N |
1644 |
Module m = mgr.create(jarFile, history, reloadable, autoload, eager); |
1665 |
Integer startLevel = (Integer)props.get("startlevel"); // NOI18N |
|
|
1666 |
Module m = createModule(jarFile, history, reloadable, autoload, eager, startLevel); |
1645 |
NbInstaller.register(null, null); |
1667 |
NbInstaller.register(null, null); |
1646 |
read.add(m); |
1668 |
read.add(m); |
1647 |
DiskStatus status = new DiskStatus(); |
1669 |
DiskStatus status = new DiskStatus(); |