Package org.hotswap.agent.watch.nio

Examples of org.hotswap.agent.watch.nio.WatcherNIO2


    @Test
    public void testGetResource() throws Exception {
        final Path directory = Files.createTempDirectory(ExtraPathResourceClassLoaderTest.class.getName());
        final File tempFile = new File(directory.toFile(), "test");
        tempFile.createNewFile();
        final Watcher watcher = new WatcherNIO2();
        watcher.run();

        WatchResourcesClassLoader classLoader = new WatchResourcesClassLoader();
        classLoader.initWatchResources(new URL[]{directory.toUri().toURL()}, watcher);

        assertNull("Not returned before modification", classLoader.getResource(tempFile.getName()));
View Full Code Here


        return Double.parseDouble(version.substring(0, pos - 1));
    }

    public Watcher getWatcher() throws IOException {
        if (JAVA_VERSION >= 1.7) {
            return new WatcherNIO2();
        } else {
            throw new UnsupportedOperationException("Watcher is implemented only for Java 1.7 (NIO2). " +
                    "JNotify implementation should be added in the future for older Java version support.");
        }
View Full Code Here

TOP

Related Classes of org.hotswap.agent.watch.nio.WatcherNIO2

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.