1 / 23

The Java Legacy Interface

The Java Legacy Interface. Stephan Korsholm Centre for Embedded Software Systems (CISS) Aalborg University Denmark. Background. Ph. D. work. 1-17. Introducing Java to a C/Assembler legacy platform. KIRK DECT handsets. KIRK generic wireless control module. 16 bit. 512 Kb. 16 Mhz.

chione
Download Presentation

The Java Legacy Interface

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Background Ph. D. work 1-17

  3. Introducing Java to a C/Assembler legacy platform KIRK DECT handsets KIRK generic wireless control module. 16 bit 512 Kb 16 Mhz Java for GUIs Java for end user customization 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. They need HELP! How can Java be introduced into such a setting? 3-17

  6. Introducing Java to a C/Assembler legacy platform Overview, • 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…. 4-17

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

  8. The KIRK legacy software architecture HW Events Layered architecture putEvent Application getEvent DECT protocol Event handlers MAC Layer Event dispatcher 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 Events JLI function,JLI_runVM(int timeout) Event handlers 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. Event dispatcher VM event handler 7-17

  11. Implementing JLI_runVM(int timeout) Slice the JVM, • Divide the execution into smaller units. • Eliminate recursion and long loops. • E.g. change the interpreter loop. • Enable suspend/resume of interpreter loop. 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 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. Event handlers Event dispatcher 9-17

  13. Communication 10-17

  14. Communication Event handlers communicate by sending events to each other, • Support queueing events to Java from legacy code. • Support queueing events to legacy code from Java. 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 Events JLI function, void JLI_subscribe(int event) int JLI_available(int event) void JLI_getData(byte[] data) void JLI_setFate(bool fate) Event handlers subscribe Event dispatcher available? getData setFate Java handler 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 Today 100% 0% Java Legacy 14-17

  19. Possibilities – Core software development Today Tomorrow 100% 100% 0% 0% Java Legacy Java Legacy Incrementel (baby steps) porting of legacy code into Java 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? On event driven legacy platforms we have gained, • 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. • Real-time? • No! Certainly not (slicing has an impact on a real-time profile). • Efficiency? • No! Certainly not (currently we only support interpretation). 17-17

  23. Your Comments? 17-17

More Related