// 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;
/*
    Copyright 2012, Strategic Gains, Inc.

	Licensed under the Apache License, Version 2.0 (the "License");
	you may not use this file except in compliance with the License.
	You may obtain a copy of the License at

		http://www.apache.org/licenses/LICENSE-2.0

	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
*/
package com.strategicgains.eventing.local;



/**
 * @author toddf
 * @since Oct 18, 2012
 */
public class LocalEventTransport
implements EventTransport
{
	private Queue<Object> queue = new ConcurrentLinkedQueue<Object>();
	private EventMonitor monitor;

// 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;

/*
    Copyright 2012, Strategic Gains, Inc.

	Licensed under the Apache License, Version 2.0 (the "License");
	you may not use this file except in compliance with the License.
	You may obtain a copy of the License at

		http://www.apache.org/licenses/LICENSE-2.0

	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
*/
package com.strategicgains.eventing.local;



/**
 * @author toddf
 * @since Oct 18, 2012
 */
public class LocalEventTransport
implements EventTransport
{
	private Queue<Object> queue = new ConcurrentLinkedQueue<Object>();
	private EventMonitor monitor;

	public LocalEventTransport(Collection<EventHandler> handlers, boolean shouldReraiseOnError, long pollDelayMillis)