private boolean invokeEvents(boolean valid)
	{
		E event = null;
		// Take all events from the event queue and process them.
		for (;;) 
		{
			// Clear event, very important!
			event = null;
			
			// Enter blocking section with caution!
			if (release.enter()) {
				try {
					event = eventQueue.poll();	
				}
				finally {
					release.exit();	
				}
			}
			
			// If event was null (queue is empty and it returned
			// immediately or it was awoken by an attempt to pause or
			// stop the server) then stop processing events.
			if (event == null) {
				canEvent();
				break;	
			}
			
			// If events can be processed right now...
			if (canEvent()) 
			{
				// Adjust validation based on remaining events.
				valid &= (remainingEvents == -1 || --remainingEvents >= 0);

				// If the service state is valid, notify listeners.
				if (valid) {
					// Quicker then calling the proxy, and this could
					// be called VERY frequently.
					// notifier.proxy().onServiceEvent(this, event);
					for (ServiceListener<E> listener : notifier) {
						listener.onServiceEvent(this, event);
					}
				}
			}
		}	
		return valid;
	}