Skip to content

Latest commit

 

History

History
680 lines (516 loc) · 19.5 KB

File metadata and controls

680 lines (516 loc) · 19.5 KB

platform-java Release Notes


platform-java 1.1 - Release Notes

Release Date: May 2026
Status: Production Ready

Overview

platform-java 1.1 resolves three critical GitHub issues focused on build consistency, memory leak prevention, and future Java compatibility. This release ensures platform-java is ready for Java 21+ and provides robust ClassLoader cleanup and modern security enforcement.

What's New in 1.1

Issue #1: Java 21 Standardization ✅

Updated build configuration for consistent Java 21 compilation across all modules.

Changes:

  • Parent POM now uses maven.compiler.release=21
  • Removed deprecated source/target properties
  • All 22 modules compile with Java 21

Impact: Ensures compatibility with Java 21+ features (Virtual Threads, pattern matching, records)


Issue #2: ClassLoader Leak Prevention ✅

Comprehensive cleanup system to prevent memory leaks after application undeploy.

New Components:

  • ClassLoaderCleanupUtil - Automatic cleanup utility
    • ThreadLocal cleanup
    • JDBC driver deregistration
    • JMX MBean cleanup
    • Shutdown hook removal
    • ResourceBundle cache clearing
    • Leak detection (debug mode)

Integration:

  • Automatic cleanup in ApplicationManager.undeploy()
  • Cleanup in ApplicationManager.forceKill()
  • Enable leak detection: -Dplatform-java.debug.detectLeaks=true

Documentation:

Testing: 12 unit tests (all passing)


Issue #3: SecurityManager Replacement ✅

Modern security enforcement using StackWalker API instead of deprecated SecurityManager.

New Components:

  • SecurityEnforcer - StackWalker-based security enforcement
    • File access checks
    • Network socket checks
    • Reflection access checks
    • Native library checks
    • Per-ClassLoader security policies

