Deployment engineering

Drain admission model

Reject new work while draining. Executed Java 21 functional model; container behavior not established.

Formal Syntax & Structure

java syntaxjava
admit()

Working Example

Example Snippetjava
public class Main {    static class Lifecycle { boolean started, draining; int active; int ready(){return started&&!draining?200:503;} int live(){return 200;} boolean admit(){if(ready()!=200)return false;active++;return true;} void finish(){if(active==0)throw new IllegalStateException();active--;} }    public static void main(String[] args) {        var s=new Lifecycle();s.started=true;        System.out.println(s.admit());s.draining=true;        System.out.println(s.admit());s.finish();        System.out.println(s.active);    }}
Java Reference