public static String getResourceName(String jndiName, String mappedName) { if (mappedName != null) { return mappedName; } else if (jndiName != null) { return jndiName; } else { throw WeldLogger.ROOT_LOGGER.cannotDetermineResourceName(); } }
private Class<?> loadClass(String className) { WeldLogger.DEPLOYMENT_LOGGER.tracef("Falling back to reflection for %s", className); try { return classLoader.loadClass(className); } catch (ClassNotFoundException e) { throw WeldLogger.ROOT_LOGGER.cannotLoadClass(className, e); } }
@Override public final String rejectAttributesMustBeTrue(final java.util.Set<String> keySet) { return String.format(getLoggingLocale(), rejectAttributesMustBeTrue$str(), keySet); } private static final String couldNotFindResource2 = "WFLYWELD0049: Error injecting resource into CDI managed bean. Can't find a resource named %s defined on %s";
@SuppressWarnings("unchecked") private Class<Extension> loadExtension(String serviceClassName, final ClassLoader loader) throws DeploymentUnitProcessingException { try { return (Class<Extension>) loader.loadClass(serviceClassName); } catch (Exception e) { WeldLogger.DEPLOYMENT_LOGGER.couldNotLoadPortableExceptionClass(serviceClassName, e); } catch (LinkageError e) { WeldLogger.DEPLOYMENT_LOGGER.couldNotLoadPortableExceptionClass(serviceClassName, e); } return null; }
@Override public final void failedToTearDownWeldContexts(final Throwable throwable) { super.log.logf(FQCN, ERROR, throwable, failedToTearDownWeldContexts$str()); } private static final String failedToTearDownWeldContexts = "WFLYWELD0002: Failed to tear down Weld contexts";
@Override public final void injectionTypeNotValue(final String type, final Member injectionPoint) { super.log.logf(FQCN, WARN, null, injectionTypeNotValue$str(), type, injectionPoint); } private static final String injectionTypeNotValue = "WFLYWELD0008: @Resource injection of type %s is not supported for non-ejb components. Injection point: %s";
@Override public final void startingWeldService(final String deploymentName) { super.log.logf(FQCN, DEBUG, null, startingWeldService$str(), deploymentName); } private static final String startingWeldService = "WFLYWELD0009: Starting weld service for deployment %s";
@Override public final void couldNotLoadPortableExceptionClass(final String className, final Throwable throwable) { super.log.logf(FQCN, WARN, throwable, couldNotLoadPortableExceptionClass$str(), className); } private static final String couldNotLoadPortableExceptionClass = "WFLYWELD0007: Could not load portable extension class %s";
@Override public final void exceptionClearingThreadState(final Exception e) { super.log.logf(FQCN, ERROR, e, exceptionClearingThreadState$str()); } private static final String exceptionClearingThreadState = "WFLYWELD0014: Exception tearing down thread state";
@Override public final void couldNotReadEntries(final IOException ioe) { super.log.logf(FQCN, ERROR, ioe, couldNotReadEntries$str()); } private static final String couldNotReadEntries = "WFLYWELD0016: Could not read entries";
@Override public final void duplicateBeansXml() { super.log.logf(FQCN, WARN, null, duplicateBeansXml$str()); } private static final String duplicateBeansXml = "WFLYWELD0018: Found both WEB-INF/beans.xml and WEB-INF/classes/META-INF/beans.xml. It is not portable to use both locations at the same time. Weld is going to use the former location for this deployment.";
@Override public final void loadingProxiesUsingDeploymentClassLoader(final ModuleIdentifier moduleIdentifier, final String dependencies) { super.log.logf(FQCN, WARN, null, loadingProxiesUsingDeploymentClassLoader$str(), moduleIdentifier, dependencies); } private static final String loadingProxiesUsingDeploymentClassLoader = "WFLYWELD0052: Using deployment classloader to load proxy classes for module %s. Package-private access will not work. To fix this the module should declare dependencies on %s";
@Override public final void cannotLoadAnnotationIndexOfExternalBeanArchive(final Object indexUrl) { super.log.logf(FQCN, WARN, null, cannotLoadAnnotationIndexOfExternalBeanArchive$str(), indexUrl); } private static final String cannotLoadAnnotationIndexOfExternalBeanArchive = "WFLYWELD0054: Could not read provided index of an external bean archive: %s";
@Override public final void failedToSetupWeldContexts(final Throwable throwable) { super.log.logf(FQCN, ERROR, throwable, failedToSetupWeldContexts$str()); } private static final String failedToSetupWeldContexts = "WFLYWELD0001: Failed to setup Weld contexts";
@Override public final void processingWeldDeployment(final String deployment) { super.log.logf(FQCN, INFO, null, processingWeldDeployment$str(), deployment); } private static final String processingWeldDeployment = "WFLYWELD0003: Processing weld deployment %s";
@Override public final void couldNotFindBeanManagerForDeployment(final String beanManager) { super.log.logf(FQCN, ERROR, null, couldNotFindBeanManagerForDeployment$str(), beanManager); } private static final String couldNotFindBeanManagerForDeployment = "WFLYWELD0005: Could not find BeanManager for deployment %s";
@Override public final void startingServicesForCDIDeployment(final String deploymentName) { super.log.logf(FQCN, DEBUG, null, startingServicesForCDIDeployment$str(), deploymentName); } private static final String startingServicesForCDIDeployment = "WFLYWELD0006: Starting Services for CDI deployment: %s";
@Override public final void unableToLoadAnnotation(final String annotationClassName) { super.log.logf(FQCN, DEBUG, null, unableToLoadAnnotation$str(), annotationClassName); } private static final String unableToLoadAnnotation = "Unable to load annotation %s";
@Override public final void beanArchiveDiscovered(final BeanDeploymentArchive bda) { super.log.logf(FQCN, DEBUG, null, beanArchiveDiscovered$str(), bda); } private static final String beanArchiveDiscovered = "Discovered %s";
/** * Gets the {@link BeanManager} linked to the root bean deployment archive. This BeanManager has access to all beans in a * deployment * * @throws IllegalStateException if the container is not running */ public BeanManagerImpl getBeanManager() { if (!started) { throw WeldLogger.ROOT_LOGGER.notStarted("WeldContainer"); } return bootstrap.getManager(rootBeanDeploymentArchive); }