Posted
over 7 years
ago
We Love Kotlin! Kotlin looks like the Java 2.0 everyone was calling for. It is simple (compared to Scala), powerful and expressive (compared to Java) programming language. With its strong company support it has the potential to offer viable and safe
... [More]
alternative for existing Java developers. Kotlin offers the language we all have
been waiting for! We Love MVVM! DukeScript project is a long time supporter of using the Model-View-ViewModel approach for coding client side applications in Java. We are obsesed by portability. We target any Java virtual machine in any incarnation. Write your application once and package it for desktop, Android, iOS or a browser. Kotlin targets JVM too and as such we explored ways to bring the whole DukeScript ecosystem to Kotlin - the result is great! Kotlin brings the
DukeScript concepts to absolutely new levels! The language keep type-safety as known from Java, yet it allows the developers to be far more expressive. Kotlin is a natural fit for writing the MVVM models! The Result This is the result: kt-mvvm.org. A website!? Yes, a website! We
believe kt-mvvm.org can serve as a great starting point. It can help you explore the power of MVVM together with the flexibility of Kotlin. Give it a try! Continue reading at kt-mvvm.org and contribute by forking the GitHub repositories or talking back. [Less]
|
Posted
over 7 years
ago
Recently I have successfully used the singletonizer API design pattern in Graal's Graph I/O API javadoc. The result ain't that bad, right? --JaroslavTulach 06:51, 25 January 2018 (UTC)
|
Posted
over 7 years
ago
WebComponents can use ES 6 Template Literals to render dynamic contents out-of-the-box [see e.g. webcomponents.training ]. In this screencast an efficient (~500 unminified LoC), ES 6 template titeral-based, template library: lit-html was used to
... [More]
render only the "dirty" parts of the DOM tree. See you at Structuring Single Page Applications (SPA)s / Progressive Web Applications (PWA)s with WebComponents -- the "no frameworks, no migrations" approach, at Munich Airport,
Terminal 2 or webcomponents.training (online). Real World Java EE Workshops [Airport Munich]> [Less]
|
Posted
over 7 years
ago
What happens to Web Components (Custom Elements and Shadow DOM) in unsupported browsers? In this screencast I'm creating a Custom Element with Shadow DOM from scratch and run the sample in Firefox, Safari and Chrome. Patching (aka polyfill)
... [More]
included: See you at Structuring Single Page Applications (SPA)s / Progressive
Web Applications (PWA)s with WebComponents -- the "no frameworks, no migrations" approach, at Munich Airport, Terminal 2 or webcomponents.training (online). Real World Java EE Workshops [Airport Munich]> [Less]
|
Adam Bien: Metrics, ServerSockets, SSE, WebSockets, Smelling DAOs, JPA Historization, SLSB scalability, Killing EJBs, Logging, ELK, Docker, Kubernetes, Openshift, Licensing, Obfuscation -- or 46th airhacks.tv
Posted
over 7 years
ago
This time "Metrics, ServerSockets, SSE, WebSockets, Homework / Code Review of a basic CRUD, Smelling DAOs, JPA Historisation, SLSB design for scalability, Killing EJBs, Logging, ELK, Docker, Kubernetes, Openshift, Licensing, Obfuscation" were
... [More]
discussed. Any questions left? Ask now: https://gist.github.com/AdamBien/dce90e8d7162c06ca3395f9a9ceb7bf1 and get the answers at the next airhacks.tv. See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is
Munich's airport too far? Learn from home: airhacks.io. Real World Java EE Workshops [Airport Munich]> [Less]
|
Posted
over 7 years
ago
After covering the "basics" in WebStandards igniter, now 50+ episodes of continuous Web Components (Custom Elements, Shadow DOM, CSS 3 styling, Templates, ES 6 imports) coding workshop is available: webcomponents.training. No installation, no
... [More]
dependencies, no builds: only vanilla web (browser) standards,
without any external frameworks or dependencies, were used. Are you already building, or still migrating? Learn once, apply anywhere :-): Web Components from AdamBien on Vimeo. See you also at: PWAs / SPAs with Web Components Workshop at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Real World Java EE Workshops [Airport Munich]> [Less]
|
Posted
over 7 years
ago
CompletableFuture#orTimeout (>= Java 9) method "...exceptionally completes this CompletableFuture with a TimeoutException if not otherwise completed before the given timeout. ..." and is therefore well suited to set a pipeline-specific timeout.
... [More]
The method
AsyncResponse#setTimeout sets the max timeout per request: import static java.util.concurrent.CompletableFuture.supplyAsync; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.container.AsyncResponse;
import javax.ws.rs.container.Suspended; import javax.ws.rs.core.Response; @Path("ping") public class PingResource { @GET public void ping(@Suspended AsyncResponse response) { response.setTimeout(1, TimeUnit.SECONDS); //global timeout supplyAsync(this::answer). thenAccept(response::resume). orTimeout(100, TimeUnit.MILLISECONDS). //pipeline specific timeout exceptionally((t) -> handleTimeout(response::resume, t)); } Void
handleTimeout(Consumer consumer, Throwable t) { consumer.accept(Response.status(503). header("cause", "timeout in the pipeline"). header("exception", t.toString()). build()); return null; } public String answer() { try { Thread.sleep(200); return "42 + " + System.currentTimeMillis(); } catch (InterruptedException ex) { throw new IllegalStateException("cannot sleep"); } } } The request: curl -i
http://localhost:8080/completable-timeout/resources/ping returns: HTTP/1.1 503 Service Unavailable X-Powered-By: Servlet/4.0 cause: timeout in the pipeline exception: java.util.concurrent.TimeoutException (...) See you at Java EE 8 / Java 9 / Web Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io. Real World Java EE Workshops [Airport Munich]> [Less]
|
Posted
over 7 years
ago
The Java 9's StackWalker class allows stack walking without instantiating an Exception. The following unit test: package com.airhacks; import java.lang.StackWalker.StackFrame; import org.junit.Before; import org.junit.Test; public class
... [More]
StackWalkerBasicsTest { private StackWalker walker; @Before public void init() { this.walker =
StackWalker.getInstance(); } @Test public void walkTheStack() { this.walker.forEach(this::print); } void print(StackFrame frame) { String className = frame.getClassName(); String methodName = frame.getMethodName(); int lineNumber = frame.getLineNumber(); System.out.println(className + "." + methodName + ":" + lineNumber); } } Writes the following output:
com.airhacks.StackWalkerBasicsTest.walkTheStack:24 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall:50 org.junit.internal.runners.model.ReflectiveCallable.run:12 org.junit.runners.model.FrameworkMethod.invokeExplosively:47 org.junit.internal.runners.statements.InvokeMethod.evaluate:17 org.junit.internal.runners.statements.RunBefores.evaluate:26 org.junit.runners.ParentRunner.runLeaf:325 org.junit.runners.BlockJUnit4ClassRunner.runChild:78
org.junit.runners.BlockJUnit4ClassRunner.runChild:57 org.junit.runners.ParentRunner$3.run:290 org.junit.runners.ParentRunner$1.schedule:71 org.junit.runners.ParentRunner.runChildren:288 org.junit.runners.ParentRunner.access$000:58 org.junit.runners.ParentRunner$2.evaluate:268 org.junit.runners.ParentRunner.run:363 org.apache.maven.surefire.junit4.JUnit4Provider.execute:252 org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet:141 org.apache.maven.surefire.junit4.JUnit4Provider.invoke:112
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray:189 org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke:165 org.apache.maven.surefire.booter.ProviderFactory.invokeProvider:85 org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess:115 org.apache.maven.surefire.booter.ForkedBooter.main:75 See you at Java EE Workshops at Munich Airport, Terminal
2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io. Real World Java EE Workshops [Airport Munich]> [Less]
|
Posted
over 7 years
ago
In this screencast I created a Java EE 8 application with JAX-RS endpoint and JSON-B serialization from scratch, then developed a Custom Element (part of the Web Components specification) which talks to the Java EE 8 backend in 6 mins. No external
... [More]
dependencies were used in frontend and backend.
Real World Java EE Workshops [Airport Munich]> [Less]
|
Posted
over 7 years
ago
Questions for the 46th airhacks.tv: Surprise Interactive review of a CRUD homework assignment JPA history Testing and embedded integration tests Getting rid of EJBs Business
metrics with Java EE THE DAOs smell and Deltaspike Data Asynchronous
... [More]
JAX-RS resource Docker swarm vs. kubernetes vs. openshift SLSB command pattern vs. one bean with multiple methods How to stay sane (sanity is subjective :-) Server Push: WebSockets vs. SSE ServerSocket handling with Java EE -- or how to XMPP with Java EE Logging with
java.util.logging and what about ELK? Java EE and obfuscation Licensing Java EE applications The Pair class and Apache Commons Any questions left? Ask now: or wait a month. Ask questions during the show via twitter mentioning me: http://twitter.com/AdamBien (@AdamBien) or using the hashtag: #airhacks. You can join the Q&A session live each first Monday of month, 6 P.M at airhacks.tv or http://www.ustream.tv/channel/adambien Real World Java EE Workshops [Airport Munich]>
[Less]
|