public final class LifecycleModule
extends com.google.inject.AbstractModule
public class MyService {
@PostConstruct
public void init() {
}
@PreDestroy
public void shutdown() {
}
}
To use simply add LifecycleModule to guice when creating the injector
See LifecycleInjector for different scenarios for shutting down the LifecycleManager.| Constructor and Description |
|---|
LifecycleModule() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configure() |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
java.lang.String |
toString() |
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBindingprotected void configure()
configure in class com.google.inject.AbstractModulepublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object