@Override
	public synchronized void registerListener(EventListener observer)
	{
		if(observer != null) {
			if(observers == null) observers = new LinkedList<EventListener>();
			
			synchronized (observers) {
				observers.add(observer);
			}
			
			// relay events occurred previously to new listener
			if(events != null) {
				while(!events.isEmpty()) {
					notifyObservers(events.removeFirst());
				}
				
				events = null;
			}
		}
	}