io.bdeploy.jersey.JerseyEagerServiceInitializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api Show documentation
Show all versions of api Show documentation
Public API including dependencies, ready to be used for integrations and plugins.
package io.bdeploy.jersey;
import org.glassfish.jersey.server.spi.Container;
import org.glassfish.jersey.server.spi.ContainerLifecycleListener;
/**
* A listener implementation which will request a certain service at container startup, so that it is initialized.
*/
public class JerseyEagerServiceInitializer implements ContainerLifecycleListener {
private final Class clazz;
public JerseyEagerServiceInitializer(Class clazz) {
this.clazz = clazz;
}
@Override
public void onStartup(Container container) {
container.getApplicationHandler().getInjectionManager().getInstance(clazz);
}
@Override
public void onReload(Container container) {
onStartup(container);
}
@Override
public void onShutdown(Container container) {
// nothing to do on shutdown.
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy