congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
BeanManagerLogger
Code IndexAdd Tabnine to your IDE (free)

How to use
BeanManagerLogger
in
org.jboss.weld.logging

Best Java code snippets using org.jboss.weld.logging.BeanManagerLogger (Showing top 20 results out of 315)

Refine searchRefine arrow

  • BeanManagerImpl
  • MetaAnnotationStore
  • ServiceRegistry
  • InterceptorBindingModel
  • Container
  • ContainerState
  • Preconditions
  • SimpleCDI
  • BeanDeploymentArchive
  • QualifierModel
origin: wildfly/wildfly

private static void checkContainerState(Container container) {
  ContainerState state = container.getState();
  if (state.equals(ContainerState.STOPPED) || state.equals(ContainerState.SHUTDOWN)) {
    throw BeanManagerLogger.LOG.beanManagerNotAvailable();
  }
}
origin: weld/core

public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {
  if (Container.available(contextId)) {
    for (Entry<BeanDeploymentArchive, BeanManagerImpl> entry : Container.instance(contextId).beanDeploymentArchives().entrySet()) {
      BeanDeploymentArchive bda = entry.getKey();
      if (bda.getId().equals(FLAT_BEAN_DEPLOYMENT_ID) || bda.getId().contains(WEB_INF_CLASSES_FILE_PATH) || bda.getId().contains(WEB_INF_CLASSES)) {
        return entry.getValue();
      }
    }
    throw BeanManagerLogger.LOG.cannotLocateBeanManager();
  } else {
    throw BeanManagerLogger.LOG.cannotLocateBeanManager();
  }
}
origin: weld/core

public <X> BeanAttributes<?> internalCreateBeanAttributes(AnnotatedMember<X> member) {
  EnhancedAnnotatedMember<?, X, Member> weldMember = null;
  if (member instanceof AnnotatedField<?> || member instanceof AnnotatedMethod<?>) {
    weldMember = services.get(MemberTransformer.class).loadEnhancedMember(member, getId());
  } else {
    throw BeanManagerLogger.LOG.cannotCreateBeanAttributesForIncorrectAnnotatedMember(member);
  }
  return BeanAttributesFactory.forBean(weldMember, this);
}
origin: org.jboss.weld.se/weld-se

@Override
public BeanManagerProxy getBeanManager() {
  ContainerState state = container.getState();
  if (state.equals(ContainerState.STOPPED) || state.equals(ContainerState.SHUTDOWN)) {
    throw BeanManagerLogger.LOG.beanManagerNotAvailable();
  }
  return beanManagers.getValue(getCallingClassName());
}
origin: org.jboss.weld.se/weld-se

@Override
protected void checkQualifier(Annotation qualifier, QualifierInstance qualifierInstance, Class<? extends  Annotation> annotationType) {
  if (!getMetaAnnotationStore().getInterceptorBindingModel(annotationType).isValid()) {
    throw BeanManagerLogger.LOG.interceptorResolutionWithNonbindingType(qualifier);
  }
  if (annotationTypes.contains(annotationType)) {
    throw BeanManagerLogger.LOG.duplicateInterceptorBinding(qualifier);
  }
}
origin: org.jboss.weld.se/weld-se

/**
 * Extracts a flat set of interception bindings from a given set of interceptor bindings.
 *
 * @param addTopLevelInterceptorBindings add top level interceptor bindings to the result set.
 * @param addInheritedInterceptorBindings add inherited level interceptor bindings to the result set.
 * @return
 */
