xmlBlaster 2.2.0 client API

org.xmlBlaster.util.queue
Class StorageEventHandler

java.lang.Object
  extended by org.xmlBlaster.util.queue.StorageEventHandler
Direct Known Subclasses:
QueueEventHandler

public abstract class StorageEventHandler
extends java.lang.Object

StorageEventHandler is base class for MapEventHandler and QueueEventHandler. There is exactly zero or one instance per StoragePluginManager, it hold all EventHelper instances (one for each configured rule for each EventPlugin) TODO: Should be one for each EventPlugin to support multiple eventPlugins using thresholds as the EventPlugin must be the listener for the events (to transport them to the configured sinks)

Author:
Michele Laghi

Field Summary
static java.lang.String EVENT_HANDLER
           
protected  I_EventDispatcher eventDispatcher
           
protected  java.util.Map wantedEventsMap
          Contains the configured eventTypes from EventPlugin (typically one only)
 
Constructor Summary
StorageEventHandler(I_EventDispatcher dispatcher)
           
 
Method Summary
 EventHelper generateEventHelper(StorageId storageId)
          Create an EventHelper instance which matches exactly the given storageId (no wildcards).
 EventHelper[] getEventHelpers()
           
 boolean hasRegisteredEventHelpers()
           
 void initialRegistration(java.util.Map storageMap)
          Callback from StoragePluginManager on registration
abstract  void registerEventType(I_EventDispatcher dispatcher, java.lang.String event)
          Base class fills this.eventsHelperMap
 void registerListener(I_Storage storage)
           
 void removeListener(I_Storage storage)
           
 void removeListeners(java.util.Map storageMap)
           
 void unRegisterEventHelpers(I_EventDispatcher l)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wantedEventsMap

protected java.util.Map wantedEventsMap
Contains the configured eventTypes from EventPlugin (typically one only)


eventDispatcher

protected I_EventDispatcher eventDispatcher

EVENT_HANDLER

public static final java.lang.String EVENT_HANDLER
See Also:
Constant Field Values
Constructor Detail

StorageEventHandler

public StorageEventHandler(I_EventDispatcher dispatcher)
Method Detail

registerListener

public void registerListener(I_Storage storage)
                      throws XmlBlasterException
Throws:
XmlBlasterException

removeListener

public void removeListener(I_Storage storage)

removeListeners

public void removeListeners(java.util.Map storageMap)
                     throws XmlBlasterException
Throws:
XmlBlasterException

hasRegisteredEventHelpers

public boolean hasRegisteredEventHelpers()

getEventHelpers

public EventHelper[] getEventHelpers()

unRegisterEventHelpers

public void unRegisterEventHelpers(I_EventDispatcher l)

registerEventType

public abstract void registerEventType(I_EventDispatcher dispatcher,
                                       java.lang.String event)
                                throws XmlBlasterException
Base class fills this.eventsHelperMap

Parameters:
dispatcher -
event -
Throws:
XmlBlasterException

initialRegistration

public void initialRegistration(java.util.Map storageMap)
                         throws XmlBlasterException
Callback from StoragePluginManager on registration

Parameters:
storageMap - The caller has synchronized the storageMap
Throws:
XmlBlasterException

generateEventHelper

public EventHelper generateEventHelper(StorageId storageId)
                                throws XmlBlasterException
Create an EventHelper instance which matches exactly the given storageId (no wildcards).

Parameters:
storageId -
Returns:
null if unknown storageId format
Throws:
XmlBlasterException

xmlBlaster 2.2.0 client API

Copyright © 1999-2014 The xmlBlaster.org contributers.