Class TasksManager


  • public class TasksManager
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addRegistrationListener​(IRegistrationListener listener)
      Adds a listener to be notified of registration events.
      void deregisterTask​(java.lang.String sTaskID)
      This method removes a registered task from the TasksManager.
      ITask getTask​(java.lang.String sTaskID)
      Returns the ITask instance registered with the specified ID.
      java.lang.String[] getTasksForWizard​(java.lang.String sWizardID)
      Returns the tasks (in the correct order) registered for use with the specified wizard.
      static TasksManager instance()
      This method returns the instance of TasksManager.
      boolean isRegistered​(java.lang.String sTaskID)
      Returns whether or not a task has been registered with the specified ID.
      void registerTask​(java.lang.String sTaskID, ITask task)
      This method registers a task with the TasksManager.
      void registerWizard​(java.lang.String sWizardID, java.lang.String sTasks, java.lang.String sPosition)
      This method registers a wizard with the TasksManager.
      void removeRegistrationListener​(IRegistrationListener listener)
      Removes a registered listener.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • instance

        public static TasksManager instance()
        This method returns the instance of TasksManager. If an instance does not exist, one is created.
        Returns:
        Singleton instance of TasksManager
      • registerTask

        public void registerTask​(java.lang.String sTaskID,
                                 ITask task)
                          throws java.lang.IllegalArgumentException
        This method registers a task with the TasksManager. It throws an exception if the task ID is already in use or if the ITask instance is null.
        Parameters:
        sTaskID - The unique identifier with which the task is to be registered
        task - The ITask instance that represents the Wizard UI for the task
        Throws:
        java.lang.IllegalArgumentException - if taskID is not unique or if task argument is null
      • deregisterTask

        public void deregisterTask​(java.lang.String sTaskID)
                            throws java.lang.IllegalArgumentException
        This method removes a registered task from the TasksManager. It throws an exception if the task ID is not found.
        Parameters:
        sTaskID - The unique identifier of the task that is to be deregistered
        Throws:
        java.lang.IllegalArgumentException - if task with specified ID is not registered
      • registerWizard

        public void registerWizard​(java.lang.String sWizardID,
                                   java.lang.String sTasks,
                                   java.lang.String sPosition)
                            throws java.lang.IllegalArgumentException
        This method registers a wizard with the TasksManager. It throws an exception if the WizardID instance is null.
        Parameters:
        sWizardID - The unique identifier of the wizard
        sTasks - A comma separated list of TaskIDs that specify tasks to be automatically added to the wizard on invocation
        sPosition - A TaskID before which the above list of tasks should be inserted in the wizard
        Throws:
        java.lang.IllegalArgumentException - if WizardID is null
      • getTask

        public ITask getTask​(java.lang.String sTaskID)
        Returns the ITask instance registered with the specified ID.
        Parameters:
        sTaskID - The ID uniquely identifying the task to be obtained
        Returns:
        the task currently registered with the specified ID
      • getTasksForWizard

        public java.lang.String[] getTasksForWizard​(java.lang.String sWizardID)
        Returns the tasks (in the correct order) registered for use with the specified wizard. If a wizard with such an ID has not been registered, an empty array is returned.
        Parameters:
        sWizardID - The ID uniquely identifying the wizard whose tasks are to be returned
        Returns:
        an array of task IDs currently registered for use with the specified wizard
      • isRegistered

        public boolean isRegistered​(java.lang.String sTaskID)
        Returns whether or not a task has been registered with the specified ID. This can be used to determine if an ID being used for a task is actually unique before attempting to register it.
        Parameters:
        sTaskID - The ID which is to be checked.
        Returns:
        true if there exists a task registered with the specified ID, false otherwise
      • addRegistrationListener

        public void addRegistrationListener​(IRegistrationListener listener)
        Adds a listener to be notified of registration events.
        Parameters:
        listener - Instance of IRegistrationListener that should be notified on events
      • removeRegistrationListener

        public void removeRegistrationListener​(IRegistrationListener listener)
        Removes a registered listener. This listener will no longer recieve notification of registration events.
        Parameters:
        listener - Instance of IRegistrationListener that should be removed