當前位置: 首頁>>代碼示例>>Java>>正文


Java ProcessAnnotatedType.veto方法代碼示例

本文整理匯總了Java中javax.enterprise.inject.spi.ProcessAnnotatedType.veto方法的典型用法代碼示例。如果您正苦於以下問題:Java ProcessAnnotatedType.veto方法的具體用法?Java ProcessAnnotatedType.veto怎麽用?Java ProcessAnnotatedType.veto使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.enterprise.inject.spi.ProcessAnnotatedType的用法示例。


在下文中一共展示了ProcessAnnotatedType.veto方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: skipUnusedStepsFromBeanDiscovery

import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
@SuppressWarnings("unused")
// will be called automatically by the CDI container for all annotated types
private void skipUnusedStepsFromBeanDiscovery(@Observes ProcessAnnotatedType<?> event, BeanManager beanManager)
    throws MojoExecutionException, MojoFailureException {
  // https://github.com/shillner/maven-cdi-plugin-utils/issues/14
  Class<?> type = event.getAnnotatedType().getJavaClass();
  ProcessingStep annotation = type.getAnnotation(ProcessingStep.class);
  if (annotation != null) {
    // adding the step to the list of all available processing steps
    String id = annotation.id();
    Preconditions.checkState(!this.allAvailableProcessingSteps.containsKey(id),
        "The processing step id '" + id + "' is not unique!");
    this.allAvailableProcessingSteps.put(id, annotation);

    // vetoing the bean discovery of a step that is not part of the current workflow
    // this prevents the issue that data shall be injected that isn't produced anywhere!
    ProcessingWorkflow workflow = getWorkflow();
    if (!workflow.containsStep(annotation.id())) {
      event.veto();
    }
  }
}
 
開發者ID:shillner,項目名稱:maven-cdi-plugin-utils,代碼行數:23,代碼來源:AbstractCDIMojo.java

示例2: processAnnotatedType

