Search in sources :

Example 1 with PolledConfigurationSource

use of com.netflix.config.PolledConfigurationSource in project ff4j by ff4j.

the class PropertyStoreArchaiusPolledSourceTest method testPollInvalid.

@Test(expected = IllegalStateException.class)
public void testPollInvalid() throws Exception {
    PolledConfigurationSource ff4jSource = new FF4jPolledConfigurationSource();
    ff4jSource.poll(true, null);
}
Also used : PolledConfigurationSource(com.netflix.config.PolledConfigurationSource) Test(org.junit.Test)

Example 2 with PolledConfigurationSource

use of com.netflix.config.PolledConfigurationSource in project ff4j by ff4j.

the class PropertyStoreAsArchaiusInputTest method initArchauisWithFF4j.

@BeforeClass
public static void initArchauisWithFF4j() throws InterruptedException {
    // Sample FF4J Store
    PropertyStore ff4jStore = new InMemoryPropertyStore("ff4j-properties.xml");
    // FF4Store as polling Source for Archiaus
    PolledConfigurationSource ff4jSource = new FF4jPolledConfigurationSource(ff4jStore);
    // Working Thread (polling from ff4j => Archaius)
    AbstractPollingScheduler scheduler = new FixedDelayPollingScheduler(0, 100, true);
    // Define configuration with polling and source
    DynamicConfiguration configuration = new DynamicConfiguration(ff4jSource, scheduler);
    // Init configuration
    ConfigurationManager.install(configuration);
    // Other initialization mechanism
    FF4jPolledConfigurationSource conf2 = new FF4jPolledConfigurationSource();
    conf2.setFf4jStore(ff4jStore);
    // Must invoke poll
    Thread.sleep(100);
}
Also used : InMemoryPropertyStore(org.ff4j.property.store.InMemoryPropertyStore) DynamicConfiguration(com.netflix.config.DynamicConfiguration) AbstractPollingScheduler(com.netflix.config.AbstractPollingScheduler) FixedDelayPollingScheduler(com.netflix.config.FixedDelayPollingScheduler) PolledConfigurationSource(com.netflix.config.PolledConfigurationSource) InMemoryPropertyStore(org.ff4j.property.store.InMemoryPropertyStore) PropertyStore(org.ff4j.property.store.PropertyStore) BeforeClass(org.junit.BeforeClass)

Example 3 with PolledConfigurationSource

use of com.netflix.config.PolledConfigurationSource in project ff4j by ff4j.

the class PropertyStoreArchaiusPolledSourceTest method initArchauis.

@BeforeClass
public static void initArchauis() throws InterruptedException {
    // Sample FF4J Store
    PropertyStore ff4jStore = new InMemoryPropertyStore("ff4j-properties.xml");
    // FF4Store as polling Source for Archiaus
    PolledConfigurationSource ff4jSource = new FF4jPolledConfigurationSource(ff4jStore);
    // Working Thread (polling from ff4j => Archaius)
    AbstractPollingScheduler scheduler = new FixedDelayPollingScheduler(0, 1000, true);
    // Define configuration with polling and source
    configuration = new DynamicConfiguration(ff4jSource, scheduler);
}
Also used : InMemoryPropertyStore(org.ff4j.property.store.InMemoryPropertyStore) DynamicConfiguration(com.netflix.config.DynamicConfiguration) AbstractPollingScheduler(com.netflix.config.AbstractPollingScheduler) FixedDelayPollingScheduler(com.netflix.config.FixedDelayPollingScheduler) PolledConfigurationSource(com.netflix.config.PolledConfigurationSource) InMemoryPropertyStore(org.ff4j.property.store.InMemoryPropertyStore) PropertyStore(org.ff4j.property.store.PropertyStore) BeforeClass(org.junit.BeforeClass)

Aggregations

PolledConfigurationSource (com.netflix.config.PolledConfigurationSource)3 AbstractPollingScheduler (com.netflix.config.AbstractPollingScheduler)2 DynamicConfiguration (com.netflix.config.DynamicConfiguration)2 FixedDelayPollingScheduler (com.netflix.config.FixedDelayPollingScheduler)2 InMemoryPropertyStore (org.ff4j.property.store.InMemoryPropertyStore)2 PropertyStore (org.ff4j.property.store.PropertyStore)2 BeforeClass (org.junit.BeforeClass)2 Test (org.junit.Test)1