@Override public void run() { logger.debug("Property changed: '{} = {}'", getName(), getValue()); checkAndFlip(); } });
public IntegerProperty(DynamicIntegerProperty sProperty, DynamicIntegerProperty next) { this(sProperty, new IntegerProperty(next)); }
public IntegerProperty(String name, DynamicIntegerProperty sProperty) { this(name, new IntegerProperty(sProperty)); }
public IntegerProperty(DynamicIntegerProperty sProperty, IntegerProperty next) { super(next); // setup next pointer sProp = sProperty; sProp.addCallback(new Runnable() { @Override public void run() { logger.debug("Property changed: '{} = {}'", getName(), getValue()); checkAndFlip(); } }); checkAndFlip(); }
@Override public void run() { logger.debug("Property changed: '{} = {}'", getName(), getValue()); checkAndFlip(); } });
@Test public void testChainingInteger() throws Exception { DynamicIntegerProperty node1 = new DynamicIntegerProperty("node1", 1); IntegerProperty node2 = new HystrixPropertiesChainedArchaiusProperty.IntegerProperty("node2", node1); HystrixPropertiesChainedArchaiusProperty.IntegerProperty node3 = new HystrixPropertiesChainedArchaiusProperty.IntegerProperty("node3", node2); assertTrue("" + node3.get(), 1 == node3.get()); ConfigurationManager.getConfigInstance().setProperty("node1", 11); assertTrue(11 == node3.get()); ConfigurationManager.getConfigInstance().setProperty("node2", 22); assertTrue(22 == node3.get()); ConfigurationManager.getConfigInstance().clearProperty("node1"); assertTrue(22 == node3.get()); ConfigurationManager.getConfigInstance().setProperty("node3", 33); assertTrue(33 == node3.get()); ConfigurationManager.getConfigInstance().clearProperty("node2"); assertTrue(33 == node3.get()); ConfigurationManager.getConfigInstance().setProperty("node2", 222); assertTrue(33 == node3.get()); ConfigurationManager.getConfigInstance().clearProperty("node3"); assertTrue(222 == node3.get()); ConfigurationManager.getConfigInstance().clearProperty("node2"); assertTrue(1 == node3.get()); ConfigurationManager.getConfigInstance().setProperty("node2", 2222); assertTrue(2222 == node3.get()); }
public IntegerProperty(String name, DynamicIntegerProperty sProperty) { this(name, new IntegerProperty(sProperty)); }
public IntegerProperty(DynamicIntegerProperty sProperty, DynamicIntegerProperty next) { this(sProperty, new IntegerProperty(next)); }
public IntegerProperty(DynamicIntegerProperty sProperty, IntegerProperty next) { super(next); // setup next pointer sProp = sProperty; sProp.addCallback(new Runnable() { @Override public void run() { logger.debug("Property changed: '{} = {}'", getName(), getValue()); checkAndFlip(); } }); checkAndFlip(); }
@Test public void testInteger() throws Exception { DynamicIntegerProperty pInt = new DynamicIntegerProperty("defaultInt", -1); HystrixPropertiesChainedArchaiusProperty.IntegerProperty fInt = new HystrixPropertiesChainedArchaiusProperty.IntegerProperty("overrideInt", pInt); assertTrue(-1 == fInt.get()); ConfigurationManager.getConfigInstance().setProperty("defaultInt", 10); assertTrue(10 == fInt.get()); ConfigurationManager.getConfigInstance().setProperty("overrideInt", 11); assertTrue(11 == fInt.get()); ConfigurationManager.getConfigInstance().clearProperty("overrideInt"); assertTrue(10 == fInt.get()); ConfigurationManager.getConfigInstance().clearProperty("defaultInt"); assertTrue(-1 == fInt.get()); }