class TaskEventDispatcher {

	public void registerPartition(ResultPartitionID partitionId) {
		checkNotNull(partitionId);

		synchronized (registeredHandlers) {
			LOG.debug("registering {}", partitionId);
			if (registeredHandlers.put(partitionId, new TaskEventHandler()) != null) {
				throw new IllegalStateException(
					"Partition " + partitionId + " already registered at task event dispatcher.");
			}
		}
	}

}