Interface Backend.Application
- Enclosing class:
Backend
public static interface Backend.Application
The build-generated wiring of an application: every bean, constructed and injected by straight-line code the build wrote, and the lifecycle calls around them.
Nothing here is looked up or reflected. The build resolves which
constructor each bean gets, which bean each injection point receives and
in what order they are built, and writes that down as new and
setter calls; this interface is only where the server calls into it.
-
Method Summary
Modifier and TypeMethodDescriptioncreate(Backend.Environment environment) Constructs the beans and returns the routers, once the database, if any, is open.Every bean the build wired: name, type, scope and what it was given.Every route the build generated: method, path and handler.The scheduler running this application's@Scheduledjobs, or null.voidRegisters the websocket endpoints, which are beans too.voidrequestEnded(Object[] beans) A request has been answered;beansare its@RequestScopebeans, whose destroy methods run here.voidsessionEnded(Object[] beans) A session has ended -- invalidated, expired, or the server stopped;beansare its@SessionScopebeans, whose destroy methods run here.voidThe server is accepting: scheduled jobs and exporters start here.voidstopped()The server has drained: the beans' destroy methods run here.voidstopping()The server is about to drain: no new scheduled run starts after this.booleanWhether a generated class needsBackend.currentRequest(): a request- or session-scoped bean reached from a singleton.
-
Method Details
-
create
Constructs the beans and returns the routers, once the database, if any, is open.- Throws:
Exception
-
registerWebSockets
Registers the websocket endpoints, which are beans too.- Throws:
Exception
-
started
-
stopping
void stopping()The server is about to drain: no new scheduled run starts after this. -
stopped
void stopped()The server has drained: the beans' destroy methods run here. -
tracksCurrentRequest
boolean tracksCurrentRequest()Whether a generated class needsBackend.currentRequest(): a request- or session-scoped bean reached from a singleton. False keeps the per-request thread-local write out of servers that have none. -
requestEnded
A request has been answered;beansare its@RequestScopebeans, whose destroy methods run here. -
sessionEnded
A session has ended -- invalidated, expired, or the server stopped;beansare its@SessionScopebeans, whose destroy methods run here. -
getScheduler
Scheduler getScheduler()The scheduler running this application's@Scheduledjobs, or null. -
describeBeans
List describeBeans()Every bean the build wired: name, type, scope and what it was given. For the management endpoint and the development MCP server. -
describeRoutes
List describeRoutes()Every route the build generated: method, path and handler.
-