Package org.eclipse.mosaic.app.tutorial
Class WeatherServerApp
- java.lang.Object
-
- org.eclipse.mosaic.fed.application.app.AbstractApplication<ServerOperatingSystem>
-
- org.eclipse.mosaic.app.tutorial.WeatherServerApp
-
- All Implemented Interfaces:
Application
,OperatingSystemAccess<ServerOperatingSystem>
,EventProcessor
public class WeatherServerApp extends AbstractApplication<ServerOperatingSystem>
This class acts as an omniscient application for a server that warns vehicles about certain hazards on the road. The hazard is hard-coded for tutorial purposes, in more realistic scenarios the location would've been updated dynamically.
-
-
Constructor Summary
Constructors Constructor Description WeatherServerApp()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onShutdown()
This method is called by mosaic-application when the simulation has finished.void
onStartup()
This method is called by the Application Simulator when the vehicle that has been equipped with this application enters the simulation.void
processEvent(Event event)
This method is called by mosaic-application when a previously triggered event is handed over to the application for processing.-
Methods inherited from class org.eclipse.mosaic.fed.application.app.AbstractApplication
canProcessEvent, getLog, getOperatingSystem, getRandom, isTornDown, isValidStateAndLog, setUp, tearDown
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.mosaic.fed.application.app.api.OperatingSystemAccess
getOs
-
-
-
-
Method Detail
-
onStartup
public void onStartup()
This method is called by the Application Simulator when the vehicle that has been equipped with this application enters the simulation. It is the first method called of this class during a simulation.
-
processEvent
public void processEvent(Event event) throws Exception
This method is called by mosaic-application when a previously triggered event is handed over to the application for processing. Events can be triggered be this application itself, e.g. to run a routine periodically.- Parameters:
event
- The event to be processed- Throws:
Exception
-
onShutdown
public void onShutdown()
This method is called by mosaic-application when the simulation has finished.
-
-