Technology1 min read

Caches, Certificates, Streaming Uploads and a Simulator That Types

By · Published by Everything Blog

In short

Codename One has rolled out comprehensive client and server updates aimed at supporting diverse application templates like banking and streaming services. The backend architecture gains robust security through certificate management APIs and token refresh mechanisms, alongside centralized error handling and disk-spooled uploads. Furthermore, data transformation is standardized across client and server with expanded JSON mapping features. Developers can also test and document their applications more effectively using the simulator's new virtual keyboard and integrated video recorder.

Key points

  • Modernized backend capabilities allow developers to import existing identity stores witho…: Modernized backend capabilities allow developers to import existing identity stores without forcing end users to reset passwords.
  • Upgraded JSON mapping unifies data serialization across both clients and servers using cu…: Upgraded JSON mapping unifies data serialization across both clients and servers using custom codecs and explicit null handling.
  • New bounded caching mechanisms provide system stability through configured size constrain…: New bounded caching mechanisms provide system stability through configured size constraints, automatic expiration, and performance metrics.

Sources checked by our analysis pipeline: 1

The templates this month (a bank, a streaming service, a messenger, a delivery service and a game) all have servers, and every server ran into something a modern web app takes for granted. This post collects what we added to the Codename One backend to fill those gaps. Several of them apply to the client too. Then there’s the simulator, which can now show a virtual keyboard and record a video of your app.

If you write Spring Boot during the day, most of this will look familiar on purpose. When there’s no reason to differ, the backend behaves the way Spring does.

A bounded cache

Bastion looks up prices on every quote. Calling the price feed on every quote is slow and burns the feed’s quota. Caching forever shows stale prices. The new cache has a size bound, expiry, a removal listener and metrics:

private static final Cache<String, Price> PRICES = Cache.<String, Price>builder("prices")

.maximumSize(10000)

.expireAfterWriteMillis(60000)

.removalListener((sku, price, cause) -> {

if (cause == Cache.SIZE) {

System.out.println("evicted " + sku);

}

})

.build();

Tokens for calling other services

Your server…

Technology