All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.bdeploy.jersey.JerseyEagerServiceInitializer Maven / Gradle / Ivy

Go to download

Public API including dependencies, ready to be used for integrations and plugins.

There is a newer version: 7.3.6
Show newest version
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