saker.build Documentation TaskDoc JavaDoc Packages
public interface ClassPathLoadManager.ClassPathLock extends Closeable
A handle and a lock to a loaded classpath.

Instances of this interface must be closed when no longer used. Closing it will allow classpath managers to reload the underlying classpath files.

Methods
public void
Closes this stream and releases any system resources associated with it.
public ClassLoaderDataFinder
Gets a classloader data finder for the loaded classpath.
public Path
Gets the directory where the classpath was actually loaded.
public Path
Gets the path to the loaded classpath.
public String
Gets the location identifier which was returned by the corresponding ClassPathLocation.
public Object
Gets a version object representation of the loaded classpath.
public abstract void close()
Overridden from: Closeable
Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable.close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Gets a classloader data finder for the loaded classpath.

Classloader data finders can be used to construct a classloader. See MultiDataClassLoader.

The classloader data finder.
Gets the directory where the classpath was actually loaded.
The path to the load directory.
public abstract Path getClassPathPath()
Gets the path to the loaded classpath.

The returned path is either a path to a JAR file, or a directory containing class files in the respective package hierarchy.

The path to the classpath.
public abstract String getLocationIdentifier()
Gets the location identifier which was returned by the corresponding ClassPathLocation.
The location identifier.
public abstract Object getVersion()
Gets a version object representation of the loaded classpath.

Version objects can be compared by equality to check if the classpath was reloaded between different lock retrievals. Clients can be sure that if two version objects equal, then the associated classpaths to the version objects contain the same files.

Note, that even if the compared versions equal, the associated class loader data finder may have been reloaded meanwhile. This means that if you plan on reusing the class loaders based on the associated class loader data finder, then you need to ensure that always the most recent class loader data finder is used by your classloader.

The load version.