Skip to content

Instantly share code, notes, and snippets.

View dteleguin's full-sized avatar

Dmitry Telegin dteleguin

  • Backbase
  • Cardiff, UK
View GitHub Profile
@dteleguin
dteleguin / keycloak-server.properties
Last active October 2, 2019 08:25
A minimal keycloak-server.properties just enough to have Keycloak.X running
admin.realm = master
hostname.provider = request
hostname.fixed.hostname = localhost
hostname.fixed.httpPort= -1
hostname.fixed.httpsPort= -1
eventsListener.jboss-logging.success-level=debug
eventsListener.jboss-logging.error-level=warn

Preface

For Java EE developers, JavaScript has been around for years. Introduced in 2012, Nashorn is a modern and performant JavaScript engine for JVM. JavaScript is a perfect candidate for being first-class citizen of the Java EE ecosystem. What prevents it from being one is lack of integration with CDI - a glue that binds together application components and wires the application to Java EE platform resources.

The goal of the project is to provide such an integration, together with several other productivity features.

Initially, it was inspired by Grails Console.

Examples

let's imagine there's a JavaEE app with a JS script inside that is meant to be called on periodic basis & do some maintenance tasks
what should our (hypothetical) runtime know about this script?
- script name & description: these should be displayed in (hypothetical) web console that should allow to enable/disable script and manually run it;
- crontab string, since it should be run periodically;
- imports: would be nice to have Java-style imports (including static) so that one doesn't do infinite var Foo = my.package.Foo assignments;
- CDI injections (self-explanatory I guess)
so one way is to have all the above inline, in a script header, like this:
====== 8< ========