• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ProcessProducer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javax.enterprise.inject.spi.ProcessProducer的典型用法代码示例。如果您正苦于以下问题:Java ProcessProducer类的具体用法?Java ProcessProducer怎么用?Java ProcessProducer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ProcessProducer类属于javax.enterprise.inject.spi包,在下文中一共展示了ProcessProducer类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: processProducer

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
/**
 * Collect all SqlSessionFactory producers annotated with SessionFactoryProvider.
 *
 * @param <T> the generic type
 * @param <X> the generic type
 * @param pp the pp
 */
@SuppressWarnings("UnusedDeclaration")
protected <T, X> void processProducer(@Observes final ProcessProducer<T, X> pp) {
  final AnnotatedMember<T> am = pp.getAnnotatedMember();
  final boolean isAnnotated = am.isAnnotationPresent(SessionFactoryProvider.class);
  final boolean isSqlSessionFactory = am.getBaseType().equals(SqlSessionFactory.class);
  final Object[] logData = { am.getJavaMember().getDeclaringClass().getSimpleName(), am.getJavaMember().getName() };
  if (isAnnotated && isSqlSessionFactory) {
    LOGGER.log(Level.INFO, "MyBatis CDI Module - SqlSessionFactory producer {0}.{1}", logData);
    this.sessionProducers.add(new BeanKey((Class<Type>) (Type) SqlSession.class, am.getAnnotations()));
  } else if (isAnnotated && !isSqlSessionFactory) {
    LOGGER.log(Level.SEVERE, "MyBatis CDI Module - Invalid return type (Must be SqlSessionFactory): {0}.{1}",
        logData);
    pp.addDefinitionError(new MybatisCdiConfigurationException(String
        .format("SessionFactoryProvider producers must return SqlSessionFactory (%s.%s)", logData[0], logData[1])));
  } else if (!isAnnotated && isSqlSessionFactory) {
    LOGGER.log(Level.WARNING,
        "MyBatis CDI Module - Ignored SqlSessionFactory producer because it is not annotated with @SessionFactoryProvider: {0}.{1}",
        logData);
  }
}
 
开发者ID:mybatis,项目名称:cdi,代码行数:28,代码来源:MybatisExtension.java


示例2: processCommandBusProducer

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
<T, X extends CommandBus> void processCommandBusProducer(
		@Observes final ProcessProducer<T, X> processProducer,
		final BeanManager beanManager) {

	AnnotatedMember<T> annotatedMember = processProducer.getAnnotatedMember();

	if (annotatedMember.isAnnotationPresent(AutoConfigure.class)) {
		Producer<X> originalProducer = processProducer.getProducer();
		Producer<X> producer = new AutoConfiguringCommandBusProducer<>(originalProducer,
				annotatedMember, getAggregateRoots(), getCommandHandlers(), beanManager);
		processProducer.setProducer(producer);
	}
}
 
开发者ID:kamaladafrica,项目名称:axon-cdi,代码行数:14,代码来源:AxonCdiExtension.java


示例3: processEventStoreProducer

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
<T, X extends EventStore> void processEventStoreProducer(
		@Observes final ProcessProducer<T, X> processProducer,
		final BeanManager beanManager) {
	AnnotatedMember<T> annotatedMember = processProducer.getAnnotatedMember();
	if (annotatedMember.isAnnotationPresent(AutoConfigure.class)) {
		Producer<X> originalProducer = processProducer.getProducer();
		Producer<X> producer = new AutoConfiguringEventStoreProducer<>(originalProducer,
				annotatedMember,
				getEventHandlers(),
				getSagas(), beanManager);
		processProducer.setProducer(producer);
	}
}
 
开发者ID:kamaladafrica,项目名称:axon-cdi,代码行数:14,代码来源:AxonCdiExtension.java


示例4: processSnapshotterProducer

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
<T, X extends Snapshotter> void processSnapshotterProducer(
		@Observes final ProcessProducer<T, X> processProducer,
		final BeanManager beanManager) {
	Producer<X> originalProducer = processProducer.getProducer();
	AnnotatedMember<T> annotatedMember = processProducer.getAnnotatedMember();
	if (annotatedMember.isAnnotationPresent(AutoConfigure.class)) {
		Producer<X> producer = new AutoConfiguringAggregateSnapshotterProducer<>(originalProducer,
				annotatedMember, getAggregateRoots(), beanManager);
		processProducer.setProducer(producer);
	}
}
 
开发者ID:kamaladafrica,项目名称:axon-cdi,代码行数:12,代码来源:AxonCdiExtension.java


示例5: processSagaRepositoryProducer

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
<T, X extends SagaRepository<?>> void processSagaRepositoryProducer(
		@Observes final ProcessProducer<T, X> processProducer,
		final BeanManager beanManager) {
	Producer<X> originalProducer = processProducer.getProducer();
	AnnotatedMember<T> annotatedMember = processProducer.getAnnotatedMember();
	if (annotatedMember.isAnnotationPresent(AutoConfigure.class)) {
		Producer<X> producer = new AutoConfiguringSagaRepositoryProducer<>(originalProducer,
				annotatedMember, beanManager);
		processProducer.setProducer(producer);
	}
}
 
开发者ID:kamaladafrica,项目名称:axon-cdi,代码行数:12,代码来源:AxonCdiExtension.java


示例6: processProducer

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
<K, V> void processProducer(@Observes ProcessProducer<K, V> pp) {
	logger.info("finished the scanning process");
	processProducer++;
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:5,代码来源:ObserverExtension.java


示例7: registerProducer

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
public <T> void registerProducer(@Observes final ProcessProducer<T, EntityManager> pb) {
    pb.setProducer(new EntityManagerProducerProxy(pb.getProducer()));
}
 
开发者ID:dadrus,项目名称:jpa-unit,代码行数:4,代码来源:JpaUnitCdiExtension.java


示例8: doProcessProducers

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
void doProcessProducers(@Observes ProcessProducer pp) {
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:3,代码来源:MPJWTExtension.java


示例9: processProducer

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
@SuppressWarnings("unused")
<X, T> void processProducer(@Observes ProcessProducer<X, T> pp, BeanManager beanManager) throws Exception {
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:4,代码来源:ImplicitArchiveExtension.java


示例10: process

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
@SuppressWarnings("unused")
void process(@Observes ProcessProducer<?, T> p, BeanManager beanManager) throws Exception {
    p.setProducer(producer(p.getProducer()));
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:5,代码来源:AbstractNetworkExtension.java


示例11: camelContextProducers

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
private <T extends CamelContext> void camelContextProducers(@Observes ProcessProducer<?, T> pp, BeanManager manager) {
    pp.setProducer(environment.camelContextProducer(pp.getProducer(), pp.getAnnotatedMember(), manager, this));
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:CdiCamelExtension.java


示例12: processSystemFSProducer

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
public void processSystemFSProducer(@Observes ProcessProducer<?, FileSystem> pp) {
    if (pp.getAnnotatedMember().getJavaMember().getName().equals("systemFS")) {
        ioStrategyBeanNotFound = false;
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:6,代码来源:SystemConfigProducer.java


示例13: processIOServiceProducer

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
public void processIOServiceProducer(@Observes ProcessProducer<?, IOService> pp) {
    if (pp.getAnnotatedMember().getJavaMember().getName().equals("ioStrategy")) {
        ioStrategyBeanNotFound = false;
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:6,代码来源:SystemConfigProducer.java


示例14: wrapEntityManager

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
public void wrapEntityManager(@Observes ProcessProducer<?, EntityManager> event) {
	if (event.getAnnotatedMember().isAnnotationPresent(SpearalEnabled.class))
		event.setProducer(new EntityManagerProducerWrapper(event.getProducer()));
}
 
开发者ID:spearal,项目名称:spearal-jpa2,代码行数:5,代码来源:SpearalExtension.java


示例15: wrapEntityManagerFactory

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
public void wrapEntityManagerFactory(@Observes ProcessProducer<?, EntityManagerFactory> event, BeanManager beanManager) {
	if (event.getAnnotatedMember().isAnnotationPresent(SpearalEnabled.class))
		event.setProducer(new EntityManagerFactoryProducerWrapper(event.getProducer(), beanManager));
}
 
开发者ID:spearal,项目名称:spearal-jpa2,代码行数:5,代码来源:SpearalExtension.java


示例16: logLifecycleEvent

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
<T, X> void logLifecycleEvent(@Observes ProcessProducer<T, X> event) {
    LOGGER.info("ProcessProducer: annotatedMember=" + event.getAnnotatedMember());
}
 
开发者ID:ghajba,项目名称:Java-EE,代码行数:4,代码来源:LifeCycleLogger.java


示例17: camelContextProducers

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
private <T extends CamelContext> void camelContextProducers(@Observes ProcessProducer<?, T> pp, BeanManager manager) {
    pp.setProducer(environment.camelContextProducer(pp.getProducer(), pp.getAnnotatedMember(), manager));
}
 
开发者ID:astefanutti,项目名称:camel-cdi,代码行数:4,代码来源:CdiCamelExtension.java


示例18: onProcessProducer

import javax.enterprise.inject.spi.ProcessProducer; //导入依赖的package包/类
public <X, T> void onProcessProducer(@Observes ProcessProducer<X, T> processProducer, BeanManager beanManager)
{
    if (!isActivated)
    {
        return;
    }

    for (MockFilter mockFilter : mockFilters)
    {
        if (!mockFilter.isMockedImplementationSupported(beanManager, processProducer.getAnnotatedMember()))
        {
            return;
        }
    }

    final Producer<T> originalProducer = processProducer.getProducer();
    AnnotatedMember<X> annotatedMember = processProducer.getAnnotatedMember();
    List<Annotation> qualifiers = new ArrayList<Annotation>();
    for (Annotation annotation : annotatedMember.getAnnotations())
    {
        if (beanManager.isQualifier(annotation.annotationType()))
        {
            qualifiers.add(annotation);
        }
    }

    Typed typed = annotatedMember.getAnnotation(Typed.class);

    List<Type> foundTypes = new ArrayList<Type>();
    if (typed != null)
    {
        Collections.addAll(foundTypes, typed.value());
    }
    else if (annotatedMember.getBaseType() instanceof Class)
    {
        foundTypes.addAll(extractTypes((Class)annotatedMember.getBaseType()));
    }

    if (foundTypes.isEmpty())
    {
        return;
    }

    processProducer.setProducer(new MockAwareProducerWrapper<T>(
        beanManager, originalProducer, foundTypes, qualifiers));
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:47,代码来源:MockExtension.java



注:本文中的javax.enterprise.inject.spi.ProcessProducer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DNSTask类代码示例发布时间:2022-05-22
下一篇:
Java DefaultWebSubjectFactory类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap