Page tree
Skip to end of metadata
Go to start of metadata

Resource Loading

There are a number of ways that Java supports finding and opening resources:

  • URL findResource(String resource) - returns a resource, or null if not found.
  • Enumeration findResources(String resource) - returns an enumeration of resource URL's which match the given string.
  • URL.openConnection() - opens a connection to a resource by its URL.

Nsys-Boot supports all of these mechanisms within the context of a Nsys-Boot archive file, which may contain Jar files that have duplicate resources.

Resource Ordering

Nsys-Boot defines a predictable order for classloading:

  1. The Nsys-Boot archive file
  2. System Loader (e.g. boot/nsys-daemon-main.jar)
  3. lib/*.jar
  4. External JARs (added by system property nsys-boot.class.path)
  5. Parent classloader

Duplicate Resources

Every Jar file has a required META-INF/MANIFEST.MF file. With more than one Jar inside a Nsys-Boot executable there will therefore be duplicates. Fortunately, this file is not a problem, since a normal Java application usually has many Jar files (or other codebases) on its classpath, meaning that it must use scanning to locate its own MANIFEST resources. Nsys-Boot will have no impact in this situation.

  • No labels