net.sf.asterisk.manager
Interface EventBuilder

All Known Implementing Classes:
EventBuilderImpl

public interface EventBuilder

Transforms maps of attributes to instances of ManagerEvent.

Version:
$Id: EventBuilder.java,v 1.9 2005/09/13 19:59:59 srt Exp $
Author:
srt
See Also:
ManagerEvent

Method Summary
 ManagerEvent buildEvent(java.lang.Object source, java.util.Map attributes)
          Builds the event based on the given map of attributes and the registered event classes.
 void registerEventClass(java.lang.Class clazz)
          Registers a new event class.
 

Method Detail

registerEventClass

void registerEventClass(java.lang.Class clazz)
Registers a new event class. The event this class is registered for is simply derived from the name of the class by stripping any package name (if present) and stripping the sufffix "Event". For example net.sf.asterisk.manager.event.JoinEvent is registered for the event "Join".

Parameters:
clazz - the event class to register, must extend net.sf.asterisk.manager.event.ManagerEvent.

buildEvent

ManagerEvent buildEvent(java.lang.Object source,
                        java.util.Map attributes)
Builds the event based on the given map of attributes and the registered event classes.

Parameters:
source - source attribute for the event
attributes - map containing event attributes
Returns:
a concrete instance of ManagerEvent or null if no event class was registered for the event type.


Copyright © 2004-2005 Stefan Reuter. All Rights Reserved.