All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.tudelft.ewi.auta.srf.iface.ScriptExecutionContext Maven / Gradle / Ivy

The newest version!
package nl.tudelft.ewi.auta.srf.iface;

import org.intellij.lang.annotations.Language;

/**
 * A context wherein scripts are to be executed.
 */
public interface ScriptExecutionContext extends AutoCloseable {
    /**
     * Submits a script for execution to the context.
     *
     * @param script the script to prepare for execution
     * @param type the type of values the script accepts
     * @param  the type of values the script accepts
     *
     * @return the prepared script
     */
     Script submitScript(@Language("ECMAScript 6") String script, Class type);

    /**
     * Destroys the context, freeing up any resources the context used.
     *
     * The context can no longer prepare scripts for execution. By default, this function does
     * nothing and is purely symbolic. Implementations may require this function, however, so
     * one should always close the context once it can be disposed of.
     *
     * This method does not destroy any scripts submitted, which have to be destroyed
     * before this method is called. Implementations are allowed to implement resource management
     * anyway, but users should not rely on such behavior.
     */
    @Override
    default void close() throws Exception {
        // Does nothing
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy