org.sdase.commons.server.weld.WeldBundle Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sda-commons-server-weld Show documentation
Show all versions of sda-commons-server-weld Show documentation
A libraries to bootstrap services easily that follow the patterns and specifications promoted by the SDA SE
package org.sdase.commons.server.weld;
import io.dropwizard.core.Configuration;
import io.dropwizard.core.ConfiguredBundle;
import io.dropwizard.core.setup.Bootstrap;
import io.dropwizard.core.setup.Environment;
import org.jboss.weld.environment.servlet.Listener;
/**
* Dropwizard Bundle that adds a listener for using Injection inside of servlets.
*
* The use of the Bundle is optional, but the use of the {@link DropwizardWeldHelper} is
* required.
*
*
Example usage:
*
*
{@code
* public void initialize(final Bootstrap bootstrap) {
* bootstrap.addBundle(new WeldBundle());
* }
* }
*/
public class WeldBundle implements ConfiguredBundle {
@Override
public void initialize(final Bootstrap> bootstrap) {
// not implemented
}
@Override
public void run(final Configuration configuration, final Environment environment) {
environment.getApplicationContext().addEventListener(new Listener());
}
}