@SuppressWarnings("unchecked") @Override public Weld addExtensions(Class<? extends Extension>... extensionClasses) { for (Class<? extends Extension> extensionClass : extensionClasses) { try { Extension extension = SecurityActions.newInstance(extensionClass); addExtension(extension); } catch (Exception ex) { CommonLogger.LOG.unableToInstantiate(extensionClass, new Object[] {}, ex); } } return this; }
/** * Finish the initialization. * * @param container * @param isShutdownHookEnabled */ static void endInitialization(WeldContainer container, boolean isShutdownHookEnabled) { container.complete(); // If needed, register one shutdown hook for all containers if (shutdownHook == null && isShutdownHookEnabled) { synchronized (LOCK) { if (shutdownHook == null) { shutdownHook = new ShutdownHook(); SecurityActions.addShutdownHook(shutdownHook); } } } container.fireContainerInitializedEvent(); }
/** * Finish the initialization. * * @param container * @param isShutdownHookEnabled */ static void endInitialization(WeldContainer container, boolean isShutdownHookEnabled) { container.complete(); // If needed, register one shutdown hook for all containers if (shutdownHook == null && isShutdownHookEnabled) { synchronized (LOCK) { if (shutdownHook == null) { shutdownHook = new ShutdownHook(); SecurityActions.addShutdownHook(shutdownHook); } } } container.fireContainerInitializedEvent(); }
@SuppressWarnings("unchecked") @Override public Weld addExtensions(Class<? extends Extension>... extensionClasses) { for (Class<? extends Extension> extensionClass : extensionClasses) { try { Extension extension = SecurityActions.newInstance(extensionClass); addExtension(extension); } catch (Exception ex) { CommonLogger.LOG.unableToInstantiate(extensionClass, new Object[] {}, ex); } } return this; }
/** * Finish the initialization. * * @param container * @param isShutdownHookEnabled */ static void endInitialization(WeldContainer container, boolean isShutdownHookEnabled) { container.complete(); // If needed, register one shutdown hook for all containers if (shutdownHook == null && isShutdownHookEnabled) { synchronized (LOCK) { if (shutdownHook == null) { shutdownHook = new ShutdownHook(); SecurityActions.addShutdownHook(shutdownHook); } } } container.fireContainerInitializedEvent(); }
@SuppressWarnings("unchecked") @Override public Weld addExtensions(Class<? extends Extension>... extensionClasses) { for (Class<? extends Extension> extensionClass : extensionClasses) { try { Extension extension = SecurityActions.newInstance(extensionClass); addExtension(extension); } catch (Exception ex) { CommonLogger.LOG.unableToInstantiate(extensionClass, new Object[] {}, ex); } } return this; }
/** * Attempts to initialize the classes as extensions and add them to the set of extensions. * * @param extensionClasses Classes to be initialized as extensions and added to the set of extensions * @return self */ @SuppressWarnings("unchecked") public Weld addExtensions(Class<? extends Extension>... extensionClasses) { for (Class<? extends Extension> extensionClass : extensionClasses) { try { Extension extension = SecurityActions.newInstance(extensionClass); addExtension(extension); } catch (Exception ex) { CommonLogger.LOG.unableToInstantiate(extensionClass, new Object[] {}, ex); } } return this; }
protected Iterable<Metadata<Extension>> getExtensions() { Set<Metadata<Extension>> result = new HashSet<Metadata<Extension>>(); if (discoveryEnabled) { Iterables.addAll(result, loadExtensions(resourceLoader)); } if (!extensions.isEmpty()) { result.addAll(extensions); } // Ensure that WeldSEBeanRegistrant is present WeldSEBeanRegistrant weldSEBeanRegistrant = null; for (Metadata<Extension> metadata : result) { if (metadata.getValue().getClass().getName().equals(WeldSEBeanRegistrant.class.getName())) { weldSEBeanRegistrant = (WeldSEBeanRegistrant) metadata.getValue(); break; } } if (weldSEBeanRegistrant == null) { try { weldSEBeanRegistrant = SecurityActions.newInstance(WeldSEBeanRegistrant.class); result.add(new MetadataImpl<Extension>(weldSEBeanRegistrant, SYNTHETIC_LOCATION_PREFIX + WeldSEBeanRegistrant.class.getName())); } catch (Exception e) { throw new RuntimeException(e); } } if (isEnabled(DEV_MODE_SYSTEM_PROPERTY, false)) { // The development mode is enabled - register the Probe extension result.add(new MetadataImpl<Extension>(DevelopmentMode.getProbeExtension(resourceLoader), "N/A")); } return result; }
weldSEBeanRegistrant = SecurityActions.newInstance(WeldSEBeanRegistrant.class); result.add(new MetadataImpl<Extension>(weldSEBeanRegistrant, SYNTHETIC_LOCATION_PREFIX + WeldSEBeanRegistrant.class.getName())); } catch (Exception e) {
weldSEBeanRegistrant = SecurityActions.newInstance(WeldSEBeanRegistrant.class); result.add(new MetadataImpl<Extension>(weldSEBeanRegistrant, SYNTHETIC_LOCATION_PREFIX + WeldSEBeanRegistrant.class.getName())); } catch (Exception e) {
weldSEBeanRegistrant = SecurityActions.newInstance(WeldSEBeanRegistrant.class); result.add(new MetadataImpl<Extension>(weldSEBeanRegistrant, SYNTHETIC_LOCATION_PREFIX + WeldSEBeanRegistrant.class.getName())); } catch (Exception e) {