Class CoreTask

    • Constructor Detail

      • CoreTask

        public CoreTask​(NyxExtension extension)
        Standard constructor.
        Parameters:
        extension - the extension object. Cannot be null.
    • Method Detail

      • getExtension

        @Internal
        protected NyxExtension getExtension()
        Returns the instance of the extension for the task.
        Returns:
        the extension for the task
      • hasSharedProperty

        protected boolean hasSharedProperty​(String name)
        Returns true if there is a project with the given name stored for the project.
        Parameters:
        name - the name of the property to look up
        Returns:
        true if there is a project with the given name stored for the project
      • storeSharedProperty

        protected void storeSharedProperty​(String name,
                                           Object value)
        Stores the given value as a shared project property with the given name. The name makes the property unique within the entire project.
        Parameters:
        name - the name of the property to store
        value - the value of the property to store
      • retrieveSharedProperty

        protected Object retrieveSharedProperty​(String name)
        Retrieves the shared project property with the given name. The name makes the property unique within the entire project.
        Parameters:
        name - the name of the property to retrieve
        Returns:
        the value of the shared property with the given name, if any, or null if no property with such name is available
      • nyx

        protected Nyx nyx()
                   throws DataAccessException,
                          IllegalPropertyException
        Returns a shared backing Nyx instance to be used by all tasks within the project. The returned instance is already configured with the values coming from the NyxExtension. This method also stores the instance as a shared project property so that all subsequent calls can retrieve the same instance to avoid creating multiple instances and saving configuration time. Moreover, the backing instance state object reference is stores as an extra property for use by user scripts. The instance is lazily created upon the first invocation so the Nyx instance is only created when needed.
        Returns:
        a shared backing Nyx instance to be used by all tasks within the project.
        Throws:
        DataAccessException - in case the configuration can't be loaded for some reason.
        IllegalPropertyException - in case the configuration has some illegal options.