public <T extends Extension> T getExtension(Class<T> type) { T extension = webBeansContext.getExtensionLoader().getExtension(type); if (extension == null) { throw new IllegalArgumentException("extension " + type + " not registered"); } return extension; }
@Override protected R produce(Map<Interceptor<?>, ?> interceptors, CreationalContextImpl<R> creationalContext) { ExtensionLoader loader = webBeansContext.getExtensionLoader(); return (R) loader.getExtension(creationalContext.getBean().getBeanClass()); } }
public void addViewCdiExtension(@Observes final WebBeansContextCreated event) { event.getContext().getExtensionLoader().addExtension(new ViewExtension()); } }
public void stop() throws OpenEJBException { final ClassLoader oldCl = Thread.currentThread().getContextClassLoader(); try { // Setting context class loader for cleaning Thread.currentThread().setContextClassLoader(classLoader); // Fire shut down webBeansContext.getBeanManagerImpl().fireEvent(new BeforeShutdownImpl()); // Destroys context this.contexsServices.destroy(null); // Free all plugin resources webBeansContext.getPluginLoader().shutDown(); // Clear extensions webBeansContext.getExtensionLoader().clear(); // Delete Resolutions Cache webBeansContext.getBeanManagerImpl().getInjectionResolver().clearCaches(); // Delete AnnotateTypeCache webBeansContext.getAnnotatedElementFactory().clear(); // Clear the resource injection service final CdiResourceInjectionService injectionServices = (CdiResourceInjectionService) webBeansContext.getService(ResourceInjectionService.class); injectionServices.clear(); // Clear singleton list WebBeansFinder.clearInstances(WebBeansUtil.getCurrentClassLoader()); } catch (final Exception e) { throw new OpenEJBException(e); } finally { Thread.currentThread().setContextClassLoader(oldCl); } }
webBeansContext.getExtensionLoader().clear();
public void stop() throws OpenEJBException { final ClassLoader oldCl = Thread.currentThread().getContextClassLoader(); try { // Setting context class loader for cleaning Thread.currentThread().setContextClassLoader(classLoader); // Fire shut down webBeansContext.getBeanManagerImpl().fireEvent(new BeforeShutdownImpl()); // Destroys context webBeansContext.getContextsService().destroy(null); // Free all plugin resources webBeansContext.getPluginLoader().shutDown(); // Clear extensions webBeansContext.getExtensionLoader().clear(); // Delete Resolutions Cache webBeansContext.getBeanManagerImpl().getInjectionResolver().clearCaches(); // Delete AnnotateTypeCache webBeansContext.getAnnotatedElementFactory().clear(); // Clear the resource injection service final CdiResourceInjectionService injectionServices = (CdiResourceInjectionService) webBeansContext.getService(ResourceInjectionService.class); injectionServices.clear(); // Clear singleton list WebBeansFinder.clearInstances(WebBeansUtil.getCurrentClassLoader()); } catch (final Exception e) { throw new OpenEJBException(e); } finally { Thread.currentThread().setContextClassLoader(oldCl); } }
webBeansContext.getExtensionLoader().clear();
webBeansContext.getExtensionLoader().clear();
webBeansContext.getExtensionLoader().loadExtensionServices();