Codota Logo
BeanManager.getInjectableReference
Code IndexAdd Codota to your IDE (free)

How to use
getInjectableReference
method
in
javax.enterprise.inject.spi.BeanManager

Best Java code snippets using javax.enterprise.inject.spi.BeanManager.getInjectableReference (Showing top 20 results out of 315)

  • Common ways to obtain BeanManager
private void myMethod () {
BeanManager b =
  • Codota IconCDI.current().getBeanManager()
  • Codota IconBeanManagerProvider.getInstance().getBeanManager()
  • Codota IconWeldContainer container;container.getBeanManager()
  • Smart code suggestions by Codota
}
origin: org.apache.deltaspike.core/deltaspike-core-api

/**
 * Get the default value of the parameter. The default value is that which
 * would be injected according to the CDI type safe resolution rules.
 *
 * @param creationalContext the creationalContext to use to obtain the
 *                          injectable reference.
 * @return the default value
 */
public Object getDefaultValue(CreationalContext<?> creationalContext)
{
  return beanManager.getInjectableReference(injectionPoint, creationalContext);
}
origin: org.jboss.seam.solder/seam-solder

/**
 * Get the default value of the parameter. The default value is that which
 * would be injected according to the CDI type safe resolution rules.
 * 
 * @param creationalContext the creationalContext to use to obtain the
 *           injectable reference.
 * @return the default value
 */
public Object getDefaultValue(CreationalContext<?> creationalContext)
{
  return beanManager.getInjectableReference(injectionPoint, creationalContext);
}
origin: org.infinispan/infinispan-cdi

/**
 * Get the default value of the parameter. The default value is that which
 * would be injected according to the CDI type safe resolution rules.
 *
 * @param creationalContext the creationalContext to use to obtain the
 *                          injectable reference.
 * @return the default value
 */
public Object getDefaultValue(CreationalContext<?> creationalContext) {
  return beanManager.getInjectableReference(injectionPoint, creationalContext);
}
origin: apache/deltaspike

/**
 * Get the default value of the parameter. The default value is that which
 * would be injected according to the CDI type safe resolution rules.
 *
 * @param creationalContext the creationalContext to use to obtain the
 *                          injectable reference.
 * @return the default value
 */
public Object getDefaultValue(CreationalContext<?> creationalContext)
{
  return beanManager.getInjectableReference(injectionPoint, creationalContext);
}
origin: org.glassfish.soteria/javax.security.enterprise

@Override
public T create(CreationalContext<T> creationalContext) {
  return create.apply(creationalContext, beanManager.getInjectableReference(decoratorInjectionPoint, creationalContext));
}

origin: eclipse-ee4j/mojarra

/** 
 * Returns the current injection point.
 */
public static InjectionPoint getCurrentInjectionPoint(BeanManager beanManager, CreationalContext<?> creationalContext) {
  Bean<? extends Object> bean = beanManager.resolve(beanManager.getBeans(InjectionPoint.class));
  InjectionPoint injectionPoint = (InjectionPoint) beanManager.getReference(bean, InjectionPoint.class, creationalContext);
  if (injectionPoint == null) { // It's broken in some Weld versions. Below is a work around. 
    bean = beanManager.resolve(beanManager.getBeans(InjectionPointGenerator.class));
    injectionPoint = (InjectionPoint) beanManager.getInjectableReference(bean.getInjectionPoints().iterator().next(), creationalContext);
  }
  return injectionPoint;
}
origin: org.glassfish/jakarta.faces

/** 
 * Returns the current injection point.
 */
public static InjectionPoint getCurrentInjectionPoint(BeanManager beanManager, CreationalContext<?> creationalContext) {
  Bean<? extends Object> bean = beanManager.resolve(beanManager.getBeans(InjectionPoint.class));
  InjectionPoint injectionPoint = (InjectionPoint) beanManager.getReference(bean, InjectionPoint.class, creationalContext);
  if (injectionPoint == null) { // It's broken in some Weld versions. Below is a work around. 
    bean = beanManager.resolve(beanManager.getBeans(InjectionPointGenerator.class));
    injectionPoint = (InjectionPoint) beanManager.getInjectableReference(bean.getInjectionPoints().iterator().next(), creationalContext);
  }
  return injectionPoint;
}
origin: org.glassfish/javax.faces

/** 
 * Returns the current injection point.
 */
public static InjectionPoint getCurrentInjectionPoint(BeanManager beanManager, CreationalContext<?> creationalContext) {
  Bean<? extends Object> bean = beanManager.resolve(beanManager.getBeans(InjectionPoint.class));
  InjectionPoint injectionPoint = (InjectionPoint) beanManager.getReference(bean, InjectionPoint.class, creationalContext);
  if (injectionPoint == null) { // It's broken in some Weld versions. Below is a work around. 
    bean = beanManager.resolve(beanManager.getBeans(InjectionPointGenerator.class));
    injectionPoint = (InjectionPoint) beanManager.getInjectableReference(bean.getInjectionPoints().iterator().next(), creationalContext);
  }
  return injectionPoint;
}
origin: org.jboss.weld.se/weld-se

@Override
public Object getInjectableReference(InjectionPoint ij, CreationalContext<?> ctx) {
  return delegate().getInjectableReference(ij, ctx);
}
origin: org.omnifaces/omnifaces

/**
 * @see Beans#getAnnotation(Annotated, Class)
 */
public static InjectionPoint getCurrentInjectionPoint(BeanManager beanManager, CreationalContext<?> creationalContext) {
  Bean<InjectionPointGenerator> bean = resolve(beanManager, InjectionPointGenerator.class);
  return (bean != null) ? (InjectionPoint) beanManager.getInjectableReference(bean.getInjectionPoints().iterator().next(), creationalContext) : null;
}
origin: org.jboss.cdi.tck/cdi-tck-impl

public VehicleDecorator create(CreationalContext<VehicleDecorator> ctx) {
  VehicleDecorator decorator = new VehicleDecorator();
  decorator.delegate = (Vehicle) beanManager.getInjectableReference(getInjectionPoints().iterator().next(), ctx);
  return decorator;
}
origin: org.jboss.jsr299.tck/jsr299-tck-impl

public VehicleDecorator create(CreationalContext<VehicleDecorator> ctx)
{
 VehicleDecorator decorator = new VehicleDecorator();
 decorator.delegate = (Vehicle) beanManager.getInjectableReference(getInjectionPoints().iterator().next(), ctx);
 return decorator;
}
origin: omnifaces/omnifaces

/**
 * @see Beans#getAnnotation(Annotated, Class)
 */
public static InjectionPoint getCurrentInjectionPoint(BeanManager beanManager, CreationalContext<?> creationalContext) {
  Bean<InjectionPointGenerator> bean = resolve(beanManager, InjectionPointGenerator.class);
  return (bean != null) ? (InjectionPoint) beanManager.getInjectableReference(bean.getInjectionPoints().iterator().next(), creationalContext) : null;
}
origin: org.jboss.forge/forge-addon-container

  @Override
  public Object call() throws Exception
  {
   Bean<R> bean = (Bean<R>) manager.resolve(manager.getBeans(actualType,
        Annotations.getQualifiersFrom(actualType)));
   context = manager.createCreationalContext(bean);
   Object delegate = manager.getInjectableReference(injectionPoint, context);
   return Proxies.enhance(loader, delegate, new ClassLoaderInterceptor(loader, delegate));
  }
};
origin: org.jboss.cdi.tck/cdi-tck-impl

private void testAvailableMethodsInADV(BeanManager beanManager) {
  beanManager.getReference(new FooBean(), Foo.class, beanManager.createCreationalContext(null));
  beanManager.getInjectableReference(
      beanManager.createInjectionPoint(beanManager.createAnnotatedType(Foo.class).getFields().iterator().next()),
      beanManager.createCreationalContext(null));
}
origin: org.jboss.cdi.tck/cdi-tck-impl

  void execute() {
    beanManager.getInjectableReference(
        beanManager.createInjectionPoint(beanManager.createAnnotatedType(Foo.class).getFields().iterator().next()),
        creationalContext);
  }
}.run();
origin: io.silverware/cdi-microservice-provider

@Override
public Object create(final CreationalContext creationalContext) {
 InjectionPoint injectionPoint = (InjectionPoint) beanManager.getInjectableReference(new MetadataInjectionPoint(this), creationalContext);
 return MicroserviceProxyFactory.createProxy(this, injectionPoint);
}
origin: org.apache.camel/camel-test-cdi

  @Override
  public void evaluate() throws Throwable {
    BeanManager manager = context.getBeanManager();
    Type[] types = method.getMethod().getGenericParameterTypes();
    Object[] parameters = new Object[types.length];
    for (int i = 0; i < types.length; i++) {
      // TODO: use a proper CreationalContext...
      parameters[i] = manager.getInjectableReference(new FrameworkMethodInjectionPoint(method.getMethod(), i, manager), manager.createCreationalContext(null));
    }

    method.invokeExplosively(test, parameters);
  }
}
origin: org.jboss.cdi.tck/cdi-tck-impl

  @SuppressWarnings("unchecked")
  @Test(expectedExceptions = AmbiguousResolutionException.class)
  @SpecAssertions({ @SpecAssertion(section = BM_OBTAIN_INJECTABLE_REFERENCE, id = "bc") })
  public void testUnsatisfiedReference() {
    Bean<SimpleBean> bean = this.getBeans(SimpleBean.class).iterator().next();
    AmbiguousInjectionPoint injectionPoint = new AmbiguousInjectionPoint(bean);
    CreationalContext<SimpleBean> creationalContext = getCurrentManager().createCreationalContext(
        (Bean<SimpleBean>) injectionPoint.getBean());
    getCurrentManager().getInjectableReference(injectionPoint, creationalContext);
  }
}
origin: org.jboss.cdi.tck/cdi-tck-impl

  @SuppressWarnings("unchecked")
  @Test(expectedExceptions = UnsatisfiedResolutionException.class)
  @SpecAssertions({ @SpecAssertion(section = BM_OBTAIN_INJECTABLE_REFERENCE, id = "bb") })
  public void testUnsatisfiedReference() {
    Bean<SimpleBean> bean = this.getBeans(SimpleBean.class).iterator().next();
    UnsatisfiedInjectionPoint injectionPoint = new UnsatisfiedInjectionPoint(bean);
    CreationalContext<SimpleBean> creationalContext = getCurrentManager().createCreationalContext(
        (Bean<SimpleBean>) injectionPoint.getBean());
    getCurrentManager().getInjectableReference(injectionPoint, creationalContext);
  }
}
javax.enterprise.inject.spiBeanManagergetInjectableReference

Javadoc

Obtains an injectable reference for a certain InjectionPoint.

Popular methods of BeanManager

  • createCreationalContext
    Obtain an instance of a javax.enterprise.context.spi.CreationalContext for the given javax.enterpris
  • getBeans
    Return the set of beans which have the given required type and qualifiers and are available for inje
  • getReference
    Obtains a contextual reference for a certain Bean and a certain bean type of the bean.
  • resolve
    Apply the ambiguous dependency resolution rules to a set of Bean. Note that when called during invoc
  • createAnnotatedType
    Obtain an AnnotatedType that may be used to read the annotations of the given class or interface.
  • createInjectionTarget
    Obtains an InjectionTarget for the given AnnotatedType. The container ignores the annotations and t
  • fireEvent
    Fire an event and notify observers. This method is deprecated from CDI 2.0 and #getEvent()) should b
  • getContext
    Obtains an active javax.enterprise.context.spi.Context for the given javax.enterprise.context .
  • isNormalScope
    Test the given annotation type to determine if it is a javax.enterprise.context.
  • isQualifier
    Test the given annotation type to determine if it is a javax.inject.Qualifier.
  • isStereotype
    Test the given annotation type to determine if it is a javax.enterprise.inject.Stereotype.
  • getELResolver
    Returns a javax.el.ELResolver that resolves beans by EL name.
  • isStereotype,
  • getELResolver,
  • isScope,
  • getPassivationCapableBean,
  • getInjectionTargetFactory,
  • getStereotypeDefinition,
  • wrapExpressionFactory,
  • getExtension,
  • isInterceptorBinding

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • getSharedPreferences (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Kernel (java.awt.image)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • IsNull (org.hamcrest.core)
    Is the value null?
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now