|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.adapter.event.AbstractEventGenerator
com.bea.adapter.event.AbstractPullEventGenerator
A class that does work for an event generator. Adapter providers can override methods on this class to provide EIS specific event generation logic.
NOTE: This class implements the methods needed to support the ISuspendableEventGenerator interface. This class does NOT, however, implement ISuspendableEventGenerator. The decision to implement or not is left to the subclasses of this class. However, if a subclass does decide to implement ISuspendableEventGenerator, they can simply delegate the calls on this interface to 'super'.
Field Summary |
Fields inherited from class com.bea.adapter.event.AbstractEventGenerator |
m_setOfEventTypes |
Constructor Summary | |
AbstractPullEventGenerator()
|
Method Summary | |
protected void |
checkInitializeState()
Checks initialization state of PullEventGenerator |
protected void |
checkThreadState()
Checks the thread state of the PullEventGenerator |
protected void |
doCleanUpOnQuit()
Performs any clean-up needed once this object determines that it is time to quit running. |
protected void |
doInit(Map map)
Performs EIS specific initialization of this object based on properties in the map argument. |
boolean |
isSuspended()
Indicates if this thread is in the suspended state. |
protected abstract void |
postEvents(IEventRouter router)
Posts EIS events to the event router. |
protected abstract void |
removeDeadTypes(List listOfDeadTypes)
Allows this instance to apply any EIS specific setup logic needed to handle dead event types; an event type is considered dead if it is no longer in the list of event types known to the router. |
void |
resume()
Resume the generation of events. |
void |
run()
Runnable implementation. |
protected abstract void |
setupNewTypes(List listOfNewTypes)
Allows this instance to apply any EIS specific setup logic needed to handle new event types provided by the event router. |
void |
start()
Starts the PullEventGenerator to polling. |
void |
stop()
Notifies this thread that it should stop posting events to the event router. |
void |
suspend()
Suspend (temporarily) the generation of events. |
Methods inherited from class com.bea.adapter.event.AbstractEventGenerator |
assertValidLicense, checkLicense, createSetOfEventTypes, getEventDefinition, getEventTypes, getInitializationParms, getLogContext, getLogger, getRouter, getSleepCount, handlePostEventException, init, isEventTypeKnownToRouter, isInitialized, logDeadTypes, logEventTypes, logNewTypes, logPostEventException, refresh |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractPullEventGenerator()
Method Detail |
protected void doInit(Map map) throws Exception
map
argument. Adapter developers must override this
method according to their EIS specific needs.
doInit
in class AbstractEventGenerator
Exception
- - an exceptional condition was encountered while
attempting to initialize this object based on properties in the map;
perhaps the map is missing a required parameter.protected void checkInitializeState() throws Exception
Exception
protected void checkThreadState() throws Exception
Exception
protected void doCleanUpOnQuit() throws Exception
doCleanUpOnQuit
in class AbstractEventGenerator
Exception
- - an exceptional condition was encountered while
attempting to clean-up resources used by this instance.protected abstract void postEvents(IEventRouter router) throws Exception
isEventTypeKnownToRouter
before processing an event because
this worker should not waste computing cycles on generating events that
the router does not care about. For implementations that can post
multiple events from a single call to postEvents, they should periodically
check the value of isSuspended
and return in a timely fashion
when it returns true. This method is invoked in a block of code
that is synchronized around the set of event types maintained by this
instance. Thus, any concurrent calls to the refresh
from
another thread will need to wait until this method returns.
Iterator i = getEventTypes(); while (i.hasNext()) { String strEventType = (String)i.next(); IEventDefinition eventDef = new EventDefinition(); eventDef.setName(strEventType); IEvent event = new Event("<" + strEventType + ">bogus" + strEventType + ">"); event.setEventDefinition(eventDef); try { m_router.postEvent(event); } catch (Exception exc) { handlePostEventException(event, exc); } // end try/catch } // end while
Exception
public void suspend() throws Exception
Exception
public void resume() throws Exception
Exception
public boolean isSuspended()
public void run()
run
in interface Runnable
public void start() throws Exception
start
in interface IEventGenerator
start
in class AbstractEventGenerator
Exception
public void stop() throws Exception
stop
in interface IEventGenerator
stop
in class AbstractEventGenerator
Exception
protected abstract void setupNewTypes(List listOfNewTypes) throws Exception
setupNewTypes
in class AbstractEventGenerator
listOfNewTypes
- - a list of new types (IEventDefinition objects)that
were not in the set of event types maintained by this instance prior
to the refresh.
Exception
protected abstract void removeDeadTypes(List listOfDeadTypes) throws Exception
removeDeadTypes
in class AbstractEventGenerator
listOfDeadTypes
- - a list of event types (IEventDefinition objects)
that were not in the list of event types provided by the router and
were in the set maintained by this instance prior to the refresh.
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |