Interface IExternalValueFactory

All Known Implementing Classes:
DefaultExternalValueFactory

public interface IExternalValueFactory
This class provides run-time support only. It creates and destroys certain types based on load and unload
  • Method Summary

    Modifier and Type
    Method
    Description
    changeWorkingDirectory(Path newSuggestion, InputStream config)
    Requests the current factory to return a new instance with the working directory changed
    com.spencerwi.either.Either<Exception,Value>
    create(String loaderName, List<Value> args)
    Creates a new interpreter value for the specified type using the supplied arguments
    destroy(Value value)
    Destruction of values created by the factory.
    boolean
    Check if a certain type is supported by the external value factory
  • Method Details

    • supports

      boolean supports(String type) throws Exception
      Check if a certain type is supported by the external value factory
      Parameters:
      type -
      Returns:
      true if the type is supported by create(String, List)
      Throws:
      Exception
    • create

      com.spencerwi.either.Either<Exception,Value> create(String loaderName, List<Value> args)
      Creates a new interpreter value for the specified type using the supplied arguments
      Parameters:
      loaderName - the type to create
      args - the arguments used to create the value
      Returns:
      the value or an exception if creation fails
    • destroy

      Value destroy(Value value) throws InterpreterException
      Destruction of values created by the factory. Destruction must make sure all resources hold by this value is freed
      Parameters:
      value - the value to destroy
      Returns:
      void return
      Throws:
      InterpreterException - any destruction error description
    • changeWorkingDirectory

      IExternalValueFactory changeWorkingDirectory(Path newSuggestion, InputStream config) throws Exception
      Requests the current factory to return a new instance with the working directory changed
      Parameters:
      newSuggestion - a suggested path for a new directory
      config - optionally a new config can be null
      Returns:
      a new factory which operates from the suggested path
      Throws:
      Exception