Пример #1
0
 @Override
 public void onStartup(Set<Class<?>> classes, ServletContext context) throws ServletException {
   log.info("Initialize Weld using ServletContainerInitializer");
   lifecycle = new WeldServletLifecycle();
   lifecycle.initialize(context);
   context.setAttribute(WeldServletLifecycle.INSTANCE_ATTRIBUTE_NAME, lifecycle);
   context.setAttribute(
       WeldServletLifecycle.LISTENER_CLASS_FLAG_ATTRIBUTE_NAME, this.getClass().getName());
   context.addListener(this);
   super.contextInitialized(new ServletContextEvent(context));
 }
Пример #2
0
 @Override
 public void contextDestroyed(ServletContextEvent sce) {
   lifecycle.destroy(sce.getServletContext());
   super.contextDestroyed(sce);
 }
Пример #3
0
 @Override
 protected ServletListener delegate() {
   return lifecycle.getWeldListener();
 }