Interface SkillExecutor

  • All Known Subinterfaces:
    Kernel

    public interface SkillExecutor
    • Method Detail

      • importSkillFromDirectory

        ReadOnlyFunctionCollection importSkillFromDirectory​(String skillName,
                                                            String parentDirectory,
                                                            String skillDirectoryName)
        Imports the native functions annotated on the given object as a skill.
        Parameters:
        skillName - name of the skill
        Returns:
        the function collection
      • importSkillsFromDirectory

        void importSkillsFromDirectory​(String parentDirectory,
                                       String... skillNames)
        Imports the native functions annotated on the given object as a skill.
      • importSkillFromDirectory

        ReadOnlyFunctionCollection importSkillFromDirectory​(String skillName,
                                                            String parentDirectory)
        Imports the native functions annotated on the given object as a skill. Assumes that the directory that contains the skill is the same as skillName
        Parameters:
        skillName - name of the skill
        parentDirectory - directory that contains the skill
        Returns:
        the function collection
      • importSkillFromResources

        ReadOnlyFunctionCollection importSkillFromResources​(String pluginDirectory,
                                                            String skillName,
                                                            String functionName)
                                                     throws KernelException
        Imports a skill using ClassLoader.getResourceAsStream to load skills from the classpath.
        Parameters:
        pluginDirectory - directory within the classpath that contains the skill
        skillName - name of the skill
        functionName - name of the function
        Returns:
        the function collection
        Throws:
        KernelException - if it is not possible to correctly load the skill
      • importSkillFromResources

        ReadOnlyFunctionCollection importSkillFromResources​(String pluginDirectory,
                                                            String skillName,
                                                            String functionName,
                                                            @Nullable
                                                            Class clazz)
                                                     throws KernelException
        Imports a skill using clazz.getResourceAsStream to load skills from the classpath.
        Parameters:
        skillName - name of the skill
        functionName - name of the function
        clazz - class that contains the skill
        Returns:
        the function collection
        Throws:
        KernelException - if it is not possible to correctly load the skill
      • importSkill

        ReadOnlyFunctionCollection importSkill​(Object nativeSkill,
                                               @Nullable
                                               String skillName)
        Imports the native functions annotated on the given object as a skill.
        Parameters:
        nativeSkill - object containing the native functions
        skillName - name of the skill
        Returns:
        the function collection
      • getSkills

        ReadOnlySkillCollection getSkills()
        Returns:
        Reference to the read-only skill collection containing all the imported functions