public static Set<Annotation> flattenInterceptorBindings(BeanManagerImpl beanManager, Collection<Annotation> annotations, boolean addTopLevelInterceptorBindings,
    boolean addInheritedInterceptorBindings) {
  Set<Annotation> flattenInterceptorBindings = new InterceptorBindingSet(beanManager);
  if (addTopLevelInterceptorBindings) {
    for (Annotation annotation : annotations) {
      boolean added = flattenInterceptorBindings.add(annotation);
      if (!added) {
        throw BeanManagerLogger.LOG.duplicateInterceptorBinding(annotations);
      }
    }
  }
  if (addInheritedInterceptorBindings) {
    for (Annotation annotation : annotations) {
      addInheritedInterceptorBindings(annotation.annotationType(), beanManager.getServices().get(MetaAnnotationStore.class), flattenInterceptorBindings);
    }
  }
  return flattenInterceptorBindings;
}
origin: org.jboss.weld.se/weld-se-shaded

private static void addInterceptorBindings(EnhancedAnnotatedType<?> clazz, Collection<Annotation> interceptorBindings, Set<Annotation> flattenInterceptorBindings,
    MetaAnnotationStore metaAnnotationStore) {
  for (Annotation annotation : interceptorBindings) {
    Class<? extends Annotation> annotationType = annotation.annotationType();
    if (!annotation.annotationType().isAnnotationPresent(Repeatable.class)) {
      for (Annotation binding : flattenInterceptorBindings) {
        if (binding.annotationType().equals(annotationType)
            && !metaAnnotationStore.getInterceptorBindingModel(annotationType).isEqual(annotation, binding, false)) {
          if (clazz != null) {
            throw new DefinitionException(BeanLogger.LOG.conflictingInterceptorBindings(clazz));
          } else {
            throw BeanManagerLogger.LOG.duplicateInterceptorBinding(annotation);
          }
        }
      }
    }
    flattenInterceptorBindings.add(annotation);
  }
}
origin: weld/weld-vertx

@SuppressWarnings("unchecked")
private void initWithWorker(Type requiredType, Annotation[] qualifiers, Vertx vertx, BeanManager beanManager) {
  vertx.<Object> executeBlocking((f -> {
    WeldInstance<Object> asyncInstance = instance.select(requiredType, qualifiers);
    if (asyncInstance.isUnsatisfied()) {
      f.fail(BeanManagerLogger.LOG.injectionPointHasUnsatisfiedDependencies(Arrays.toString(qualifiers), requiredType, ""));
      return;
    } else if (asyncInstance.isAmbiguous()) {
      f.fail(BeanManagerLogger.LOG.injectionPointHasAmbiguousDependencies(Arrays.toString(qualifiers), requiredType, ""));
      return;
    }
    Handler<Object> handler = asyncInstance.getHandler();
    Object beanInstance = handler.get();
    if (beanManager.isNormalScope(handler.getBean().getScope()) && beanInstance instanceof TargetInstanceProxy) {
      // Initialize normal scoped bean instance eagerly
      ((TargetInstanceProxy<?>) beanInstance).getTargetInstance();
    }
    f.complete(beanInstance);
  }), (r) -> {
    if (r.succeeded()) {
      sucess((T) r.result());
    } else {
      failure(r.cause());
    }
  });
}
origin: weld/core

/**
 * Gets an active context of the given scope. Throws an exception if there are no active contexts found or if there are too many matches
 *
 * @throws IllegalStateException if there are multiple active scopes for a given context
 * @param scopeType The scope to match
 * @return A single active context of the given scope
 * @see javax.enterprise.inject.spi.BeanManager#getContext(java.lang.Class)
 */
@Override
public Context getContext(Class<? extends Annotation> scopeType) {
  Context activeContext = internalGetContext(scopeType);
  if (activeContext == null) {
    throw BeanManagerLogger.LOG.contextNotActive(scopeType.getName());
  }
  return activeContext;
}
origin: weld/core

/**
 * Callback that allows to override the behavior when class that invoked CDI.current() is placed in multiple bean archives.
 */
protected BeanManagerImpl ambiguousBeanManager(String callerClassName, Set<BeanManagerImpl> managers) {
  throw BeanManagerLogger.LOG.ambiguousBeanManager(callerClassName);
}
origin: org.jboss.weld.se/weld-se

