Codota Logo
BeanProvider.getContextualReferences
Code IndexAdd Codota to your IDE (free)

How to use
getContextualReferences
method
in
org.apache.deltaspike.core.api.provider.BeanProvider

Best Java code snippets using org.apache.deltaspike.core.api.provider.BeanProvider.getContextualReferences (Showing top 19 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: apache/deltaspike

/**
 * Get a list of Contextual References by type, regardless of qualifiers (including dependent scoped beans).
 *
 * You can use this method to get all contextual references of a given type. A 'Contextual Reference' is a proxy
 * which will automatically resolve the correct contextual instance when you access any method.
 *
 * <p>
 * <b>Attention:</b> please see the notes on manually resolving &#064;Dependent beans in
 * {@link #getContextualReference(Class, java.lang.annotation.Annotation...)}!</p>
 * <p>
 * <b>Attention:</b> This will also return instances of beans for which an Alternative exists! The &#064;Alternative
 * resolving is only done via {@link BeanManager#resolve(java.util.Set)} which we cannot use in this case!</p>
 *
 * @param type     the type of the bean in question
 * @param optional if <code>true</code> it will return an empty list if no bean could be found or created. Otherwise
 *                 it will throw an {@code IllegalStateException}
 * @param <T>      target type
 *
 * @return the resolved list of Contextual Reference or an empty-list if optional is true
 */
public static <T> List<T> getContextualReferences(Class<T> type, boolean optional)
{
  return getContextualReferences(type, optional, true);
}
origin: be.c4j.ee.security.octopus/octopus-core

private void checkAuthorizationInfoMarkers() {
  authorizationInfoRequired = !BeanProvider.getContextualReferences(PrincipalAuthorizationInfoAvailibility.class, true).isEmpty();
}
origin: be.c4j.ee.security.octopus/octopus-core

@PostConstruct
public void init() {
  globalFilterConfigurations = BeanProvider.getContextualReferences(GlobalFilterConfiguration.class, true);
}
origin: org.apache.deltaspike.core/deltaspike-core-api

/**
 * Get a list of Contextual References by type, regardless of qualifiers (including dependent scoped beans).
 *
 * You can use this method to get all contextual references of a given type. A 'Contextual Reference' is a proxy
 * which will automatically resolve the correct contextual instance when you access any method.
 *
 * <p>
 * <b>Attention:</b> please see the notes on manually resolving &#064;Dependent beans in
 * {@link #getContextualReference(Class, java.lang.annotation.Annotation...)}!</p>
 * <p>
 * <b>Attention:</b> This will also return instances of beans for which an Alternative exists! The &#064;Alternative
 * resolving is only done via {@link BeanManager#resolve(java.util.Set)} which we cannot use in this case!</p>
 *
 * @param type     the type of the bean in question
 * @param optional if <code>true</code> it will return an empty list if no bean could be found or created. Otherwise
 *                 it will throw an {@code IllegalStateException}
 * @param <T>      target type
 *
 * @return the resolved list of Contextual Reference or an empty-list if optional is true
 */
public static <T> List<T> getContextualReferences(Class<T> type, boolean optional)
{
  return getContextualReferences(type, optional, true);
}
origin: picketlink/picketlink

/**
 * <p>Get a list of Contextual References by type independent of the qualifier
 * (including dependent scoped beans).
 *
 * You can use this method to get all contextual references of a given type.
 * A 'Contextual Reference' is a proxy which will automatically resolve
 * the correct contextual instance when you access any method.</p>
 *
 * <p><b>Attention:</b> please see the notes on manually resolving &#064;Dependent bean
 * in {@link #getContextualReference(Class, boolean, java.lang.annotation.Annotation...)}!</p>
 * <p><b>Attention:</b> This will also return instances of beans for which an Alternative
 * exists! The &#064;Alternative resolving is only done via {@link BeanManager#resolve(java.util.Set)}
 * which we cannot use in this case!</p>
 *
 * @param type the type of the bean in question
 * @param optional if <code>true</code> it will return an empty list if no bean could be found or created.
 *                 Otherwise it will throw an {@code IllegalStateException}
 * @param <T> target type
 * @return the resolved list of Contextual Reference or an empty-list if optional is true
 */
public static <T> List<T> getContextualReferences(Class<T> type, boolean optional)
{
  return getContextualReferences(type, optional, true);
}
origin: be.c4j.ee.security.octopus/octopus-core

@PostConstruct
public void init() {
  securityChecks = BeanProvider.getContextualReferences(SecurityCheck.class, true);
}
origin: be.c4j.ee.security.octopus/octopus-core

@PostConstruct
public void init() {
  defineConfigurationSources();
  List<TwoStepProvider> references = BeanProvider.getContextualReferences(TwoStepProvider.class, true);
  twoStepAuthenticationProviderFound = !references.isEmpty();
}
origin: be.c4j.ee.security.octopus/octopus-core

private void addPluginConfiguration(Ini ini) {
  List<ConfigurationPlugin> plugins = BeanProvider.getContextualReferences(ConfigurationPlugin.class, true, false);
  orderPlugins(plugins);
  for (ConfigurationPlugin plugin : plugins) {
    plugin.addConfiguration(ini);
  }
}
origin: be.c4j.ee.security.octopus/octopus-core

@Override
protected void onSuccessfulLogin(AuthenticationToken token, AuthenticationInfo info, Subject subject) {
  List<AfterSuccessfulLoginHandler> handlers = BeanProvider.getContextualReferences(AfterSuccessfulLoginHandler.class, true);
  for (AfterSuccessfulLoginHandler handler : handlers) {
    handler.onSuccessfulLogin(token, info, subject);
  }
  super.onSuccessfulLogin(token, info, subject); // TODO Convert the rememberMe to AfterSuccessfulLoginHandler
}
origin: be.c4j.ee.security.octopus/octopus-core

private void addManuallyConfiguredUrls(Ini.Section target, Ini.Section source) {
  Boolean globalAudit = Boolean.valueOf(config.getIsGlobalAuditActive());
  List<GlobalFilterConfiguration> globalFilterConfigurations = BeanProvider.getContextualReferences(GlobalFilterConfiguration.class, true);
  for (Map.Entry<String, String> entry : source.entrySet()) {
    String value = entry.getValue();
    String url = entry.getKey();
    if (!url.startsWith("/")) {
      url = '/' + url;
    }
    List<String> additionalFilters = new ArrayList<String>();
    if (globalAudit) {
      additionalFilters.add("audit");
    }
    for (GlobalFilterConfiguration globalFilterConfiguration : globalFilterConfigurations) {
      additionalFilters.addAll(globalFilterConfiguration.addFiltersTo(url));
    }
    if (!additionalFilters.isEmpty()) {
      StringBuilder filters = new StringBuilder();
      filters.append(value);
      for (String additionalFilter : additionalFilters) {
        filters.append(", ").append(additionalFilter);
      }
      value = filters.toString();
    }
    target.put(url, value);
  }
}
origin: org.apache.deltaspike.modules/deltaspike-test-control-module-impl

BeanProvider.getContextualReferences(EntityManager.class, true, false);
origin: apache/deltaspike

@Test
public void alternativeImplementationWithClassAsBaseType()
{
  List<BaseBean2> testBeans = BeanProvider.getContextualReferences(BaseBean2.class, true);
  Assert.assertEquals(1, testBeans.size());
  Assert.assertEquals(BaseBean2.class.getName(), testBeans.get(0).getClass().getName());
}
origin: be.c4j.ee.security.octopus/octopus-core

private Ini readURLPatterns() {
  Ini iniWithURLS = createIni(config.getLocationSecuredURLProperties(), false);
  //securedURLs.ini is optional since 0.9.7
  if (iniWithURLS == null) {
    iniWithURLS = new Ini();
  }
  if (iniWithURLS.getSectionProperty(APP_URL, "/**") != null) {
    LOGGER.warn("securedURLs.ini file contains /** definition and thus blocks programmatic URL definition (by system or developer)");
  }
  List<ProgrammaticURLProtectionProvider> urlProtectionProviders = BeanProvider.getContextualReferences(ProgrammaticURLProtectionProvider.class, true);
  orderURLProtectionProviders(urlProtectionProviders);
  for (ProgrammaticURLProtectionProvider urlProtectionProvider : urlProtectionProviders) {
    for (Map.Entry<String, String> entry : urlProtectionProvider.getURLEntriesToAdd().entrySet()) {
      iniWithURLS.setSectionProperty(APP_URL, entry.getKey(), entry.getValue());
    }
  }
  iniWithURLS.setSectionProperty(APP_URL, "/**", "anon");
  return iniWithURLS;
}
origin: be.c4j.ee.security.octopus/octopus-core

@Override
protected void onInit() {
  super.onInit();
  securityDataProvider = BeanProvider.getContextualReference(SecurityDataProvider.class);
  config = BeanProvider.getContextualReference(OctopusConfig.class);
  twoStepConfig = BeanProvider.getContextualReference(TwoStepConfig.class);
  codecUtil = BeanProvider.getContextualReference(CodecUtil.class);
  octopusDefinedAuthenticationInfoList = BeanProvider.getContextualReferences(OctopusDefinedAuthenticationInfo.class, false);
  octopusDefinedAuthorizationInfoList = BeanProvider.getContextualReferences(OctopusDefinedAuthorizationInfo.class, false);
  setCachingEnabled(true);
  setAuthenticationTokenClass(AuthenticationToken.class);
  setPermissionResolver(BeanProvider.getContextualReference(OctopusPermissionResolver.class));
}
origin: apache/deltaspike

@Test
public void multiBeanLookupWithDependentBean() throws Exception
{
  List<MultiBean> result = BeanProvider.getContextualReferences(MultiBean.class, false);
  Assert.assertNotNull(result);
  Assert.assertEquals(2, result.size());
}
origin: apache/deltaspike

@Test
public void multiBeanLookupWithoutDependentBean() throws Exception
{
  List<MultiBean> result = BeanProvider.getContextualReferences(MultiBean.class, false, false);
  Assert.assertNotNull(result);
  Assert.assertEquals(1, result.size());
}
origin: org.picketlink/picketlink-core-impl

List<Authenticator> references = BeanProvider.getContextualReferences(Authenticator.class, true);
origin: org.jboss.picketlink/picketlink-cdi-impl

List<Authenticator> references = BeanProvider.getContextualReferences(Authenticator.class, true);
origin: be.c4j.ee.security.octopus/octopus-core

public static AnnotationInfo getAllAnnotations(OctopusConfig config, Class<?> someClassType, Method someMethod) {
  List<AnnotationsToFind> annotationsToFindList = BeanProvider.getContextualReferences(AnnotationsToFind.class, true);
  AnnotationInfo result = new AnnotationInfo();
org.apache.deltaspike.core.api.providerBeanProvidergetContextualReferences

Javadoc

Get a list of Contextual References by type, regardless of qualifiers (including dependent scoped beans). You can use this method to get all contextual references of a given type. A 'Contextual Reference' is a proxy which will automatically resolve the correct contextual instance when you access any method.

Attention: please see the notes on manually resolving @Dependent beans in #getContextualReference(Class,java.lang.annotation.Annotation...)!

Attention: This will also return instances of beans for which an Alternative exists! The @Alternative resolving is only done via BeanManager#resolve(java.util.Set) which we cannot use in this case!

Popular methods of BeanProvider

  • getContextualReference
    Get a Contextual Reference by its EL Name. This only works for beans with the @Named annotation. At
  • getDependent
  • injectFields
    Performs dependency injection on an instance. Useful for instances which aren't managed by CDI.Atten
  • getBeanDefinitions
    Get a set of Bean definitions by type, regardless of qualifiers.
  • createDependentProvider
  • filterDefaultScopedBeans
  • getBeanManager
    Internal method to resolve the BeanManager via the BeanManagerProvider.
  • logWarningIfDependent
    Log a warning if the given bean is of @Dependent scope as we cannot properly clean up the contextual

Popular in Java

  • Finding current android device location
  • setScale (BigDecimal)
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • JOptionPane (javax.swing)
  • JTable (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
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