|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.adapter.event.AbstractEventGenerator
public abstract class AbstractEventGenerator
Provides a base implementation of an event generator; an event generator is responsible for polling for an Event and posting an Event to the Event router.
Field Summary | |
---|---|
protected HashSet |
m_setOfEventTypes
|
Constructor Summary | |
---|---|
AbstractEventGenerator()
|
Method Summary | |
---|---|
protected void |
assertValidLicense()
Verifies the existence of a valid license for this adapter; if there is no valid license available, this method throws an exception to prevent the instantiation of a ManagedConnectionFactory object. |
protected ValidationResult |
checkLicense()
Returns true if the adapter can locate a valid license in the runtime environment. |
protected HashSet |
createSetOfEventTypes(Set currentSetOfEventTypes,
List listOfNewTypes,
List listOfDeadTypes)
Creates a set of event types that are known to the router. |
protected abstract void |
doCleanUpOnQuit()
Performs any clean-up needed once this object determines that it is time to quit running. |
protected abstract void |
doInit(Map map)
EIS specific initialization, only called once. |
protected com.bea.wlai.common.IEventDefinition |
getEventDefinition(String strEventType)
|
protected Iterator |
getEventTypes()
|
protected Map |
getInitializationParms()
Accessor for initialization parms |
LogContext |
getLogContext()
Retrieves an object that determines the logging configuration for this instance in the logging framework. |
ILogger |
getLogger()
Retrieves an object used to log information to. |
protected IEventRouter |
getRouter()
Accessor for router object. |
protected long |
getSleepCount()
Accessor for sleep count |
protected void |
handlePostEventException(com.bea.wlai.common.IEvent event,
Exception exc)
Convenience method to handle an exception while posting an event; currently this method invokes logPostEventException. |
void |
init(IEventRouter router,
Map map)
intializes the EventGenerator. |
protected boolean |
isEventTypeKnownToRouter(String strEventType)
|
boolean |
isInitialized()
Validation method. |
protected void |
logDeadTypes(List listOfDeadTypes)
Logs the list of dead types as information |
protected void |
logEventTypes(ILogger logger,
Set setOfEventTypes)
Convenience method for event type logging |
protected void |
logNewTypes(List listOfNewTypes)
Logs the list of new types as information |
protected void |
logPostEventException(com.bea.wlai.common.IEvent event,
Exception exc)
Convenience method for logging an exception that occured while attempting to post an event to the event router. |
void |
refresh()
Refreshes the set of event types known to this worker. |
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. |
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. |
abstract void |
start()
Starts the EventGenerator |
abstract void |
stop()
Stops the Event Generator |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected HashSet m_setOfEventTypes
Constructor Detail |
---|
public AbstractEventGenerator()
Method Detail |
---|
public void init(IEventRouter router, Map map) throws Exception
init
in interface IEventGenerator
router
- IEventRouter routermap
- Map initialization parms
Exception
public boolean isInitialized()
protected abstract void doInit(Map map) throws Exception
Exception
protected IEventRouter getRouter()
protected Map getInitializationParms()
protected long getSleepCount()
public LogContext getLogContext()
public ILogger getLogger()
protected abstract void doCleanUpOnQuit() throws Exception
Exception
- - an exceptional condition was encountered while
attempting to clean-up resources used by this instance.protected boolean isEventTypeKnownToRouter(String strEventType)
strEventType
is known to the event router. If
an event type is known to the router, it should be posted to the router.protected com.bea.wlai.common.IEventDefinition getEventDefinition(String strEventType)
strEventType
if present in our set of event types; null if not.protected Iterator getEventTypes()
protected void logEventTypes(ILogger logger, Set setOfEventTypes)
protected void logNewTypes(List listOfNewTypes)
protected void logDeadTypes(List listOfDeadTypes)
protected HashSet createSetOfEventTypes(Set currentSetOfEventTypes, List listOfNewTypes, List listOfDeadTypes)
currentSetOfEventTypes
- - a snapshot of the current set of event
types configured for this event generator; can be nulllistOfNewTypes
- - this method will add any types found in the
list provided by the router not currently in the set of types known to this
worker if this parameter is not null.listOfDeadTypes
- - this method will add any types not found in the
list of event types provided by the router and were in the set maintained
by this instance prior to the refresh.public void refresh() throws Exception
setupNewTypes
. Similarly, if there are any event types that
were previously known this worker that are no longer used by the router,
this method invokes the removeDeadTypes
method.
refresh
in interface IEventGenerator
Exception
- If any error occurs while starting up.setupNewTypes
,
removeDeadTypes
protected void handlePostEventException(com.bea.wlai.common.IEvent event, Exception exc)
protected void logPostEventException(com.bea.wlai.common.IEvent event, Exception exc)
protected void assertValidLicense() throws Exception
ManagedConnectionFactory
object. Adapter
developers should override the checkLicense
method to perform
the adapter specific license check.
Exception
- - license verification failed for
this adapter.checkLicense method
protected ValidationResult checkLicense()
ValidationResult
object may or may not
have additional information associated with it. The additional information
is used to generate a "better" exception on a failed validation attempt.public abstract void start() throws Exception
start
in interface IEventGenerator
Exception
- If any error occurs while starting up.public abstract void stop() throws Exception
stop
in interface IEventGenerator
Exception
- If any error occurs while stopping.protected abstract void setupNewTypes(List listOfNewTypes) throws Exception
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
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 |