com.jstatcom.project
Class ProjectDataManager

java.lang.Object
  extended by com.jstatcom.project.ProjectDataManager

public final class ProjectDataManager
extends java.lang.Object

Singleton mediator class for managing setting and getting of all project data to and from the respective handlers. All instances of ProjectDataHandler must register with this class at program start.

Author:
Markus Kraetzig

Method Summary
static ProjectDataManager getInstance()
          Gets the singleton instance of this class.
 ProjectData[] getProjectData()
          Gets an array with all project data from the data handlers that have been registered with this manager.
 void register(ProjectDataHandler handler)
          Registers a project data handler with this manager class.
 void setProjectData(ProjectData data)
          Sets the project data to the respective handler.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ProjectDataManager getInstance()
Gets the singleton instance of this class.

Returns:
project data manager

setProjectData

public void setProjectData(ProjectData data)
Sets the project data to the respective handler.

Parameters:
data - the project data to set
Throws:
java.lang.IllegalArgumentException - if (data == null)

getProjectData

public ProjectData[] getProjectData()
Gets an array with all project data from the data handlers that have been registered with this manager.

Returns:
project data array

register

public void register(ProjectDataHandler handler)
Registers a project data handler with this manager class. Only one handler is allowed for each instance of ProjectDataTypes.

Parameters:
handler - data handler object that should take part in the project management system
Throws:
java.lang.IllegalArgumentException - if (handler == null)
java.lang.IllegalStateException - if another listener has already been registered for the same project data type