本文整理匯總了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();
}
}
}
示例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));
}
}
示例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();
}
}
示例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());
}
}
示例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();
}
}
示例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();
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
}
示例10: vetoFurnaceProducer
import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
public void vetoFurnaceProducer(@Observes ProcessAnnotatedType<FurnaceProducer> furnaceProducer) {
furnaceProducer.veto();
}
示例11: vetoFurnaceServiceProducer
import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
public void vetoFurnaceServiceProducer(@Observes ProcessAnnotatedType<FurnaceServiceProducer> furnaceServiceProducer) {
furnaceServiceProducer.veto();
}
示例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();
}
}
示例13: vetoFurnaceProducer
import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
public void vetoFurnaceProducer(@Observes ProcessAnnotatedType<FurnaceProducer> furnaceProducer)
{
furnaceProducer.veto();
}
示例14: vetoFurnaceServiceProducer
import javax.enterprise.inject.spi.ProcessAnnotatedType; //導入方法依賴的package包/類
public void vetoFurnaceServiceProducer(@Observes ProcessAnnotatedType<FurnaceServiceProducer> furnaceServiceProducer)
{
furnaceServiceProducer.veto();
}
示例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();
}
}