private static JNDIService getJNDIService() { JNDIService jndiService = WebBeansContext.getInstance().getService(JNDIService.class); if(jndiService == null) { throw new WebBeansCreationException("JNDI service is not available"); } return jndiService; }
protected AnnotatedConstructor<T> createConstructor() { AnnotatedConstructor<T> constructor = null; for (InjectionPoint injectionPoint : getInjectionPoints()) { if (injectionPoint.getMember() instanceof Constructor) { if (constructor == null) { constructor = (AnnotatedConstructor<T>)((AnnotatedParameter<T>)injectionPoint.getAnnotated()).getDeclaringCallable(); return constructor; } } } Constructor<T> defaultConstructor = getDefaultConstructor(); if (defaultConstructor == null) { throw new WebBeansCreationException("No default constructor for " + annotatedType.getJavaClass().getName()); } return new AnnotatedConstructorImpl<>(webBeansContext, defaultConstructor, annotatedType); }