import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
private void processAnnotatedType(@Observes ProcessAnnotatedType<?> pat) {
    if (pat.getAnnotatedType().isAnnotationPresent(Vetoed.class)) {
        pat.veto();
    }
    if (hasAnnotation(pat.getAnnotatedType(), Converter.class)) {
        converters.add(pat.getAnnotatedType().getJavaClass());
    }
    if (hasAnnotation(pat.getAnnotatedType(), BeanInject.class, Consume.class, EndpointInject.class, Produce.class, PropertyInject.class)) {
        camelBeans.add(pat.getAnnotatedType());
    }
    if (hasAnnotation(pat.getAnnotatedType(), Consume.class)) {
        eagerBeans.add(pat.getAnnotatedType());
    }
    if (hasAnnotation(pat.getAnnotatedType(), ImportResource.class)) {
        resources.add(pat.getAnnotatedType().getAnnotation(ImportResource.class));
    }
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:18,代碼來源:CdiCamelExtension.java

示例3: processAggregateRootAnnotatedType

import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
<X> void processAggregateRootAnnotatedType(
		@Observes final ProcessAnnotatedType<X> pat, final BeanManager beanManager) {
	AnnotatedType<X> at = pat.getAnnotatedType();
	boolean isAggregateRoot = AxonUtils.isAnnotatedAggregateRoot(at.getJavaClass());
	if (isAggregateRoot) {
		configuration.add(AggregateRootInfo.of(beanManager, at));
		pat.veto();
	}

}
 
開發者ID:kamaladafrica,項目名稱:axon-cdi,代碼行數:11,代碼來源:AxonCdiExtension.java

示例4: vetoEnties

import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
/**
 * CDI observer method, listens to the {@link ProcessAnnotatedType} event to apply a veto to all JPA entities.
 * @param pat Payload of the bootstrap event.
 */
public void vetoEnties(@Observes ProcessAnnotatedType pat) {
    // Look to see if the AnnotatedType also contains the JPA Entity annotation
    if (pat.getAnnotatedType().getAnnotation(Entity.class) != null) {
        // Veto the JPA entity to avoid developers injecting entities without allowing JPA to
        // manage the entity lifecycle.
        pat.veto();
        log.info("Vetoed class " + pat.getAnnotatedType().getJavaClass());
    }
}
 
開發者ID:red-fox-mulder,項目名稱:eap-6.1-quickstarts,代碼行數:14,代碼來源:VetoExtension.java

示例5: processStandaloneController

import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
public <T> void processStandaloneController(@WithAnnotations({StandaloneController.class}) @Observes ProcessAnnotatedType<T> event) {
    LOGGER.info("Processing standalone controller class: {}", event.getAnnotatedType().getJavaClass());
    StandaloneController a = event.getAnnotatedType().getJavaClass().getAnnotation(StandaloneController.class);
    if (a != null && ControllerUtils.useEmbeddedController()) {
        LOGGER.info("Removing standalone controller class {} from CDI context", event.getAnnotatedType().getJavaClass());
        event.veto();
    }
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:9,代碼來源:ControllerExtension.java

示例6: processEmbeddedController

import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
public <T> void processEmbeddedController(@WithAnnotations({EmbeddedController.class}) @Observes ProcessAnnotatedType<T> event) {
    LOGGER.info("Processing embedded controller class: {}", event.getAnnotatedType().getJavaClass());
    EmbeddedController a = event.getAnnotatedType().getJavaClass().getAnnotation(EmbeddedController.class);
    if (a != null && ControllerUtils.useEmbeddedController() == false) {
        LOGGER.info("Removing embedded controller class {} from CDI context", event.getAnnotatedType().getJavaClass());
        event.veto();
    }
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:9,代碼來源:ControllerExtension.java

示例7: processAnnotatedType

import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
<X> void processAnnotatedType(@Observes ProcessAnnotatedType<X> event)
{
    if (!isActivated)
    {
        return;
    }

    if (isVetoed(event.getAnnotatedType()))
    {
        event.veto();
    }
    else if (isRepository(event.getAnnotatedType()))
    {
        Class<X> repositoryClass = event.getAnnotatedType().getJavaClass();

        LOG.log(Level.FINER, "getHandlerClass: Repository annotation detected on {0}",
                event.getAnnotatedType());
        if (Deactivatable.class.isAssignableFrom(repositoryClass)
                && !ClassDeactivationUtils.isActivated((Class<? extends Deactivatable>) repositoryClass))
        {
            LOG.log(Level.FINER, "Class {0} is Deactivated", repositoryClass);
            return;
        }

        repositoryClasses.add(repositoryClass);
        REPOSITORY_CLASSES.add(repositoryClass);
    }
}
 
開發者ID:apache,項目名稱:deltaspike,代碼行數:30,代碼來源:RepositoryExtension.java

示例8: findScheduledJobs

import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
public <X> void findScheduledJobs(@Observes ProcessAnnotatedType<X> pat, BeanManager beanManager)
{
    if (!this.isActivated)
    {
        return;
    }

    Class<X> beanClass = pat.getAnnotatedType().getJavaClass();

    //see SchedulerProducer
    if (Scheduler.class.isAssignableFrom(beanClass) || isInternalUnmanagedClass(beanClass))
    {
        pat.veto();
        return;
    }

    if (!jobClass.isAssignableFrom(beanClass) && !Runnable.class.isAssignableFrom(beanClass))
    {
        return;
    }

    Scheduled scheduled = pat.getAnnotatedType().getAnnotation(Scheduled.class);
    if (scheduled != null && scheduled.onStartup())
    {
        this.foundManagedJobClasses.add(beanClass);
    }
}
 
開發者ID:apache,項目名稱:deltaspike,代碼行數:28,代碼來源:SchedulerExtension.java

示例9: vetoCustomProjectStageBeans

import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
protected void vetoCustomProjectStageBeans(ProcessAnnotatedType processAnnotatedType)
{
    //currently there is a veto for all project-stage implementations,
    //but we still need @Typed() for the provided implementations in case of the deactivation of this behaviour
    if (ProjectStage.class.isAssignableFrom(processAnnotatedType.getAnnotatedType().getJavaClass()))
    {
        processAnnotatedType.veto();
    }
}
 
開發者ID:apache,項目名稱:deltaspike,代碼行數:10,代碼來源:ExcludeExtension.java

示例10: vetoFurnaceProducer

import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
public void vetoFurnaceProducer(@Observes ProcessAnnotatedType<FurnaceProducer> furnaceProducer) {
    furnaceProducer.veto();
}
 
開發者ID:fabric8-launcher,項目名稱:launcher-backend,代碼行數:4,代碼來源:LauncherExtension.java

示例11: vetoFurnaceServiceProducer

import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
public void vetoFurnaceServiceProducer(@Observes ProcessAnnotatedType<FurnaceServiceProducer> furnaceServiceProducer) {
    furnaceServiceProducer.veto();
}
 
開發者ID:fabric8-launcher,項目名稱:launcher-backend,代碼行數:4,代碼來源:LauncherExtension.java

示例12: vetoProbeHandlers

import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
public void vetoProbeHandlers(@Observes ProcessAnnotatedType<? extends Handler<RoutingContext>> event) {
    if (event.getAnnotatedType().getJavaClass().getName().startsWith(PROBE_PACKAGE)) {
        event.veto();
    }
}
 
開發者ID:weld,項目名稱:weld-vertx,代碼行數:6,代碼來源:VertxProbeExtension.java

示例13: vetoFurnaceProducer

import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
public void vetoFurnaceProducer(@Observes ProcessAnnotatedType<FurnaceProducer> furnaceProducer)
{
   furnaceProducer.veto();
}
 
開發者ID:fabric8-launcher,項目名稱:launchpad-backend,代碼行數:5,代碼來源:LaunchpadExtension.java

示例14: vetoFurnaceServiceProducer

import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
public void vetoFurnaceServiceProducer(@Observes ProcessAnnotatedType<FurnaceServiceProducer> furnaceServiceProducer)
{
   furnaceServiceProducer.veto();
}
 
開發者ID:fabric8-launcher,項目名稱:launchpad-backend,代碼行數:5,代碼來源:LaunchpadExtension.java

示例15: interceptProcessAnnotatedTypes

import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
void interceptProcessAnnotatedTypes(@Observes ProcessAnnotatedType processAnnotatedType) {
    if ("org.apache.camel.cdi.CdiCamelContext".equals(processAnnotatedType.getAnnotatedType().getJavaClass().getName())) {
        processAnnotatedType.veto();
    }
}
 
開發者ID:projectomakase,項目名稱:omakase,代碼行數:6,代碼來源:CamelCdiVetoExtension.java


注:本文中的javax.enterprise.inject.spi.ProcessAnnotatedType.veto方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。