public interface Managed
Managed
are started and/or stopped by Jooby.
Please note, that every single object can implement this interface but for none singleton
objects, the object will be keep on memory waiting for application shutdown. That's why it is
strongly recommend to ONLY use this on singleton objects.
PostConstruct
and PreDestroy
annotation are supported too. PostConstruct
works for singletons and none singletons (no restriction). PreDestroy
works for
singletons and none singletons. But again, it is strongly recommended to use it on singleton
objects.Modifier and Type | Method and Description |
---|---|
void |
start()
Start callback, useful to initialize an expensive service.
|
void |
stop()
Stop callback, useful for cleanup and free resources.
|
Copyright © 2015. All rights reserved.