javax.enterprise.inject.Any类的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(148)

本文整理了Java中javax.enterprise.inject.Any类的一些代码示例,展示了Any类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Any类的具体详情如下:
包路径:javax.enterprise.inject.Any
类名称:Any

Any介绍

暂无

代码示例

代码示例来源:origin: 4thline/cling

@ApplicationScoped
static class RegistryListenerAdapter implements RegistryListener {
  @Inject
  @Any
  Event<RemoteDeviceDiscovery> remoteDeviceDiscoveryEvent;
  @Inject
  @Any
  Event<FailedRemoteDeviceDiscovery> failedRemoteDeviceDiscoveryEvent;
  @Inject
  @Any
  Event<LocalDeviceDiscovery> localDeviceDiscoveryEvent;
  @Inject
  @Any
  Event<RegistryShutdown> registryShutdownEvent;

代码示例来源:origin: javaee-samples/javaee7-samples

/**
 * @author Arun Gupta
 */
@Decorator
public class MyDecorator implements Greeting {

  @Inject
  @Delegate
  @Any
  Greeting greeting;

  @Override
  public String greet(String name) {
    return greeting.greet(name + " very much!");
  }

}

代码示例来源:origin: org.wildfly.swarm/ejb-remote

@Post
@ApplicationScoped
public class RemoteNamingCustomizer implements Customizer {
  @Inject
  @Any
  Instance<NamingFraction> namingInstance;

  @Override
  public void customize() {
    if (!namingInstance.isUnsatisfied()) {
      namingInstance.get().remoteNamingService();
    }
  }
}

代码示例来源:origin: org.jboss.jsr299.tck/jsr299-tck-impl

public void observer(@Observes @Any AnEventType event)
  {
   wasNotified = true;
  }
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-workbench-backend

@Produces
@ApplicationScoped
public IndexersFactory getIndexersFactory(@Any Instance<Indexer> indexers) {
  IndexersFactory factory = new IndexersFactory();
  getIndexers(indexers).forEach(factory::addIndexer);
  return factory;
}

代码示例来源:origin: jersey/jersey

/**
 * Decorator wraps the hello resource by stars.
 *
 * @author Petr Bouda
 */
@Decorator
public class HelloStarDecorator implements Hello {

  @Inject
  @Delegate
  @Any
  Hello account;

  @Override
  public String hello() {
    return "***" + account.hello() + "***";
  }
}

代码示例来源:origin: org.wildfly.swarm/ejb-remote

@Post
@ApplicationScoped
public class RemoteMessagingCustomizer implements Customizer {
  @Inject
  @Any
  Instance<MessagingFraction> messagingInstance;

  @Override
  public void customize() {
    if (!messagingInstance.isUnsatisfied()) {
      messagingInstance.get().defaultServer(EnhancedServer::enableRemote);
    }
  }
}

代码示例来源:origin: org.jboss.jsr299.tck/jsr299-tck-impl

public void observe(@Observes @Any String event)
  {
  }
}

代码示例来源:origin: kingthy/TVRemoteIME

@ApplicationScoped
static class RegistryListenerAdapter implements RegistryListener {
  @Inject
  @Any
  Event<RemoteDeviceDiscovery> remoteDeviceDiscoveryEvent;
  @Inject
  @Any
  Event<FailedRemoteDeviceDiscovery> failedRemoteDeviceDiscoveryEvent;
  @Inject
  @Any
  Event<LocalDeviceDiscovery> localDeviceDiscoveryEvent;
  @Inject
  @Any
  Event<RegistryShutdown> registryShutdownEvent;

代码示例来源:origin: caelum/vraptor4

@Inject
public XStreamConverters(@Any Instance<Converter> converters, @Any Instance<SingleValueConverter> singleValueConverters) {
  this.converters = converters;
  this.singleValueConverters = singleValueConverters;
}

代码示例来源:origin: org.wildfly.swarm/logging

/**
 * @author Bob McWhirter
 */
@Post
@ApplicationScoped
public class EarlyLoggingCustomizer implements Customizer {

