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


Java ProcessInjectionTarget类代码示例

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


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

示例1: initializePropertyLoading

import javax.enterprise.inject.spi.ProcessInjectionTarget; //导入依赖的package包/类
/**
 * Prepares the injection process of properties from a property file.
 *
 * @param pit
 * 		The actual target of process injection
 * @param <T>
 * 		the generic type of the injection target
 */
public <T> void initializePropertyLoading(@Observes final ProcessInjectionTarget<T> pit) throws IOException {
	AnnotatedType<T> at = pit.getAnnotatedType();
	if (!at.isAnnotationPresent(PropertyFile.class)) {
		return;
	}
	try {
		PropertyFile propertyFile = at.getAnnotation(PropertyFile.class);
		Properties properties = loadProperties(propertyFile, pit.getAnnotatedType().getJavaClass());
		Map<Field, Object> fieldValues = assignPropertiesToFields(at.getFields(), properties);
		InjectionTarget<T> wrapped = new PropertyInjectionTarget<T>(fieldValues, pit, pit.getInjectionTarget());
		pit.setInjectionTarget(wrapped);
	} catch (Exception e) {
		pit.addDefinitionError(e);
	}
}
 
开发者ID:coders-kitchen,项目名称:CDIProperties,代码行数:24,代码来源:CDIPropertiesExtension.java

示例2: processInjectionPoint

import javax.enterprise.inject.spi.ProcessInjectionTarget; //导入依赖的package包/类
@SuppressWarnings("element-type-mismatch")
   <T> void processInjectionPoint(@Observes ProcessInjectionTarget<T> pit, BeanManager beanManager) {
	for (InjectionPoint point : pit.getInjectionTarget().getInjectionPoints()) {
           if (repositoryInterfaces.contains(point.getType())) {
               log.fine(String.format("... found InjectionPoint in Class: %s with name: %s for the repository with type: %s%n", point.getBean().getBeanClass().getName(), point.getMember().getName(), point.getType()));
               String technology = "default";
               if (point.getAnnotated().isAnnotationPresent(Technology.class)) {
                   technology = point.getAnnotated().getAnnotation(Technology.class).value();
               }
               RepositoryKey key = new RepositoryKey((Class<?>) point.getType(), technology);
               if (!repositoryBeans.containsKey(key)) {
                   log.fine(String.format("... create Bean for Repository: %s with technology: %s%n", point.getType(), technology));
                   repositoryBeans.put(key, new RepositoryBean(beanManager, key));
               }
           }
	}
}
 
开发者ID:etecture,项目名称:dynamic-repositories,代码行数:18,代码来源:RepositoryExtension.java

示例3: projectInjectionTarget

import javax.enterprise.inject.spi.ProcessInjectionTarget; //导入依赖的package包/类
private <T> void projectInjectionTarget(MybatisExtension extension, Type type) {
  ProcessInjectionTarget<T> event = mock(ProcessInjectionTarget.class);
  InjectionTarget<T> injectTarget = mock(InjectionTarget.class);
  Set<InjectionPoint> injectionPoints = new HashSet<InjectionPoint>();

  InjectionPoint injectionPoint = mock(InjectionPoint.class);
  Annotated annotated = mock(Annotated.class);

  when(injectionPoint.getAnnotated()).thenReturn(annotated);

  when(annotated.getBaseType()).thenReturn(type);
  when(annotated.getAnnotations()).thenReturn(new HashSet<Annotation>());

  injectionPoints.add(injectionPoint);

  when(event.getInjectionTarget()).thenReturn(injectTarget);
  when(injectTarget.getInjectionPoints()).thenReturn(injectionPoints);

  extension.processInjectionTarget(event);
}
 
开发者ID:mybatis,项目名称:cdi,代码行数:21,代码来源:MybatisExtensionTest.java

示例4: processInjectionTarget

import javax.enterprise.inject.spi.ProcessInjectionTarget; //导入依赖的package包/类
@SuppressWarnings("unused")
<T> void processInjectionTarget(@Observes ProcessInjectionTarget<T> pit, BeanManager beanManager) throws Exception {
    try (AutoCloseable handle = Performance.accumulate("ConfigurationExtension.processInjectionTarget")) {
        if (isApplicable(pit.getAnnotatedType())) {
            pit.setInjectionTarget(new ConfigurableInjectionTarget<T>(pit.getInjectionTarget(), this.configurableManager));
        }
    }
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:9,代码来源:ConfigurableExtension.java

示例5: processInjectionTarget

import javax.enterprise.inject.spi.ProcessInjectionTarget; //导入依赖的package包/类
/**
 * Observer to a CDI lifecycle event to correctly setup the XML backed "injection".
 * @param pit CDI lifecycle callback payload
 * @param <X> Type of the Injection to observe
 */
<X extends Creature> void processInjectionTarget(@Observes ProcessInjectionTarget<X> pit) {
    Class<? extends Creature> klass = pit.getAnnotatedType().getJavaClass();
    log.info("Setting up injection target for " + klass);
    final Element entry = (Element) document.getElementsByTagName(klass.getSimpleName().toLowerCase()).item(0);
    pit.setInjectionTarget(new XmlBackedWrappedInjectionTarget<X>(pit.getInjectionTarget(), entry));
}
 
开发者ID:red-fox-mulder,项目名称:eap-6.1-quickstarts,代码行数:12,代码来源:CreatureExtension.java

示例6: processInjectionPoint

import javax.enterprise.inject.spi.ProcessInjectionTarget; //导入依赖的package包/类
<T> void processInjectionPoint(@Observes ProcessInjectionTarget<T> pit) {
	for (InjectionPoint point : pit.getInjectionTarget().getInjectionPoints()) {
           if (messageBundleInterfaces.containsKey(point.getType())) {
               System.out.printf("... found InjectionPoint for MessageBundle: %s of type %s%n", point.getMember().getName(), point.getType());
		}
	}
}
 
开发者ID:etecture,项目名称:dynamic-messages,代码行数:8,代码来源:MessagesExtension.java

示例7: processInjectionTarget

import javax.enterprise.inject.spi.ProcessInjectionTarget; //导入依赖的package包/类
/**
 * Collect all targets to match Mappers and Session providers dependency.
 *
 * @param <X> the generic type
 * @param event the event
 */
protected <X> void processInjectionTarget(@Observes ProcessInjectionTarget<X> event) {
  final InjectionTarget<X> it = event.getInjectionTarget();
  for (final InjectionPoint ip : it.getInjectionPoints()) {
    injectionPoints.add(ip);
  }
}
 
开发者ID:mybatis,项目名称:cdi,代码行数:13,代码来源:MybatisExtension.java

示例8: processInjectionTarget

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

示例9: camelContextBeans

import javax.enterprise.inject.spi.ProcessInjectionTarget; //导入依赖的package包/类
private <T extends CamelContext> void camelContextBeans(@Observes ProcessInjectionTarget<T> pit, BeanManager manager) {
    pit.setInjectionTarget(environment.camelContextInjectionTarget(pit.getInjectionTarget(), pit.getAnnotatedType(), manager, this));
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:CdiCamelExtension.java

示例10: camelBeansPostProcessor

import javax.enterprise.inject.spi.ProcessInjectionTarget; //导入依赖的package包/类
private <T> void camelBeansPostProcessor(@Observes ProcessInjectionTarget<T> pit, BeanManager manager) {
    if (camelBeans.contains(pit.getAnnotatedType())) {
        pit.setInjectionTarget(new CamelBeanInjectionTarget<>(pit.getInjectionTarget(), manager));
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:6,代码来源:CdiCamelExtension.java

示例11: camelContextAware

import javax.enterprise.inject.spi.ProcessInjectionTarget; //导入依赖的package包/类
private <T extends CamelContextAware> void camelContextAware(@Observes ProcessInjectionTarget<T> pit, BeanManager manager) {
    pit.setInjectionTarget(new CamelBeanInjectionTarget<>(pit.getInjectionTarget(), manager));
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:CdiCamelExtension.java

示例12: logLifecycleEvent

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

示例13: camelContextBeans

import javax.enterprise.inject.spi.ProcessInjectionTarget; //导入依赖的package包/类
private <T extends CamelContext> void camelContextBeans(@Observes ProcessInjectionTarget<T> pit, BeanManager manager) {
    pit.setInjectionTarget(environment.camelContextInjectionTarget(pit.getInjectionTarget(), pit.getAnnotatedType(), manager));
}
 
开发者ID:astefanutti,项目名称:camel-cdi,代码行数:4,代码来源:CdiCamelExtension.java

示例14: camelBeansPostProcessor

import javax.enterprise.inject.spi.ProcessInjectionTarget; //导入依赖的package包/类
private <T> void camelBeansPostProcessor(@Observes ProcessInjectionTarget<T> pit, BeanManager manager) {
    if (camelBeans.contains(pit.getAnnotatedType()))
        pit.setInjectionTarget(new CamelBeanInjectionTarget<>(pit.getInjectionTarget(), manager));
}
 
开发者ID:astefanutti,项目名称:camel-cdi,代码行数:5,代码来源:CdiCamelExtension.java

示例15: processInjectorTarger

import javax.enterprise.inject.spi.ProcessInjectionTarget; //导入依赖的package包/类
/**
 * Handle all injections
 * 
 * @param pit ProcessInjectionTarget to inspect.
 **/
@SuppressWarnings({ "unchecked", "rawtypes" })
public void processInjectorTarger(@Observes ProcessInjectionTarget<Object> pit) {
     pit.setInjectionTarget(new RegisterWebSocketEventListenerInjectionTarget(pit.getInjectionTarget(), listenerCandidates, servletConfigs));         
   
}
 
开发者ID:wigforss,项目名称:Ka-Websocket,代码行数:11,代码来源:WebSocketEventExtension.java


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