Package ej.kf

Class Module

  • Direct Known Subclasses:
    Feature, Kernel

    public class Module
    extends Object
    A Module is either Kernel or a Feature. It owns a set of classes, objects, threads and stack contexts.
    • Method Detail

      • getName

        public String getName()
        Gets the name of this module.
        Returns:
        the internal name
      • getProvider

        public Principal getProvider()
        Gets the identification of this module provider.
        Returns:
        the module identification.
      • getVersion

        public String getVersion()
        Gets a String that represents this module version.
        Returns:
        the module version
      • getUID

        public byte[] getUID()
        Gets a byte sequence that uniquely identifies the current module.
        Returns:
        this module UID
      • setExecutionQuota

        public void setExecutionQuota​(int quota)
        Sets the execution quota allocated to the threads owned by this Module. This quota is expressed in execution units.

        A Thread owned by a Module which execution quota set to 0 will never be scheduled.

        A Thread owned by a Module which execution quota set to -1 is always eligible to scheduling.

        Calling this method induces a global reset of the quantum of all the Modules.

        A Module is created with an execution quota set to -1. When the quota of all Module is set to -1, the execution counting is disabled. When the quota of a Module is set to a value other than -1, the execution counting is enabled.

        Parameters:
        quota - the execution quota to set to this Module in execution units
        Throws:
        IllegalArgumentException - if the given quota is lower than -1.
      • getExecutionQuota

        public int getExecutionQuota()
        Gets the execution quota.
        Returns:
        the quota of this Module in execution units.
      • getExecutionCounter

        public long getExecutionCounter()
        Gets the current execution counter, since the last reset. The execution counters are reset each time setExecutionQuota(int) is called on a Module.
        Returns:
        the total amount of execution units that has been consumed by threads owned by this Module, or 0 if execution counting is disabled.
      • getAllocatedMemory

        public long getAllocatedMemory()
        Returns the amount of allocated memory by this module.

        To get an accurate value of the allocated memory, run the garbage collector Runtime.gc() or System.gc() before calling this method.

        Returns:
        the amount of allocated memory by this module, measured in bytes.