Advantages:

  • ✅ Not deprecated (works with Java 17+)
  • ✅ Better performance (no global overhead)
  • ✅ More flexible (enable/disable per operation)
  • ✅ Future-proof (won't be removed from Java)

Configuration:

  • Enable enforcement: -Dplatform-java.security.enforce=true
  • Automatic policy registration/unregistration

Documentation:

Testing: 16 unit tests (all passing)


Migration from 1.0 to 1.1

No migration required - all changes are backward compatible.

Optional: Enable new features via system properties:

# Enable leak detection
java -Dplatform-java.debug.detectLeaks=true -jar platform-java-launcher.jar

# Enable security enforcement
java -Dplatform-java.security.enforce=true -jar platform-java-launcher.jar

Build Status

  • Total Tests: 28 new tests (all passing)
  • Build Time: ~7 seconds
  • Modules: 22
  • Code Added: ~800 lines production, ~1,200 lines documentation

platform-java 2.0 - Planned Features

Status: DOCUMENTED - Implementation Complete, Testing In Progress

Overview

platform-java 2.0 will add six major platform-level features that align with the platform's core mission as an application runtime (similar to Kubernetes/YARN for JVM processes). These features focus on platform concerns—hot code reload, resource enforcement, dependency management, persistent storage, native binaries, and enhanced observability.

Planned Features for 2.0

🔄 Hot Code Reload

Update application code without platform restart for zero-downtime deployments.

Features:

  • Classloader hot-swapping with state preservation
  • Optional ReloadableApplication interface for state capture/restore
  • Automatic rollback on reload failure
  • Thread-safe synchronized reload process
  • Reference-counted classloader versioning for safe GC

Configuration:

applicationId: my-app
hotReloadEnabled: true
preserveState: true

Usage:

# Reload via REST API
curl -X POST http://localhost:8080/api/applications/my-app/reload -d @updated-app.json

# Reload via CLI
java -jar platform-java-launcher.jar reload --app-id my-app --yaml updated-app.yaml

Full Documentation


⚡ Resource Enforcement

Automatic enforcement when applications exceed CPU/memory/thread quotas.

Features:

  • Four enforcement levels: NOTIFY, THROTTLE, SHUTDOWN, KILL
  • Configurable grace periods to handle transient spikes
  • Per-resource-type enforcement policies (CPU, memory, threads)
  • Integration with existing resource monitoring
  • Violation history tracking

Configuration:

resources:
  maxHeapMB: 512
  memoryEnforcementAction: SHUTDOWN
  maxCpuTimeSeconds: 300
  cpuEnforcementAction: THROTTLE
  maxThreads: 50
  threadEnforcementAction: NOTIFY
  violationGracePeriod: 3

Full Documentation


🔗 Application Dependencies

Declare inter-application dependencies with automatic validation and ordered startup.

Features:

  • REQUIRED and OPTIONAL dependency types
  • Deploy-time validation (fails if required service not available)
  • Circular dependency detection using DFS
  • Ordered startup via topological sort
  • Service version tracking with semantic versioning
  • Health check interface for service availability

Configuration:

dependencies:
  - serviceInterface: com.example.DatabaseService
    type: REQUIRED
    version: "1.0.0"
  - serviceInterface: com.example.CacheService
    type: OPTIONAL
    version: latest

Startup Order Example:

database-service (no dependencies)
    ↓
cache-service (depends on database-service)
    ↓
order-service (depends on cache-service and database-service)

Full Documentation


💾 Persistent Storage Volumes

Per-application persistent and ephemeral volumes with lifecycle management.

Features:

  • Filesystem-based storage at /var/platform-java/volumes/{appId}/{volumeName}
  • Persistent volumes survive restarts and redeployments
  • Ephemeral volumes deleted on undeploy
  • Configurable size limits with enforcement
  • Volume usage tracking
  • Thread-safe volume registration

Configuration:

volumes:
  - name: database
    mountPath: /var/myapp/db
    persistent: true
    maxSizeMB: 1024
  - name: cache
    mountPath: /var/myapp/cache
    persistent: false
    maxSizeMB: 512

Usage in Application:

context.getVolumeManager().ifPresent(vm -> {
    Path dbPath = vm.getVolumePath("database");
    // Use path for file I/O
});

Full Documentation


🔧 Native Binary Support

Load platform-specific native libraries with automatic platform detection.

Features:

  • Platform detection (Linux x64, Windows x64, macOS ARM64, etc.)
  • Per-application library isolation at /var/platform-java/natives/{appId}/
  • No version conflicts between applications
  • Support for multiple platforms in single descriptor
  • Automatic java.library.path configuration
  • GraalVM native image support flag (future enhancement)

Supported Platforms:

  • LINUX_X64, LINUX_ARM64
  • WINDOWS_X64, WINDOWS_ARM64
  • MACOS_X64, MACOS_ARM64
  • ANY (platform-independent)

Configuration:

nativeLibraries:
  - name: sqlite3
    platform: LINUX_X64
    libraryPath: file:///libs/linux-x64/libsqlite3.so
  - name: sqlite3
    platform: WINDOWS_X64
    libraryPath: file:///libs/windows-x64/sqlite3.dll
  - name: sqlite3
    platform: MACOS_ARM64
    libraryPath: file:///libs/macos-arm64/libsqlite3.dylib

Full Documentation


📊 Enhanced Observability (OpenTelemetry)

Export metrics to OpenTelemetry Collector via OTLP protocol.

Features:

  • OTLP gRPC exporter for metrics
  • Periodic export every 60 seconds
  • Metrics: CPU time (counter), heap usage (gauge), thread count (gauge)
  • All metrics labeled with app_id
  • Service name: "platform-java"
  • Integration with Prometheus, Grafana, Jaeger

Configuration:

metrics:
  opentelemetry:
    enabled: true
    endpoint: "http://localhost:4317"

Exported Metrics:

  • platform-java.app.cpu_time_seconds - Total CPU time (counter)
  • platform-java.app.heap_used_bytes - Current heap usage (gauge)
  • platform-java.app.thread_count - Current thread count (gauge)

Future Enhancements (documented but not yet implemented):

  • Distributed tracing with trace context propagation
  • Structured JSON logging with MDC (trace_id, span_id, app_id)
  • Per-application log aggregation
  • Advanced metrics (GC stats, I/O, network)

Full Documentation


New Modules in 2.0

  • platform-java-storage: Persistent volume management
  • platform-java-otel: OpenTelemetry metrics exporter

Dependencies Added

  • OpenTelemetry 1.32.0: For OTLP metrics export
    • io.opentelemetry:opentelemetry-api:1.32.0
    • io.opentelemetry:opentelemetry-sdk:1.32.0
    • io.opentelemetry:opentelemetry-exporter-otlp:1.32.0

Backward Compatibility

All 2.0 features are opt-in and backward compatible:

  • Existing applications continue to work without changes
  • All new interfaces are Optional<T> or have default implementations
  • ApplicationDescriptor builder has sensible defaults
  • New modules are optional dependencies
  • Configuration changes are additive only

No breaking changes to existing APIs.

Migration from 1.0 to 2.0

No migration required. platform-java 2.0 is fully backward compatible with 1.0.

To use new features, update your application descriptors:

# Add hot reload support
hotReloadEnabled: true
preserveState: true

# Add resource enforcement
resources:
  maxHeapMB: 512
  memoryEnforcementAction: SHUTDOWN

# Add dependencies
dependencies:
  - serviceInterface: com.example.MyService
    type: REQUIRED
    version: "1.0.0"

# Add volumes
volumes:
  - name: data
    mountPath: /var/myapp/data
    persistent: true
    maxSizeMB: 1024

# Add native libraries
nativeLibraries:
  - name: mylib
    platform: LINUX_X64
    libraryPath: file:///libs/libmylib.so

Enable OpenTelemetry in platform.yaml:

metrics:
  opentelemetry:
    enabled: true
    endpoint: "http://otel-collector:4317"

Build Status

  • Modules: 22 (2 new in 2.0)
  • Build Time: ~7 seconds
  • Test Coverage: 276 tests (272 passing, 4 skipped)
  • Code Coverage: 80%+ on all modules
  • JavaDoc: 100% complete

platform-java 1.0 - Release Notes

Release Date: May 2026
Status: Production Ready (Superseded by 2.0)

Overview

platform-java 1.0 is a production-ready Java application platform that enables running multiple isolated Java applications within a single JVM. This release includes all core features plus advanced deployment, management, and monitoring capabilities.

What's New in 1.0

Core Features

  • Complete Application Isolation: ClassLoader, thread pool, and security isolation per application
  • Resource Monitoring: Real-time CPU, memory, and thread tracking per application
  • Inter-Application Messaging: Optional event bus and service registry for loose coupling
  • Security Policies: Configurable permissions (filesystem, network, reflection)

Deployment Methods (NEW)

  • YAML/JSON Descriptors: Declarative application configuration with full validation
  • Filesystem Watcher: Auto-deployment when descriptor files are dropped in watched directory
  • REST API: Full HTTP API for deployment, lifecycle management, and metrics
  • Web Console: Modern browser-based UI with real-time metrics charts
  • Interactive CLI: Enhanced command-line interface with descriptor support

Platform Configuration (NEW)

  • platform.yaml Support: Load all platform settings from YAML configuration file
  • Command-Line Overrides: CLI flags override file settings for flexibility
  • --config Flag: Specify custom configuration file location
  • Simplified Production Deployment: Single config file instead of many CLI flags

Monitoring & Metrics (NEW)

  • JMX Metrics: Expose application metrics via JMX MBeans

    • Compatible with JConsole, VisualVM, and other JMX tools
    • Per-application MBeans with lifecycle operations
    • Port: 9999 (configurable)
  • Prometheus Metrics: Export metrics in Prometheus text format

    • Counter and gauge metrics for CPU, memory, threads
    • Application state tracking
    • Port: 9090 (configurable)

Clustering Support (NEW)

  • Multi-Node Deployment: Distribute applications across multiple cluster nodes

    • Hazelcast IMDG 5.3.0 for distributed coordination
    • TCP/IP discovery with configurable seed nodes
    • Leader election via Hazelcast CP subsystem
  • Automatic Failover: Applications reassigned on node failure

    • Leader-based application scheduling
    • Load-balanced assignment (ROUND_ROBIN or LEAST_LOADED strategies)
    • Distributed state replication across all nodes
  • Cluster State Store: Shared application descriptors and state

    • JSON serialization for ApplicationDescriptor
    • Event notifications on state changes
    • Thread-safe distributed maps

Web Console Features (NEW)

  • Dashboard with application list and status
  • Deploy applications via file upload or YAML/JSON paste
  • Start/stop/undeploy buttons
  • Real-time CPU, memory, and thread charts
  • Application properties viewer
  • Access at: http://localhost:8080/console

REST API Endpoints (NEW)

POST   /api/applications              - Deploy application
POST   /api/applications/from-yaml    - Deploy from YAML upload
GET    /api/applications              - List all applications
GET    /api/applications/{id}         - Get application details
GET    /api/applications/{id}/status  - Get status + metrics
POST   /api/applications/{id}/start   - Start application
POST   /api/applications/{id}/stop    - Stop application
DELETE /api/applications/{id}         - Undeploy application
GET    /api/platform/info             - Platform info
GET    /api/health                    - Health check

Module Summary

Production Modules

  • platform-java-api - Public APIs and interfaces (20+ interfaces)
  • platform-java-core - Core platform logic (ApplicationManager, lifecycle)
  • platform-java-classloader - Isolated ClassLoader with parent-last delegation
  • platform-java-threadpool - Managed thread pools per application
  • platform-java-security - Security policy enforcement
  • platform-java-monitoring - Resource tracking and quotas
  • platform-java-messaging - Event bus and service registry
  • platform-java-config - YAML/JSON descriptor parsing (NEW)
  • platform-java-fs-watcher - Filesystem monitoring (NEW)
  • platform-java-rest-api - HTTP REST API server (NEW)
  • platform-java-web-console - Browser-based UI (NEW)
  • platform-java-metrics-jmx - JMX metrics exporter (NEW)
  • platform-java-metrics-prometheus - Prometheus exporter (NEW)
  • platform-java-cluster - Multi-node clustering support (NEW)
  • platform-java-launcher - Platform bootstrap and CLI
  • platform-java-samples - Sample applications

Test Coverage

  • 623 unit and integration tests across all modules
  • 85%+ code coverage (average across all modules)
  • 15 integration tests for end-to-end verification
  • 100% test pass rate in CI/CD pipelines

Configuration

Platform Configuration File (NEW)

platform-java supports loading configuration from a YAML file (platform.yaml):

api:
  enabled: true
  port: 8080
metrics:
  jmx:
    enabled: true
    port: 9999
  prometheus:
    enabled: true
    port: 9090
watcher:
  enabled: true
  watchDirectory: /var/platform-java/apps

Load with:

java -jar platform-java-launcher-1.0.jar --config platform.yaml

Command-Line Flags

# Configuration file
--config <file>             # Load configuration from YAML file

# Enable specific features
--rest-api                  # Enable REST API (port 8080)
--port <number>             # Specify REST API port
--web-console               # Enable web console (requires --rest-api)
--jmx-port <number>         # Enable JMX metrics on port
--prometheus                # Enable Prometheus metrics (port 9090)
--prometheus-port <number>  # Specify Prometheus port
--watch-dir <path>          # Enable filesystem watcher

# Production example (command-line)
java -jar platform-java-launcher-1.0.jar \
  --rest-api --web-console \
  --jmx-port 9999 --prometheus \
  --watch-dir /var/platform-java/apps

# Production example (config file)
java -jar platform-java-launcher-1.0.jar --config platform.yaml

# Override config file settings
java -jar platform-java-launcher-1.0.jar --config platform.yaml --port 9000

Supported Deployment Formats

YAML Descriptor

applicationId: my-app
mainClass: com.example.MyApp
classpathEntries:
  - file:///path/to/app.jar
threadPool:
  corePoolSize: 4
  maxPoolSize: 20
resources:
  maxHeapMB: 512
security:
  allowReflection: true
enableMessaging: true
properties:
  app.config: /etc/myapp

JSON Descriptor

{
  "applicationId": "my-app",
  "mainClass": "com.example.MyApp",
  "classpathEntries": ["file:///path/to/app.jar"],
  "threadPool": {"corePoolSize": 4, "maxPoolSize": 20},
  "resources": {"maxHeapMB": 512},
  "enableMessaging": true
}

Performance Characteristics

  • Startup Time: < 2 seconds (platform initialization)
  • Application Deployment: < 500ms (typical JAR)
  • Memory Overhead: ~50MB base platform + per-app overhead
  • Thread Overhead: ~10 threads base platform
  • Isolation Overhead: Minimal (<5% CPU overhead per app)

System Requirements

  • Java: 11 or later (tested on Java 11, 17, 21)
  • Memory: 512MB minimum (platform + apps)
  • OS: Linux, macOS, Windows (any platform supporting Java 11+)
  • Build: Maven 3.6+

Breaking Changes from Previous Versions

This is the initial 1.0 release. No breaking changes.

Known Limitations

  • Heap Monitoring: Uses ClassLoader-based estimation (not precise per-app)
    • Future: JVMTI agent for precise heap tracking
  • Clustering: Not included in 1.0 (planned for future release)
  • Native Code: Applications using JNI require special configuration
  • Security Manager: Deprecated in Java 17+ (alternative approach in development)

Migration Guide

N/A - Initial release

Upgrade Path

For future upgrades, we maintain backward compatibility within major versions:

  • 1.x → 1.y: Always compatible (no breaking API changes)
  • 1.x → 2.0: May require application updates (documented in 2.0 release notes)

Getting Started

See QUICKSTART.md for a 5-minute tutorial.

Basic usage:

# Build
mvn clean install

# Run
java -jar platform-java-launcher/target/platform-java-launcher-1.0.jar

# Deploy sample
platform-java> deploy hello platform-java-samples/hello-world/target/sample-hello-world-1.0.jar org.flossware.platform-java.samples.helloworld.HelloWorldApp
platform-java> start hello

Documentation

Support

Contributors

platform-java is developed by FlossWare and contributors.

License

See LICENSE file for details.

Future Roadmap

1.1 (Q3 2026)

  • Performance optimizations
  • Additional metrics exporters
  • Enhanced security policies

2.0 (Q4 2026)

  • JVMTI agent for precise heap monitoring
  • Clustering support with Hazelcast
  • Advanced monitoring dashboards
  • Breaking API changes (documented)

Thank you for using platform-java!

For questions or feedback, please open an issue on GitHub.