Interface InitTabManager

  • All Superinterfaces:
    ADEPT2Service, InstanceStateListener

    public interface InitTabManager
    extends InstanceStateListener
    Service which executes processes on system boot, shutdown and during runtime.

    The init tab entries

    An init tab entry specifies in which situation (init type), in which order (level), which process template shall be executed.

    The init tab types

    The init tab supports different types:
    • InitType.BOOT - the process is executed immediately after the init tab manager service has been started. The processes are executed in the order of their level. If an entry is set to "fork", the init tab manager will not wait for its completion but immediately proceed to the next entry.
    • InitType.RESPAWN - the re-spawn processes will be started after the boot entries have been completed. Whenever a process of type InitType.RESPAWN is terminated - successful or failing - a new instance will be started again immediately. When the init tab manager is being shut down, all of the re-spawn processes will be stopped, propagating the stop request to all running activities.
    • InitType.SHUTDOWN - the processes are executed during shutdown of the system in the order of their level. No fork will be allowed here, the service awaits the termination of all InitType.SHUTDOWN processes.

    The init tab

    The init tab consists of multiple init tab entries. Note, that init type and init level define one entry, i.e. there may be exactly one entry and therefore exactly one process template per init level (in contrast to UNIX style init tabs).

    General Notes

    It is not recommended having init tab entries with processes which make use of user interaction, especially as init type entry InitType.SHUTDOWN.
    Note, that there are some restrictions for the execution of init tab entries, e.g. are dependent staff assignment rules referring to the instance initiator not possible.

    Process Input

    It is possible to supply a data container as input for an init tab entry.
    • Method Detail

      • registerNewEntry

        void registerNewEntry​(SessionToken session,
                              InitTabEntry entry,
                              DataContainer inputData)
        This method changes the ID of the designated entry, so provide just any ID.
        Parameters:
        session - Session token for authorisation.
        entry - The new init tab entry.
        inputData - The input data container, or null if not applicable.
        Throws:
        IllegalArgumentException - If an entry for given type and level exists already.
      • removeInitTabEntry

        void removeInitTabEntry​(SessionToken session,
                                InitType type,
                                int level,
                                boolean abortInstance)
        Removes an init tab entry and optionally aborts a possibly running instance.
        Parameters:
        session - Session token for authorisation.
        type - The init type.
        level - The init level.
        abortInstance - If set to true, and there is currently an instance running, it will be aborted (propagating to running activities, too).
        Throws:
        IllegalArgumentException - If no entry for given type and level exists.
      • getInstanceIDForEntry

        UUID getInstanceIDForEntry​(SessionToken session,
                                   InitType type,
                                   int level)
        Returns the ID of the currently or last running instance of the given init tab entry, returns null if no instance has run yet.
        Parameters:
        session - Session token for authorisation.
        type - The init type.
        level - The init level.
        Returns:
        The ID of the currently or last running instance, or null if none.
        Throws:
        IllegalArgumentException - If no entry for given type and level exists.
      • getInitTabInputData

        DataContainer getInitTabInputData​(SessionToken session,
                                          InitType type,
                                          int level)
        Returns the input data for the given init tab entry, or null if not applicable.
        Parameters:
        session - Session token for authorisation.
        type - The init type.
        level - The init level.
        Returns:
        The init tab input data.
        Throws:
        IllegalArgumentException - If no entry for given type and level exists.