gov.nasa.arc.brahms.vm.api.jsvc
Class AbstractAsynchronousEventService

java.lang.Object
  extended by gov.nasa.arc.brahms.vm.api.jsvc.AbstractExternalService
      extended by gov.nasa.arc.brahms.vm.api.jsvc.AbstractAsynchronousEventService
All Implemented Interfaces:
IExternalService, java.lang.Runnable

public abstract class AbstractAsynchronousEventService
extends AbstractExternalService
implements java.lang.Runnable

The AbstractAsynchronousEventService is a base class for external services that want to handle the events generated by the virtual machine asynchronously. Any events send to this service are placed in a queue and will be handled in a separate thread of execution. Control is immediately returned to the virtual machine regardless of whether the event was handled.

Version:
28 September 2000
Author:
Ron van Hoof
See Also:
AbstractExternalService, IExternalService

Constructor Summary
AbstractAsynchronousEventService()
           
 
Method Summary
 void init()
          Initializes the service
abstract  void processEvent(IEventMessage evt)
          Processes the event.
 void run()
          Process the messages.
 void start()
          Start the service, registers this service with the event notifier to ensure that events published to the event notifier are posted on this service's queue for processing.
 void stop()
          Stops the service, makes sure that any remaining events are still processed before the final shutdown.
 
Methods inherited from class gov.nasa.arc.brahms.vm.api.jsvc.AbstractExternalService
assertFact, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, conclude, getContext, getID, getModel, getName, getVMController, getWorldState, isValidTruthValue, retractFact, send, send, send, setProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAsynchronousEventService

public AbstractAsynchronousEventService()
Method Detail

init

public void init()
Initializes the service

Specified by:
init in interface IExternalService
Specified by:
init in class AbstractExternalService

start

public void start()
Start the service, registers this service with the event notifier to ensure that events published to the event notifier are posted on this service's queue for processing. Each event is processed asynchronously in the processEvent method.

Specified by:
start in interface IExternalService
Specified by:
start in class AbstractExternalService

stop

public void stop()
Stops the service, makes sure that any remaining events are still processed before the final shutdown.

Specified by:
stop in interface IExternalService
Specified by:
stop in class AbstractExternalService

run

public void run()
Process the messages.

Specified by:
run in interface java.lang.Runnable

processEvent

public abstract void processEvent(IEventMessage evt)
Processes the event.

Parameters:
evt - the IEventMessage to be handled.


Copyright © 1997-2012 All Rights Reserved.