@Override
	public synchronized void attachListener(IProcessComponentListener listener) {
		this.listeners.add(listener);

		// fire event if it already occurred
		if (state == ProcessState.EXECUTING) {
			listener.onExecuting(new ProcessEventArgs(this));
		} else if (state == ProcessState.ROLLBACKING) {
			listener.onRollbacking(new ProcessEventArgs(this));
		} else if (state == ProcessState.PAUSED) {
			listener.onPaused(new ProcessEventArgs(this));
		} else if (state == ProcessState.EXECUTION_SUCCEEDED) {
			listener.onExecutionSucceeded(new ProcessEventArgs(this));
		} else if (state == ProcessState.EXECUTION_FAILED) {
			listener.onExecutionFailed(new ProcessEventArgs(this));
		} else if (state == ProcessState.ROLLBACK_SUCCEEDED) {
			listener.onRollbackSucceeded(new ProcessEventArgs(this));
		} else if (state == ProcessState.ROLLBACK_FAILED) {
			listener.onRollbackFailed(new ProcessEventArgs(this));
		}
	}