package org.jboss.resteasy.plugins.server.servlet;
import org.jboss.resteasy.core.Dispatcher;
import org.jboss.resteasy.spi.Registry;
import org.jboss.resteasy.spi.ResteasyDeployment;
import org.jboss.resteasy.spi.ResteasyProviderFactory;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
public class ResteasyBootstrap implements ServletContextListener
{
protected ResteasyDeployment deployment;
public void contextInitialized(ServletContextEvent event)
{
ServletContext servletContext = event.getServletContext();
ListenerBootstrap config = new ListenerBootstrap(event.getServletContext());
deployment = config.createDeployment();
deployment.start();
servletContext.setAttribute(ResteasyDeployment.class.getName(), deployment);
}
public void contextDestroyed(ServletContextEvent event)
{
deployment.stop();
}
}