// Path: core/src/java/com/strategicgains/eventing/EventHandler.java
// public interface EventHandler
// {
// 	/**
// 	 * Process the given event. Called by the EventMonitor when an event occurs.
// 	 * 
// 	 * @param event
// 	 * @throws Exception if something goes wrong
// 	 */
// 	public void handle(Object event)
// 	throws Exception;
// 	
// 	/**
// 	 * Answers whether this EventHandler can handle events of the given type.
// 	 * If true is returned, the EventMonitor will call handle(), otherwise,
// 	 * the EventMonitor will not ask this event handler to process the event.
// 	 * 
// 	 * @param eventClass
// 	 * @return
// 	 */
// 	public boolean handles(Class<?> eventClass);
// }
// 
// Path: core/src/java/com/strategicgains/eventing/EventTransport.java
// public interface EventTransport
// {
// 	public void publish(Object event);
//     public boolean subscribe(EventHandler handler);
//     public boolean unsubscribe(EventHandler handler);
// 	public void shutdown();
// }


import java.util.Collection;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import com.strategicgains.eventing.EventHandler;
import com.strategicgains.eventing.EventTransport;

	@Override
	public void publish(Object event)
	{
		queue.add(event);

		synchronized (this)
		{
			notifyAll();
		}
	}

	/**
	 * @param value
	 */
    public void retryOnError(boolean value)
    {
		monitor.setReRaiseOnError(value);
    }

	@Override
	public void shutdown()
	{
		queue.clear();
		queue = null;
	}

    @Override
    public boolean subscribe(EventHandler handler)
    {
// Path: core/src/java/com/strategicgains/eventing/EventHandler.java
// public interface EventHandler
// {
// 	/**
// 	 * Process the given event. Called by the EventMonitor when an event occurs.
// 	 * 
// 	 * @param event
// 	 * @throws Exception if something goes wrong
// 	 */
// 	public void handle(Object event)
// 	throws Exception;
// 	
// 	/**
// 	 * Answers whether this EventHandler can handle events of the given type.
// 	 * If true is returned, the EventMonitor will call handle(), otherwise,
// 	 * the EventMonitor will not ask this event handler to process the event.
// 	 * 
// 	 * @param eventClass
// 	 * @return
// 	 */
// 	public boolean handles(Class<?> eventClass);
// }
// 
// Path: core/src/java/com/strategicgains/eventing/EventTransport.java
// public interface EventTransport
// {
// 	public void publish(Object event);
//     public boolean subscribe(EventHandler handler);
//     public boolean unsubscribe(EventHandler handler);
// 	public void shutdown();
// }


// Path: core/src/java/com/strategicgains/eventing/local/LocalEventTransport.java
import java.util.Collection;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import com.strategicgains.eventing.EventHandler;
import com.strategicgains.eventing.EventTransport;


	@Override
	public void publish(Object event)
	{
		queue.add(event);

		synchronized (this)
		{
			notifyAll();
		}
	}

	/**
	 * @param value
	 */
    public void retryOnError(boolean value)
    {
		monitor.setReRaiseOnError(value);
    }

	@Override
	public void shutdown()
	{
		queue.clear();
		queue = null;
	}

    @Override
    public boolean subscribe(EventHandler handler)
    {
		return monitor.register(handler);