Search in sources :

Example 1 with ReloadCallback

use of org.apache.activemq.artemis.core.server.reload.ReloadCallback in project activemq-artemis by apache.

the class ReloadManagerTest method internalTest.

private void internalTest(ReloadManagerImpl manager, File file) throws IOException, InterruptedException {
    file.createNewFile();
    final ReusableLatch latch = new ReusableLatch(1);
    manager.addCallback(file.toURL(), new ReloadCallback() {

        @Override
        public void reload(URL uri) {
            latch.countDown();
        }
    });
    Assert.assertFalse(latch.await(1, TimeUnit.SECONDS));
    file.setLastModified(System.currentTimeMillis());
    Assert.assertTrue(latch.await(1, TimeUnit.SECONDS));
}
Also used : ReusableLatch(org.apache.activemq.artemis.utils.ReusableLatch) ReloadCallback(org.apache.activemq.artemis.core.server.reload.ReloadCallback) URL(java.net.URL)

Aggregations

URL (java.net.URL)1 ReloadCallback (org.apache.activemq.artemis.core.server.reload.ReloadCallback)1 ReusableLatch (org.apache.activemq.artemis.utils.ReusableLatch)1