Ada-Java middleware for legacy software modernization

Kelvin Nilsen
2010 Proceedings of the 8th International Workshop on Java Technologies for Real-Time and Embedded Systems - JTRES '10  
public class JavaMain { public static void main(String[] args) { UARTDriver uart = new UARTDriver(iocallback); // create an Ada object: UARTDriver is Java Proxy JavaGUIListener listener = new JavaGUIListener(); JavaMonitorGUI gui = new JavaMonitorGUI(listener); DeviceMonitor monitor = new DeviceMonitor(gui); // create an Ada object : DeviceMonitor is JavaProxy JavaApplication app = new JavaApplication(uart); // JavaIOCallback is a Java extension of an ava-generated Java proxy J IOC llb k i llb
more » ... 1 J IOC llb k( J IOC llb k INPUT AVAILABLE) JavaIOCallback iocallback1 = new JavaIOCallback(app, JavaIOCallback.INPUT_AVAILABLE); JavaIOCallback iocallback2 = new JavaIOCallback(app, JavaIOCallback.OUTPUT_READY); app.doWork(); // spawns a Java background thread // ask Ada to call back to my Java code under certain circumstances // ask Ada to call back to my Java code under certain circumstances uart.notifyWhenInputAvailable(iocallback1); // invoke Ada service uart.notifyWhenOutqueueEmpty(iocallback2); // invoke Ada service monitor.monitorUART(uart, 1000, gui); // invoke Ada and do not return } 9 have very different "temporary memory" models Ada allocates on the stack. Strong typing assures absence of dangling pointers. Java allocates on the heap. Garbage collection assures absence of dangling pointers.
doi:10.1145/1850771.1850785 dblp:conf/jtres/Nilsen10 fatcat:4orejtnj7bfwxa2zp7b7x4do2e