net.esper.core
Class EventTypeResolutionServiceImpl

java.lang.Object
  extended by net.esper.core.EventTypeResolutionServiceImpl
All Implemented Interfaces:
EventTypeResolutionService

public class EventTypeResolutionServiceImpl
extends java.lang.Object
implements EventTypeResolutionService

Implementation for resolving event name to event type.


Constructor Summary
EventTypeResolutionServiceImpl(java.util.Map<java.lang.String,java.lang.String> eventNameClassNameMap)
          Ctor.
 
Method Summary
protected static EventType lookupClass(java.lang.String className)
          Lookup a Java class using Class.forName and return the event type.
protected static java.util.Map<java.lang.String,EventType> mapToTypes(java.util.Map<java.lang.String,java.lang.String> mappedEventClasses)
          Returns a map of event name and event type for a map of event name and Java class name.
 EventType resolveEventType(java.lang.String eventName)
          Return the event type for a given event name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventTypeResolutionServiceImpl

public EventTypeResolutionServiceImpl(java.util.Map<java.lang.String,java.lang.String> eventNameClassNameMap)
                               throws ConfigurationException
Ctor.

Parameters:
eventNameClassNameMap - is a mapping of event name to fully qualified java class name
Throws:
ConfigurationException - is throw to indicate the mapped-to classes are invalid
Method Detail

resolveEventType

public EventType resolveEventType(java.lang.String eventName)
Description copied from interface: EventTypeResolutionService
Return the event type for a given event name.

Specified by:
resolveEventType in interface EventTypeResolutionService
Parameters:
eventName - is the event name to return type for
Returns:
event type for named event

mapToTypes

protected static java.util.Map<java.lang.String,EventType> mapToTypes(java.util.Map<java.lang.String,java.lang.String> mappedEventClasses)
Returns a map of event name and event type for a map of event name and Java class name.

Parameters:
mappedEventClasses - map of event name and java class name
Returns:
map of event name and event type

lookupClass

protected static EventType lookupClass(java.lang.String className)
Lookup a Java class using Class.forName and return the event type.

Parameters:
className - is the fully qualified Java class name to get event type
Returns:
event type for java class