@Override
public <X> Bean<? extends X> resolve(Set<Bean<? extends X>> beans) {
  if (beans == null || beans.isEmpty()) {
    return null;
  }
  Set<Bean<? extends X>> resolvedBeans = beanResolver.resolve(beans);
  if (resolvedBeans.size() == 1) {
    return resolvedBeans.iterator().next();
  } else if (resolvedBeans.size() == 0) {
    return null;
  } else {
    throw BeanManagerLogger.LOG.ambiguousBeansForDependency(WeldCollections.toMultiRowString(beans));
  }
}
origin: org.jboss.weld.se/weld-se

private Context internalGetContext(Class<? extends Annotation> scopeType) {
  Context activeContext = null;
  final List<Context> ctx = contexts.get(scopeType);
  if (ctx == null) {
    return null;
  }
  for (Context context : ctx) {
    if (context.isActive()) {
      if (activeContext == null) {
        activeContext = context;
      } else {
        throw BeanManagerLogger.LOG.duplicateActiveContexts(scopeType.getName());
      }
    }
  }
  return activeContext;
}
origin: weld/core

@Override
public void deactivate() throws ContextNotActiveException {
  if (!isRequestContextActive()) {
    throw BeanManagerLogger.LOG.contextNotActive(RequestScoped.class);
  }
  if (isActivator.compareAndSet(true, false)) {
    try {
      requestBeforeDestroyedEvent.fire(toString());
      requestContext.invalidate();
      requestContext.deactivate();
    } finally {
      requestDestroyedEvent.fire(toString());
    }
  }
}
origin: org.jboss.weld.vertx/weld-vertx-core

@SuppressWarnings("unchecked")
private void initWithWorker(InjectionPoint injectionPoint, Vertx vertx, BeanManager beanManager, Type requiredType) {
  vertx.<T> executeBlocking((f -> {
    Set<Bean<?>> beans = beanManager.getBeans(requiredType, injectionPoint.getQualifiers().toArray(new Annotation[] {}));
    if (beans.isEmpty()) {
      f.fail(BeanManagerLogger.LOG.injectionPointHasUnsatisfiedDependencies(injectionPoint.getQualifiers(), requiredType, ""));
      return;
    }
    Bean<T> bean = (Bean<T>) beanManager.resolve(beans);
    T beanInstance = (T) beanManager.getReference(bean, requiredType, creationalContext);
    if (beanManager.isNormalScope(bean.getScope()) && beanInstance instanceof TargetInstanceProxy) {
      // Initialize normal scoped bean instance eagerly
      ((TargetInstanceProxy<?>) beanInstance).getTargetInstance();
    }
    f.complete(beanInstance);
  }), (r) -> {
    if (r.succeeded()) {
      sucess(r.result());
    } else {
      failure(r.cause());
    }
  });
}
origin: weld/core

public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {
  if (Container.available(contextId)) {
    for (Entry<BeanDeploymentArchive, BeanManagerImpl> entry : Container.instance(contextId).beanDeploymentArchives().entrySet()) {
      BeanDeploymentArchive bda = entry.getKey();
      if (bda.getId().equals(FLAT_BEAN_DEPLOYMENT_ID) || bda.getId().contains(WEB_INF_CLASSES_FILE_PATH) || bda.getId().contains(WEB_INF_CLASSES)) {
        return entry.getValue();
      }
    }
    throw BeanManagerLogger.LOG.cannotLocateBeanManager();
  } else {
    throw BeanManagerLogger.LOG.cannotLocateBeanManager();
  }
}
origin: org.jboss.weld.se/weld-se

public <X> BeanAttributes<?> internalCreateBeanAttributes(AnnotatedMember<X> member) {
  EnhancedAnnotatedMember<?, X, Member> weldMember = null;
  if (member instanceof AnnotatedField<?> || member instanceof AnnotatedMethod<?>) {
    weldMember = services.get(MemberTransformer.class).loadEnhancedMember(member, getId());
  } else {
    throw BeanManagerLogger.LOG.cannotCreateBeanAttributesForIncorrectAnnotatedMember(member);
  }
  return BeanAttributesFactory.forBean(weldMember, this);
}
origin: weld/core

@Override
public BeanManagerProxy getBeanManager() {
  ContainerState state = container.getState();
  if (state.equals(ContainerState.STOPPED) || state.equals(ContainerState.SHUTDOWN)) {
    throw BeanManagerLogger.LOG.beanManagerNotAvailable();
  }
  return beanManagers.getValue(getCallingClassName());
}
origin: weld/core

@Override
protected void checkQualifier(Annotation qualifier,final QualifierInstance qualifierInstance, Class<? extends  Annotation> annotationType) {
  if (!getMetaAnnotationStore().getInterceptorBindingModel(annotationType).isValid()) {
    throw BeanManagerLogger.LOG.interceptorResolutionWithNonbindingType(qualifier);
  }
  if (qualifierInstances.contains(qualifierInstance)) {
    throw BeanManagerLogger.LOG.duplicateInterceptorBinding(qualifierInstance);
  }
}
origin: weld/core

private static void addInterceptorBindings(EnhancedAnnotatedType<?> clazz, Collection<Annotation> interceptorBindings, Set<Annotation> flattenInterceptorBindings,
    MetaAnnotationStore metaAnnotationStore) {
  for (Annotation annotation : interceptorBindings) {
    Class<? extends Annotation> annotationType = annotation.annotationType();
    if (!annotation.annotationType().isAnnotationPresent(Repeatable.class)) {
      for (Annotation binding : flattenInterceptorBindings) {
        if (binding.annotationType().equals(annotationType)
            && !metaAnnotationStore.getInterceptorBindingModel(annotationType).isEqual(annotation, binding, false)) {
          if (clazz != null) {
            throw new DefinitionException(BeanLogger.LOG.conflictingInterceptorBindings(clazz));
          } else {
            throw BeanManagerLogger.LOG.duplicateInterceptorBinding(annotation);
          }
        }
      }
    }
    flattenInterceptorBindings.add(annotation);
  }
}
origin: weld/core

private void checkBeanResolved() {
  if (bean != null) {
    return;
  } else if (isUnsatisfied()) {
    throw BeanManagerLogger.LOG.injectionPointHasUnsatisfiedDependencies(Formats.formatAnnotations(ip.getQualifiers()),
        Formats.formatInjectionPointType(ip.getType()), InjectionPoints.getUnsatisfiedDependenciesAdditionalInfo(ip, getBeanManager()));
  } else {
    throw BeanManagerLogger.LOG.injectionPointHasAmbiguousDependencies(Formats.formatAnnotations(ip.getQualifiers()),
        Formats.formatInjectionPointType(ip.getType()), WeldCollections.toMultiRowString(allBeans()));
  }
}
org.jboss.weld.loggingBeanManagerLogger

Javadoc

Log messages for bean manager and related support classes. Message IDs: 001300 - 001399

Most used methods

  • beanManagerNotAvailable
  • injectionPointHasAmbiguousDependencies
  • injectionPointHasUnsatisfiedDependencies
  • ambiguousBeanManager
  • ambiguousBeansForDependency
  • cannotCreateBeanAttributesForIncorrectAnnotatedMember
  • cannotLocateBeanManager
  • contextNotActive
  • duplicateActiveContexts
  • duplicateInterceptorBinding
  • duplicateQualifiers
  • interceptorBindingsEmpty
  • duplicateQualifiers,
  • interceptorBindingsEmpty,
  • interceptorResolutionWithNonbindingType,
  • invalidQualifier,
  • methodNotAvailableAfterShutdown,
  • methodNotAvailableDuringInitialization,
  • noDecoratorTypes,
  • noInstanceOfExtension,
  • notInterceptorBindingType,
  • notStereotype

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • addToBackStack (FragmentTransaction)
  • findViewById (Activity)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now