Package org.pkl.core.externalreader
Interface ExternalReaderProcess
- All Superinterfaces:
AutoCloseable
An external process that reads Pkl modules and resources.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this process, releasing any associated resources.getModuleReaderSpec(String scheme) Returns the spec, if available, of this process's module reader with the given scheme.getModuleResolver(long evaluatorId) Returns a resolver for modules provided via this reader.getResourceReaderSpec(String scheme) Returns the spec, if available, of this process's resource reader with the given scheme.getResourceResolver(long evaluatorId) Returns a resolver for resources provided via this reader.static ExternalReaderProcessCreates a newExternalReaderProcessfrom the given spec.
-
Method Details
-
of
Creates a newExternalReaderProcessfrom the given spec. No resources are allocated at this time. -
getModuleResolver
Returns a resolver for modules provided via this reader.Upon first call, this method may allocate resources, including spawning a child process.
- Throws:
IllegalStateException- if this process has already been closedExternalReaderProcessException
-
getResourceResolver
ExternalResourceResolver getResourceResolver(long evaluatorId) throws ExternalReaderProcessException Returns a resolver for resources provided via this reader.Upon first call, this method may allocate resources, including spawning a child process.
- Throws:
IllegalStateException- if this process has already been closedExternalReaderProcessException
-
getModuleReaderSpec
Returns the spec, if available, of this process's module reader with the given scheme.- Throws:
IllegalStateException- if this process has already been closedIOException- if an I/O error occurs
-
getResourceReaderSpec
Returns the spec, if available, of this process's resource reader with the given scheme.- Throws:
IllegalStateException- if this process has already been closedIOException- if an I/O error occurs
-
close
void close()Closes this process, releasing any associated resources.This method can be safely called multiple times. Subsequent calls have no effect.
- Specified by:
closein interfaceAutoCloseable
-