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

io.sentry.servlet.SentryServletContainerInitializer Maven / Gradle / Ivy

There is a newer version: 8.0.0-alpha.4
Show newest version
package io.sentry.servlet;

import com.jakewharton.nopen.annotation.Open;
import io.sentry.SentryIntegrationPackageStorage;
import java.util.Set;
import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * Servlet container initializer used to add the {@link SentryServletRequestListener} to the {@link
 * ServletContext}.
 */
@Open
public class SentryServletContainerInitializer implements ServletContainerInitializer {
  @Override
  public void onStartup(@Nullable Set> c, @NotNull ServletContext ctx)
      throws ServletException {
    ctx.addListener(SentryServletRequestListener.class);
    SentryIntegrationPackageStorage.getInstance().addIntegration("Servlet");
    SentryIntegrationPackageStorage.getInstance()
        .addPackage("maven:io.sentry:sentry-servlet", BuildConfig.VERSION_NAME);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy