Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Java Legacy Interface Stephan Korsholm Centre for Embedded Software Systems (CISS) Aalborg University Denmark.

Similar presentations


Presentation on theme: "The Java Legacy Interface Stephan Korsholm Centre for Embedded Software Systems (CISS) Aalborg University Denmark."— Presentation transcript:

1 The Java Legacy Interface Stephan Korsholm Centre for Embedded Software Systems (CISS) Aalborg University Denmark

2 Ph. D. work Background 1-17

3 Introducing Java to a C/Assembler legacy platform Java for GUIsJava for end user customization KIRK DECT handsetsKIRK generic wireless control module. 16 bit 512 Kb 16 Mhz 2-17

4 Introducing Java to a C/Assembler legacy platform Legacy code is very important, Represents decades of software development. Is the ”golden egg” of the company. But, legacy code is in general,  ”Untouchable” code.  Written by engineers without proper SW development skills.  Hard to maintain, hard to refactor.  A burden that will never go away. 3-17

5 Introducing Java to a C/Assembler legacy platform Legacy code is very important, Represents decades of software development. Is the ”golden egg” of the company. But, legacy code is in general,  ”Untouchable” code.  Written by engineers without proper SW development skills.  Hard to maintain, hard to refactor.  A burden that will never go away. How can Java be introduced into such a setting? They need HELP! 3-17

6 Introducing Java to a C/Assembler legacy platform The KIRK legacy software architecture. Scheduling a JVM using the legacy scheduler. Java/C Communication using the legacy message exchange protocol. Code samples. Looking ahead…. Overview, 4-17

7 The KIRK legacy software architecture Application DECT protocol MAC Layer Layered architecture 5-17

8 The KIRK legacy software architecture Application DECT protocol MAC Layer Layered architecture Event dispatcher Event handlers Events getEvent putEvent HW 5-17

9 Scheduling the JVM Integrate from the legacy architecture (JNI unfortunately not an option). Schedule the JVM in an event driven system. Run the JVM as a short lived event handler. 6-17

10 Scheduling the JVM Event dispatcher Event handlers Events JLI function, JLI_runVM(int timeout) Executes bytecodes a certain amount of time. Suspends the VM. Queues an event to be handled by the VM event handler. Returns to the scheduler. VM event handler 7-17

11 Implementing JLI_runVM(int timeout) Divide the execution into smaller units. Eliminate recursion and long loops. E.g. change the interpreter loop. Enable suspend/resume of interpreter loop. Slice the JVM, Slicing an existing JVM (SimpleRTJ VM), Analyzed program dependency graph. Refactored JVM source code. Introduced slicing points into the code. 8-17

12 Scheduling the JVM Event dispatcher Event handlers Events Legacy Events JVM Events Handling of legacy code and Java code is intermixed. Selfregulating prioritization of Java code. Legacy code unaware and unaffected of Java code. Seamless integration. 9-17

13 Communication 10-17

14 Communication Support queueing events to Java from legacy code. Support queueing events to legacy code from Java. Event handlers communicate by sending events to each other, The KIRK Java API adds functionality for subscribing to events in Java Steal events and handle them in Java. Change events and send them on. Look at events and send them on unchanged. 10-17

15 Communication Event dispatcher Event handlers Events JLI function, void JLI_subscribe(int event) int JLI_available(int event) void JLI_getData(byte[] data) void JLI_setFate(bool fate) Java handler subscribe available? getData setFate 11-17

16 Communication 12-17

17 Possibilities – GUI customization KIRK Dect Handsets Subscribe to GUI events (e.g. key press). Implement different handling of selected events. Manipulate GUI by sending new events. Adding new behaviour to basic firmware. Increasing end user experience. Sell add-on Java applications. 13-17

18 Possibilities – Core software development 100% 0% JavaLegacy Today 14-17

19 Possibilities – Core software development 100% 0% JavaLegacy 100% 0% JavaLegacy Incrementel (baby steps) porting of legacy code into Java TodayTomorrow 14-17

20 Looking ahead.... Event driven programming vs. other types of paradigms. VM slicing – effect on real-time behaviour? WCET of JLI_runVM?  Give proper value of timeout parameter. Integrating legacy code with,  JIT compiled Java.  AOT compiled Java. 15-17

21 Summing up. Given initial specification of JLI (Java Legacy Interface),  Focused on event driven embedded legacy platforms. Implemented JLI in a interpreter,  Implemented VM slicing.  Implemented Java/legacy message exchange. Implemented the KIRK API,  Supports handling events in Java.  Supports implementing selected functionality in Java.  Supports incremental transition from legacy code (C) to Java. 16-17

22 What has been gained? 17-17 The ability to run Java components. Yes. Fine grained customization of application behaviour using Java. Yes. The option of incrementally porting legacy code into Java. Yes. On event driven legacy platforms we have gained, Real-time?  No! Certainly not (slicing has an impact on a real-time profile). Efficiency?  No! Certainly not (currently we only support interpretation).

23 Your Comments? 17-17


Download ppt "The Java Legacy Interface Stephan Korsholm Centre for Embedded Software Systems (CISS) Aalborg University Denmark."

Similar presentations


Ads by Google