Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

package com.codename1.backend

The Codename One backend runtime: the server side of an application, written in the same Java as the app and compiled to a native server binary.

This package is server code. None of it is available in the app on the device; the classes an app and its server share are the ORM session API and the entity annotations, which live in the client packages and are documented in both references.

Backend is the entry point: it reads the Config, opens the database the deployment names, and runs an HttpServer. Around it are the pieces a server needs without a framework behind it – Database and DataSource over SQLite, PostgreSQL and MySQL, Json, Jwt, WebSocket endpoints, StaticFiles, distributed tracing through Tracing, and LambdaRuntime for AWS Lambda.

Controllers are ordinary classes annotated from com.codename1.backend.annotations; the build generates the router, so nothing is registered or scanned at start-up.

Types

class AsyncResultA Future that is already complete: what an @Async method returns from its body.
class BackendA configured, running server: the twenty lines every main used to open with, written once.
class Base64Standard base64 (RFC 4648 section 4), with padding.
class Base64UrlBase64url without padding, as JSON Web Tokens use it.
class ByteSinkA growable byte buffer that callers reuse.
class ConfigWhere a server’s settings come from, in one resolution order.
class CryptoThe crypto a server needs to authenticate a request.
class DataAccessExceptionA database operation failed: a statement the engine refused, a connection that could not be opened or was lost, a query that returned more rows than one.
class DataSourceA pool of connections to ONE database, whichever engine that database is.
class DatabaseOne database API over SQLite, PostgreSQL and MySQL, chosen by URL.
class DbSQLite persistence for server-side binaries, on the engine the translator already bundles.
class DbPoolA fixed pool of connections to one SQLite database.
class FileIoThe file-system calls a static handler needs, isolated so that everything else in StaticFiles – ranges, conditional requests, MIME types, the containment check – is pure Java and shared by every target.
interface HandlerWhat a Lambda-style handler implements.
class HttpA minimal HTTP/1.1 client over Tcp.
class Http1DateThe one date format HTTP/1.1 requires on the wire (“Sun, 06 Nov 1994 08:49:37 GMT”), formatted and parsed from epoch milliseconds directly.
class Http2One HTTP/2 connection, on nghttp2.
class HttpServerAn HTTP/1.1 server built around a reactor and a bounded worker pool.
class HttpSessionState kept for one client across requests, found again through a cookie.
class JsonA self-contained JSON reader/writer for server-side binaries.
class JwtHS256 JSON Web Tokens: issue one, and verify one you are handed.
class LambdaRuntimeThe AWS Lambda custom-runtime loop.
class MigrationsVersioned schema migrations for the server’s database.
class ReactorReadiness notification over epoll (Linux) or kqueue (macOS/BSD).
class ServerSocketA listening TCP socket and the blocking read/write a worker uses once it owns a connection.
interface SessionStoreWhere HttpSessions are kept between requests.
class SignalsTurns SIGTERM into an ordinary blocking call, so a server can shut down cleanly when its container asks it to.
class SpanOne timed operation inside a distributed trace.
class StaticFilesServes files out of a document root, on the kernel’s zero-copy path.
class TaskExecutorA named place background work runs: a pool of platform threads, or virtual threads on the server’s hosts.
class TasksWhere background work runs: the named TaskExecutors, and two shorthands for running something once.
class TcpBlocking TCP client socket for server-side (clean-target) binaries.
class TlsServer-side TLS.
interface TracerWhere spans come from and where they go.
class TracingDistributed tracing for the server, and the hooks it is instrumented through.
class TransactionExceptionA transaction could not begin, commit or roll back the way a @Transactional method asked.
class TransactionsThe transaction a @Transactional method runs in, bound to the calling thread.
class VirtualThreadA thread of control that is not an OS thread.
class WebOutbound HTTP and HTTPS for server-side binaries.
interface WebSocketWhat an application implements to serve a websocket route.
class WebSocketSessionOne websocket connection: the decoder that turns bytes into messages, and the handle an application sends through.