jsr377 what s up and what s next
play

JSR377 What's up and what's next Andres Almiray - @aalmiray Canoo - PowerPoint PPT Presentation

JSR377 What's up and what's next Andres Almiray - @aalmiray Canoo Engineering AG #JSR377 - @aalmiray PREVIOUS ATTEMPTS JSR 193 Client Side Container JSR 296 Swing Application Framework JSR 295 Beans Binding JSR 296 had the


  1. JSR377 What's up and what's next Andres Almiray - @aalmiray Canoo Engineering AG

  2. #JSR377 - @aalmiray

  3. PREVIOUS ATTEMPTS JSR 193 – Client Side Container JSR 296 – Swing Application Framework JSR 295 – Beans Binding JSR 296 had the following goals: application life cycle localized resources (and injection) persisted session state loosely coupled actions targeted only Swing for obvious reasons #JSR377 - @aalmiray

  4. WHICH UI TOOLKIT? #JSR377 - @aalmiray

  5. https://en.wikipedia.org/wiki/File:Raspberry_Pi_2_Model_B_v1.1_top_new_%28bg_cut_out%29.jpg #JSR377 - @aalmiray

  6. WHAT’S OUT THERE Eclipse 4 Platform, NetBeans Griffon, Basilisk, Gluon Particle, DataFX, JacpFX, MvvmFX, JVx, JRebirth, and more ... #JSR377 - @aalmiray

  7. COMMON FEATURES Many of the listed frameworks offer the following capabilities implemented in different ways: application life cycle dependency injection localized resources (and injection) event system persisted session state centralized error management loosely coupled actions extension points via plugins #JSR377 - @aalmiray

  8. TARGET ENVIRONMENT All of the listed frameworks support the Desktop as target environment. Only a few can be used in an Embedded environment (where Java SE is supported). Embedded Java UI applications can be built as applications that target the Desktop; even share their codebase. #JSR377 - @aalmiray

  9. GOALS Target Desktop and Embedded environments Support several toolkits Be an standalone JSR, i.e, no need to include it in the JDK Leverage existing JSRs: JSR 330 – Dependency Injection JSR 365 – Event bus (from CDI 2.0 ?) #JSR377 - @aalmiray

  10. CORE FEATURES dependency injection application life cycle event system localized resources (and injection) centralized error management configuration extension points via plugins loosely coupled actions MVC artifacts #JSR377 - @aalmiray

  11. OUT OF SCOPE V1 Buildtime: Runtime: test support persisted session state deployment artifact introspection API UI toolkit updates #JSR377 - @aalmiray

  12. API #JSR377 - @aalmiray

  13. Application Phases package ¡javax.application; ¡ public ¡enum ¡ApplicationPhase ¡{ ¡ ¡ ¡ ¡ ¡INITIALIZE, ¡ ¡ ¡ ¡ ¡STARTUP, ¡ ¡ ¡ ¡ ¡READY, ¡ ¡ ¡ ¡ ¡MAIN, ¡ ¡ ¡ ¡ ¡SHUTDOWN ¡ } #JSR377 - @aalmiray

  14. Application Lifecycle package ¡javax.application; ¡ public ¡interface ¡Application ¡{ ¡ ¡ ¡ ¡ ¡void ¡initialize(); ¡ ¡ ¡ ¡ ¡void ¡startup(); ¡ ¡ ¡ ¡ ¡void ¡ready(); ¡ ¡ ¡ ¡ ¡ExitState ¡shutdown(); ¡ ¡ ¡ ¡ ¡boolean ¡canShutdown(); ¡ ¡ ¡ ¡ ¡void ¡addShutdownHandler(@Nonnull ¡ShutdownHandler ¡handler); ¡ ¡ ¡ ¡ ¡void ¡removeShutdownHandler(@Nonnull ¡ShutdownHandler ¡handler); ¡ } #JSR377 - @aalmiray

  15. Application Lifecycle package ¡javax.application; ¡ public ¡interface ¡ShutdownHandler ¡{ ¡ ¡ ¡ ¡ ¡boolean ¡canShutdown(Application ¡application); ¡ ¡ ¡ ¡ ¡void ¡onShutdown(Application ¡application); ¡ } package ¡javax.application; ¡ public ¡interface ¡ExitState ¡{ ¡ ¡ ¡ ¡ ¡int ¡exitCode(); ¡ ¡ ¡ ¡ ¡boolean ¡canShutdown(); ¡ } #JSR377 - @aalmiray

  16. Application Properties package ¡javax.application; ¡ public ¡interface ¡Application ¡{ ¡ ¡ ¡ ¡ ¡Configuration ¡getConfiguration(); ¡ ¡ ¡ ¡ ¡ApplicationPhase ¡getPhase(); ¡ ¡ ¡ ¡ ¡Locale ¡getLocale(); ¡ ¡ ¡ ¡ ¡String[] ¡getStartupArguments(); ¡ ¡ ¡ ¡ ¡. ¡. ¡. ¡ } #JSR377 - @aalmiray

  17. UI Threading Toolkit ¡ ¡| ¡isUIThread ¡| ¡runSync ¡| ¡RunAsync ¡ Swing ¡ ¡ ¡ ¡| ¡yes ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡yes ¡ ¡ ¡ ¡ ¡| ¡yes ¡ JavaFX ¡ ¡ ¡| ¡yes ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡ no ¡ ¡ ¡ ¡ ¡ ¡| ¡yes ¡ SWT ¡ ¡ ¡ ¡ ¡ ¡| ¡yes ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡yes ¡ ¡ ¡ ¡ ¡| ¡yes ¡ Pivot ¡ ¡ ¡ ¡| ¡yes ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡yes ¡ ¡ ¡ ¡ ¡| ¡yes ¡ Lanterna ¡| ¡yes ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡| ¡yes ¡ ¡ ¡ ¡ ¡| ¡ no #JSR377 - @aalmiray

  18. UI Threading package ¡javax.application; ¡ public ¡interface ¡ThreadingHandler ¡{ ¡ ¡ ¡ ¡ ¡boolean ¡isUIThread(); ¡ ¡ ¡ ¡ ¡void ¡runInsideUIAsync(Runnable ¡runnable); ¡ ¡ ¡ ¡ ¡void ¡runInsideUISync(Runnable ¡runnable); ¡ ¡ ¡ ¡ ¡<R> ¡R ¡runInsideUISync(Callable<R> ¡callable); ¡ ¡ ¡ ¡ ¡void ¡runOutsideUI(Runnable ¡runnable); ¡ } #JSR377 - @aalmiray

  19. Internationalization package ¡javax.application; ¡ Combined ¡arguments: ¡ ¡ public ¡interface ¡MessageSource ¡{ ¡ (Object[] ¡/ ¡List), ¡ ¡ ¡ ¡ ¡String ¡getMessage(String ¡key) ¡ Locale ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡throws ¡NoSuchMessageException; ¡ ¡ ¡ ¡ ¡String ¡getMessage(String ¡key, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡String ¡defaultValue); ¡ } #JSR377 - @aalmiray

  20. Resource Injection (1) package ¡javax.application; ¡ @Retention(RetentionPolicy.RUNTIME) ¡ @Target({ElementType.FIELD, ¡ElementType.METHOD}) ¡ public ¡@interface ¡InjectedResource ¡{ ¡ ¡ ¡ ¡ ¡String ¡key() ¡default ¡""; ¡ ¡ ¡ ¡ ¡String[] ¡args() ¡default ¡{}; ¡ ¡ ¡ ¡ ¡String ¡defaultValue() ¡default ¡""; ¡ ¡ ¡ ¡ ¡String ¡format() ¡default ¡""; ¡ } #JSR377 - @aalmiray

  21. Resource Injection (2) import ¡javax.application.InjectedResource; ¡ import ¡javafx.scene.paint.LinearGradient; ¡ public ¡class ¡SomeBean ¡{ ¡ ¡ ¡ ¡ ¡@InjectedResource ¡ ¡ ¡ ¡ ¡private ¡LinearGradient ¡gradient; ¡ } #JSR377 - @aalmiray

  22. Resources Desktop|Embedded Application API https://jcp.org/en/jsr/detail?id=377 https://github.com/jsr377/ http://jsr377.github.io/site/ #JSR377 - @aalmiray

  23. Thank you! Andres Almiray - @aalmiray Canoo Engineering AG

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend