当前位置: 首页>>代码示例>>Java>>正文


Java BeanProvider.getContextualReferences方法代码示例

本文整理汇总了Java中org.apache.deltaspike.core.api.provider.BeanProvider.getContextualReferences方法的典型用法代码示例。如果您正苦于以下问题:Java BeanProvider.getContextualReferences方法的具体用法?Java BeanProvider.getContextualReferences怎么用?Java BeanProvider.getContextualReferences使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.deltaspike.core.api.provider.BeanProvider的用法示例。


在下文中一共展示了BeanProvider.getContextualReferences方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readPatternsFromCode

import org.apache.deltaspike.core.api.provider.BeanProvider; //导入方法依赖的package包/类
private Map<String, String> readPatternsFromCode() {
    Map<String, String> result = new HashMap<>();

    List<ProgrammaticURLProtectionProvider> urlProtectionProviders = BeanProvider.getContextualReferences(ProgrammaticURLProtectionProvider.class, true);

    for (ProgrammaticURLProtectionProvider urlProtectionProvider : urlProtectionProviders) {
        result.putAll(urlProtectionProvider.getURLEntriesToAdd());
    }

    return result;
}
 
开发者ID:atbashEE,项目名称:atbash-octopus,代码行数:12,代码来源:SecuredURLReader.java

示例2: onSuccessfulLogin

import org.apache.deltaspike.core.api.provider.BeanProvider; //导入方法依赖的package包/类
protected void onSuccessfulLogin(AuthenticationToken token, AuthenticationInfo info, WebSubject subject) {
    List<AfterSuccessfulLoginHandler> handlers = BeanProvider.getContextualReferences(AfterSuccessfulLoginHandler.class, true);
    for (AfterSuccessfulLoginHandler handler : handlers) {
        handler.onSuccessfulLogin(token, info, subject);
    }
    rememberMeSuccessfulLogin(token, info, subject); // TODO Convert the rememberMe to AfterSuccessfulLoginHandler

}
 
开发者ID:atbashEE,项目名称:atbash-octopus,代码行数:9,代码来源:WebSecurityManager.java

示例3: startCamel

import org.apache.deltaspike.core.api.provider.BeanProvider; //导入方法依赖的package包/类
private void startCamel() {
    camelActivator = BeanProvider.getContextualReference(CamelActivator.class, false);

    // Register a route for each tool on the class path
    List<Tool> tools = BeanProvider.getContextualReferences(Tool.class, true);
    camelActivator.registerRoutes(tools);

    camelActivator.start();
}
 
开发者ID:projectomakase,项目名称:omakase,代码行数:10,代码来源:Worker.java

示例4: dbUnitSetup

import org.apache.deltaspike.core.api.provider.BeanProvider; //导入方法依赖的package包/类
protected void dbUnitSetup() {
    List<EntityManager> entityManagerList =
            BeanProvider.getContextualReferences(EntityManager.class, true, false);
    for (EntityManager entityManager : entityManagerList) {
        if (entityManager.getTransaction().isActive()) {
            em = entityManager;
            break;
        }
    }
    if (em == null) {
        throw new IllegalStateException("Entity Manager == null");
    }

    Connection conn = DbConnectionProvider.unwrap(em);
    if (conn == null) {
        throw new IllegalStateException("Connection == null");
    }
    this.connection = conn;

    try {
        databaseTester = new JdbcConnectionDatabaseTester(connection);
        databaseTester.setOperationListener(new NoOpOperationListener());
        dbUnitConnection = databaseTester.getConnection();
        dbUnitRunner = new DbUnitRunner(dbUnitConnection);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:lbitonti,项目名称:deltaspike-dbunit,代码行数:29,代码来源:DbUnitOperationsInterceptor.java

示例5: alternativeImplementationWithClassAsBaseType

import org.apache.deltaspike.core.api.provider.BeanProvider; //导入方法依赖的package包/类
@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());
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:9,代码来源:BdaAlternativeTest.java

示例6: multiBeanLookupWithDependentBean

import org.apache.deltaspike.core.api.provider.BeanProvider; //导入方法依赖的package包/类
@Test
public void multiBeanLookupWithDependentBean() throws Exception
{
    List<MultiBean> result = BeanProvider.getContextualReferences(MultiBean.class, false);

    Assert.assertNotNull(result);

    Assert.assertEquals(2, result.size());
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:10,代码来源:BeanProviderTest.java

示例7: multiBeanLookupWithoutDependentBean

import org.apache.deltaspike.core.api.provider.BeanProvider; //导入方法依赖的package包/类
@Test
public void multiBeanLookupWithoutDependentBean() throws Exception
{
    List<MultiBean> result = BeanProvider.getContextualReferences(MultiBean.class, false, false);

    Assert.assertNotNull(result);

    Assert.assertEquals(1, result.size());
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:10,代码来源:BeanProviderTest.java

示例8: init

import org.apache.deltaspike.core.api.provider.BeanProvider; //导入方法依赖的package包/类
@PostConstruct
public void init() {
    logoutURLProcessors = BeanProvider.getContextualReferences(LogoutURLProcessor.class, true);
}
 
开发者ID:atbashEE,项目名称:atbash-octopus,代码行数:5,代码来源:LogoutHandler.java

示例9: performConsistencyCheck

import org.apache.deltaspike.core.api.provider.BeanProvider; //导入方法依赖的package包/类
private Throwable performConsistencyCheck(Throwable t)
{
    Throwable result = t;

    if (t instanceof InvocationTargetException)
    {
        result = t.getCause();
    }

    List<EntityManager> entityManagerList =
            BeanProvider.getContextualReferences(EntityManager.class, true, false);

    for (Field field : this.target.getClass().getDeclaredFields())
    {
        if (EntityManager.class.isAssignableFrom(field.getType()))
        {
            field.setAccessible(true);
            try
            {
                entityManagerList.add((EntityManager) field.get(this.target));
            }
            catch (Exception e)
            {
                throw ExceptionUtils.throwAsRuntimeException(e);
            }
        }
    }

    for (EntityManager entityManager : entityManagerList)
    {
        if (entityManager.getTransaction().isActive())
        {
            if (t instanceof AssertionFailedError)
            {
                LOG.severe("assert failed within a transaction");
            }
            LOG.severe("start manual rollback");

            //force rollback - otherwise there can be side-effects in other tests or cleanup-code
            // (e.g. 'TRUNCATE SCHEMA' would fail)
            entityManager.getTransaction().rollback();

            if (result == null)
            {
                result = new IllegalStateException("open transaction found");
            }
        }
    }

    return result;
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:52,代码来源:TransactionStatementDecoratorFactory.java


注:本文中的org.apache.deltaspike.core.api.provider.BeanProvider.getContextualReferences方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。