Loading...

Follow Adam Bien on Feedspot

Continue with Google
Continue with Facebook
or

Valid

Simplest possible live- and readiness probes with quarkus.io and Microprofile Health:

Liveness and Readiness probes with Quarkus - YouTube

See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.

  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

After installing the UI5 DatePicker custom element, now the DatePicker is used within a view, which reacts to the change event (CustomEvent):

See you at (Enterprise) Single Page Applications with WebStandards, Terminal 2. Also checkout the (Single Page) Web Applications online learning path.

  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 
Installing, and integrating a DatePicker from UI5 WebComponents into a vanilla HTML page. This free, bonus screencast is part of the https://webcomponents.training workshop:

See you at (Enterprise) Single Page Applications with WebStandards, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.

  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 
Subscribe to airhacks.fm podcast via: spotify| iTunes| RSS

The #45 airhacks.fm episode with Jarek Ratajski (@jarek000000) about:

Java, Java EE and superfluous Dependency Injection with dangerous Aspects
is available for download. See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 
A Java class:
public class Hello {

    public String greeting;

    public Hello(String greeting) {
        this.greeting = greeting;
    }
}    
exposed via a JAX-RS:
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

@Path("/hello")
public class HelloResource {

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Hello hello() {
        return new Hello("hello, component");
    }
}    
can be easily accessed from a vanilla WebComponent:
class HelloComponent extends HTMLElement { 

    async connectedCallback() { 
        const response = await fetch("/hello");
        const { greeting } = await response.json();
        this.innerHTML = `
            <h2>${greeting}</h2>
        `;
    }

}
customElements.define("hello-component",HelloComponent);     
...declared in a HTML page
<!DOCTYPE html>
<html lang="en">
<head>
<body>
    <hello-component></hello-component>
    <script src="app.js" type="module"></script>
</body>
</html>    

No dependencies, no migrations.

See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io (e.g.: webcomponents.training).
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 
quarkus.io does not support EJBs and so EJB Timers (like e.g.: Simplest Possible EJB 3.1 Timer). The extension quarkus-scheduler (to install use: mvn quarkus:add-extension -Dextensions=quarkus-scheduler) offers adequate functionality:
import java.time.LocalDateTime;
import java.util.concurrent.atomic.AtomicLong;

import javax.enterprise.context.ApplicationScoped;

import io.quarkus.scheduler.Scheduled;

@ApplicationScoped
public class Scheduler {

    private AtomicLong COUNTER = new AtomicLong();

    @Scheduled(every="1s")
    public void increase() {
        System.out.println("+"+COUNTER.incrementAndGet() + " " + LocalDateTime.now());
    }

    @Scheduled(every="2s")
    public void decrease() {
        System.out.println("-"+COUNTER.incrementAndGet() + " " + LocalDateTime.now());
    }
}    
Output:
2019-07-11 11:34:33,155 INFO  [io.qua.dep.QuarkusAugmentor] (main) Beginning quarkus augmentation
2019-07-11 11:34:33,654 INFO  [io.qua.dep.QuarkusAugmentor] (main) Quarkus augmentation completed in 499ms
2019-07-11 11:34:33,808 INFO  [io.quarkus] (main) Quarkus 0.19.0 started in 0.723s. Listening on: http://[::]:8080
2019-07-11 11:34:33,810 INFO  [io.quarkus] (main) Installed features: [cdi, resteasy, scheduler]
+1 2019-07-11T11:34:33.818034
-2 2019-07-11T11:34:33.818035
+3 2019-07-11T11:34:34.812742
-4 2019-07-11T11:34:35.808378

See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.

  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 
A class containing a constructor with a single String parameter:

public class Ping {

    public String content;

    public Ping(String content) {
        this.content = content;
    }
}    

can be used as parameter of JAX-RS resources without any additional configuration:
@Path("ping")
public class PingResource {

    @GET
    @Path("{ping}")
    public String ping(@PathParam("ping") Ping ping) {
        return "Enjoy Jakarta EE with MicroProfile: " + ping.content;
    }
}    
curl -i http://localhost:8080/[WAR_NAME]/resources/ping/now yields:
HTTP/1.1 200 OK
Server: Payara Server  5.191 #badassfish

Enjoy Jakarta EE with MicroProfile: now%    

Project created with javaee8-essentials-archetype, the 4kB ThinWAR was built and deployed with: wad.sh in 2.1s

See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.

  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 
Also: Subscribe to airhacks.fm podcast via: spotify| iTunes| RSS
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 
Subscribe to airhacks.fm podcast via: spotify| iTunes| RSS

An airhacks.fm conversation with Gordon Hutchison (@hutchig) about:

"You Are Not Google", Transactions, MicroProfile, Reactive Programming, Reactive Messaging and Event Sourcing

Gordon Hutchison on twitter: @gordhut

See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.

  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

lit-html introduces binding not only to standard DOM-Events - you can bind to CustomEvents emitted by WebComponents as well:

See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.

Read for later

Articles marked as Favorite are saved for later viewing.
close
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Separate tags by commas
To access this feature, please upgrade your account.
Start your free month
Free Preview