io.smallrye.config.inject.ConfigExtension Java Examples

The following examples show how to use io.smallrye.config.inject.ConfigExtension. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JmsTestBase.java    From smallrye-reactive-messaging with Apache License 2.0 7 votes vote down vote up
protected Weld initWithoutConnectionFactory() {
    weld = new Weld();

    // SmallRye config
    ConfigExtension extension = new ConfigExtension();
    weld.addExtension(extension);

    weld.addBeanClass(MediatorFactory.class);
    weld.addBeanClass(MediatorManager.class);
    weld.addBeanClass(InternalChannelRegistry.class);
    weld.addBeanClass(ConfiguredChannelFactory.class);
    weld.addBeanClass(ChannelProducer.class);
    weld.addBeanClass(ExecutionHolder.class);
    weld.addBeanClass(WorkerPoolRegistry.class);
    weld.addExtension(new ReactiveMessagingExtension());
    weld.addBeanClass(JmsConnector.class);
    weld.disableDiscovery();
    return weld;
}
 
Example #2
Source File: AwsSnsTestBase.java    From smallrye-reactive-messaging with Apache License 2.0 7 votes vote down vote up
static Weld baseWeld() {
    Weld weld = new Weld();
    // SmallRye config
    ConfigExtension extension = new ConfigExtension();
    weld.addExtension(extension);

    weld.addBeanClass(MediatorFactory.class);
    weld.addBeanClass(MediatorManager.class);
    weld.addBeanClass(InternalChannelRegistry.class);
    weld.addBeanClass(ConfiguredChannelFactory.class);
    weld.addBeanClass(ChannelProducer.class);
    weld.addBeanClass(ExecutionHolder.class);
    weld.addBeanClass(WorkerPoolRegistry.class);
    weld.addExtension(new ReactiveMessagingExtension());

    weld.addBeanClass(SnsConnector.class);
    weld.disableDiscovery();

    return weld;
}
 
Example #3
Source File: ArchiveProcessor.java    From smallrye-metrics with Apache License 2.0 7 votes vote down vote up
@Override
public void process(TestDeployment testDeployment, Archive<?> protocolArchive) {
    WebArchive war = (WebArchive) protocolArchive;
    war.addAsWebInfResource("WEB-INF/jboss-web.xml", "jboss-web.xml");
    String[] deps = {
            "io.smallrye:smallrye-config",
            "io.smallrye:smallrye-metrics",
            "io.smallrye:smallrye-metrics-testsuite-common",
            "org.eclipse.microprofile.metrics:microprofile-metrics-api",
            "org.jboss.weld.servlet:weld-servlet-core"
    };

    File[] dependencies = Maven.resolver().loadPomFromFile(new File("pom.xml")).resolve(deps).withTransitivity().asFile();

    war.addAsLibraries(dependencies);

    war.addClass(SmallRyeBeanArchiveHandler.class);
    war.addClass(MetricsHttpServlet.class);
    war.addClass(MetricsInitializer.class);
    war.addAsResource("io/smallrye/metrics/base-metrics.properties", "/io/smallrye/metrics/base-metrics.properties");
    war.addAsServiceProvider(BeanArchiveHandler.class, SmallRyeBeanArchiveHandler.class);
    war.addAsServiceProvider(Extension.class, ConfigExtension.class);
    war.addAsServiceProvider(ConfigProviderResolver.class, SmallRyeConfigProviderResolver.class);
}
 
Example #4
Source File: PubSubTestBase.java    From smallrye-reactive-messaging with Apache License 2.0 6 votes vote down vote up
static Weld baseWeld() {
    final Weld weld = new Weld();

    weld.addExtension(new ConfigExtension());
    weld.addBeanClass(MediatorFactory.class);
    weld.addBeanClass(MediatorManager.class);
    weld.addBeanClass(InternalChannelRegistry.class);
    weld.addBeanClass(ConfiguredChannelFactory.class);
    weld.addBeanClass(ChannelProducer.class);
    weld.addBeanClass(ExecutionHolder.class);
    weld.addBeanClass(WorkerPoolRegistry.class);
    weld.addExtension(new ReactiveMessagingExtension());

    weld.addBeanClass(PubSubManager.class);
    weld.addBeanClass(PubSubConnector.class);
    weld.disableDiscovery();

    return weld;
}
 
Example #5
Source File: KafkaTestBase.java    From smallrye-reactive-messaging with Apache License 2.0 6 votes vote down vote up
public static Weld baseWeld() {
    Weld weld = new Weld();

    // SmallRye config
    ConfigExtension extension = new ConfigExtension();
    weld.addExtension(extension);

    weld.addBeanClass(MediatorFactory.class);
    weld.addBeanClass(MediatorManager.class);
    weld.addBeanClass(InternalChannelRegistry.class);
    weld.addBeanClass(ConfiguredChannelFactory.class);
    weld.addBeanClass(ChannelProducer.class);
    weld.addBeanClass(ExecutionHolder.class);
    weld.addBeanClass(WorkerPoolRegistry.class);
    weld.addExtension(new ReactiveMessagingExtension());

    weld.addBeanClass(KafkaConnector.class);
    weld.disableDiscovery();
    return weld;
}
 
Example #6
Source File: SmallRyeConfigAuxiliaryArchiveAppender.java    From smallrye-config with Apache License 2.0 6 votes vote down vote up
@Override
public Archive<?> createAuxiliaryArchive() {
    JavaArchive configJar = ShrinkWrap
            .create(JavaArchive.class, "smallrye-config.jar")
            .addPackage(SmallRyeConfig.class.getPackage())
            .addPackage(ConfigExtension.class.getPackage())
            .addAsServiceProvider(Extension.class, ConfigExtension.class)
            .addAsServiceProvider(ConfigProviderResolver.class, SmallRyeConfigProviderResolver.class);
    return configJar;
}