  @Inject
  @Any
  private LoggingFraction fraction;

  @Override
  public void customize() {
    for (Logger logger : fraction.subresources().loggers()) {
      java.util.logging.Logger l = LogManager.getLogManager().getLogger(logger.getKey());
      l.setLevel(java.util.logging.Level.parse(logger.level().toString()));
    }

  }
}

代码示例来源:origin: org.jboss.jsr299.tck/jsr299-tck-impl

public void observeAny(@Observes @Any String event)
{
 numTimesAnyBindingTypeEventObserved++;
}

代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl

/**
 *
 * @author <a href="mailto:manovotn@redhat.com">Matej Novotny</a>
 */
@ApplicationScoped
public class Warehouse {

  @Inject
  @Any
  Box box;

  public void pokeBox() {
    box.breaks();
  }
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common

@Inject
public ClientProfileManager(final DefinitionUtils definitionUtils,
              final @Any ManagedInstance<Profile> profileInstances) {
  this.definitionUtils = definitionUtils;
  this.profileInstances = profileInstances;
}

代码示例来源:origin: org.teiid/thorntail-odata-api

@Post
@ApplicationScoped
public class ODataWarDeploymentProducer {
  @Inject
  @Any
  ODataFraction fraction;

  @Produces
  public Archive odataWar() throws Exception {
    WARArchive war = ShrinkWrap.create(WARArchive.class, "odata.war")
        .setContextRoot(this.fraction.getContext())
        .setWebXML(this.getClass().getResource("/web.xml"));
    war.addModule("org.jboss.teiid.olingo");

    if (this.fraction.isSecure()) {
      war.as(Secured.class).protect().withRole(fraction.getRole());
    }
    return war;
  }
}

代码示例来源:origin: org.jboss.jsr299.tck/jsr299-tck-impl

public void securityEventOccurred(@Observes @Any SecurityEvent event)
{
 numSecurityEvents++;
}

代码示例来源:origin: org.kie.uberfire/kie-uberfire-social-activities-backend

@ApplicationScoped
public class SocialAdapterRepository implements SocialAdapterRepositoryAPI {

  private Map<Class, SocialAdapter> socialAdapters = new HashMap<Class, SocialAdapter>();

  @Inject
  @Any
  private Instance<SocialAdapter<?>> services;

  @PostConstruct
  public void setup() {
    for ( SocialAdapter bean : services ) {
      socialAdapters.put( bean.eventToIntercept(), bean );
    }
  }

  @Override
  public Map<Class, SocialAdapter> getSocialAdapters() {
    return socialAdapters;
  }
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common

@Inject
public StunnerPreferencesRegistries(final DefinitionUtils definitionUtils,
                  final @Any ManagedInstance<StunnerPreferencesRegistry> preferencesRegistries) {
  this.definitionUtils = definitionUtils;
  this.preferencesRegistries = preferencesRegistries;
}

代码示例来源:origin: org.wildfly.swarm/logging

/**
 * @author Bob McWhirter
 */
@Post
@ApplicationScoped
public class LoggingCustomizer implements Customizer {

  @Inject
  @Any
  private LoggingFraction fraction;

  @Override
  public void customize() {
    LevelNode root = InitialLoggerManager.INSTANCE.getRoot();
    apply(root);
  }

  private void apply(LevelNode node) {
    if (!node.getName().equals("")) {
      this.fraction.logger(node.getName(), (l) -> {
        l.level(Level.valueOf(node.getLevel().toString()));
      });
    }
    for (LevelNode each : node.getChildren()) {
      apply(each);
    }
  }
}

代码示例来源:origin: org.jboss.jsr299.tck/jsr299-tck-impl

public void breakInOccurred(@Observes @Any BreakInEvent event)
{
 numBreakIns++;
}

相关文章