WebLogic Integration


com.bea.adapter.event
Class AbstractPullEventGenerator

java.lang.Object
  |
  +--com.bea.adapter.event.AbstractEventGenerator
        |
        +--com.bea.adapter.event.AbstractPullEventGenerator
Direct Known Subclasses:
AbstractBEAPullEventGenerator

public abstract class AbstractPullEventGenerator
extends AbstractEventGenerator
implements java.lang.Runnable

A class that does work for an event generator. Adapter providers can override methods on this class to provide EIS specific event generation logic.

Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.

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(java.util.Map map)
          Performs EIS specific initialization of this object based on properties in the map argument.
protected abstract  void postEvents(IEventRouter router)
          Posts EIS events to the event router.
protected abstract  void removeDeadTypes(java.util.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 run()
          Runnable implementation.
protected abstract  void setupNewTypes(java.util.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.
 
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

AbstractPullEventGenerator

public AbstractPullEventGenerator()
Method Detail

doInit

protected void doInit(java.util.Map map)
               throws java.lang.Exception
Performs EIS specific initialization of this object based on properties in the map argument. Adapter developers must override this method according to their EIS specific needs.

Throws:
java.lang.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.
Overrides:
doInit in class AbstractEventGenerator

checkInitializeState

protected void checkInitializeState()
                             throws java.lang.Exception
Checks initialization state of PullEventGenerator


checkThreadState

protected void checkThreadState()
                         throws java.lang.Exception
Checks the thread state of the PullEventGenerator


doCleanUpOnQuit

protected void doCleanUpOnQuit()
                        throws java.lang.Exception
Performs any clean-up needed once this object determines that it is time to quit running. Adapter developers should override this method to free any resources held by this instance.

Throws:
java.lang.Exception - - an exceptional condition was encountered while attempting to clean-up resources used by this instance.
Overrides:
doCleanUpOnQuit in class AbstractEventGenerator

postEvents

protected abstract void postEvents(IEventRouter router)
                            throws java.lang.Exception
Posts EIS events to the event router. Adapter developer's should call isEventTypeKnownToRouter before processing an event because this worker should not waste computing cycles on generating events that the router does not care about. 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");
   event.setEventDefinition(eventDef);

   try
   {
     m_router.postEvent(event);
   }
   catch (Exception exc)
   {
     handlePostEventException(event, exc);
   } // end try/catch
 } // end while
 


run

public void run()
Runnable implementation. Used to log and route events to the concrete implementation.
Specified by:
run in interface java.lang.Runnable


start

public void start()
           throws java.lang.Exception
Starts the PullEventGenerator to polling.

Overrides:
start in class AbstractEventGenerator

stop

public void stop()
          throws java.lang.Exception
Notifies this thread that it should stop posting events to the event router.

Overrides:
stop in class AbstractEventGenerator

setupNewTypes

protected abstract void setupNewTypes(java.util.List listOfNewTypes)
Allows this instance to apply any EIS specific setup logic needed to handle new event types provided by the event router.

Parameters:
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.
Overrides:
setupNewTypes in class AbstractEventGenerator

removeDeadTypes

protected abstract void removeDeadTypes(java.util.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.

Parameters:
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.
Overrides:
removeDeadTypes in class AbstractEventGenerator

WebLogic Integration

WebLogic Integration (WLI)