/** * Shutdown all executors associated with this runtime. * If force terminate is specified, it will forcefully terminate * the executors, otherwise it will simply signal that they * should terminate. * * @param forceTerminate Specify if the executors should be * forcefully terminated, or simply notified to shutdown when ready. */ public void shutdownExecutors(final boolean forceTerminate) { checkThread(); if (executors == null) { return; } for (V8Executor executor : executors.values()) { if (forceTerminate) { executor.forceTermination(); } else { executor.shutdown(); } } }
/** * Shutdown all executors associated with this runtime. * If force terminate is specified, it will forcefully terminate * the executors, otherwise it will simply signal that they * should terminate. * * @param forceTerminate Specify if the executors should be * forcefully terminated, or simply notified to shutdown when ready. */ public void shutdownExecutors(final boolean forceTerminate) { checkThread(); if (executors == null) { return; } for (V8Executor executor : executors.values()) { if (forceTerminate) { executor.forceTermination(); } else { executor.shutdown(); } } }
@Test public void testValues() { V8Map<String> map = new V8Map<String>(); V8Object v1 = new V8Object(v8); map.put(v1, "foo"); Collection<String> values = map.values(); assertEquals(1, values.size()); assertEquals("foo", values.iterator().next()); v1.close(); map.close(); }
@Test public void testAddAllWithDuplicates() { V8Map<String> map = new V8Map<String>(); V8Object v1 = new V8Object(v8); map.put(v1, "foo"); V8Map<String> newMap = new V8Map<String>(); newMap.put(v1, "bar"); v1.close(); newMap.putAll(map); map.close(); assertEquals(1, newMap.size()); assertEquals("foo", newMap.values().iterator().next()); newMap.close(); }
/** * Shutdown all executors associated with this runtime. * If force terminate is specified, it will forcefully terminate * the executors, otherwise it will simply signal that they * should terminate. * * @param forceTerminate Specify if the executors should be * forcefully terminated, or simply notified to shutdown when ready. */ public void shutdownExecutors(final boolean forceTerminate) { checkThread(); if (executors == null) { return; } for (V8Executor executor : executors.values()) { if (forceTerminate) { executor.forceTermination(); } else { executor.shutdown(); } } }
/** * Shutdown all executors associated with this runtime. * If force terminate is specified, it will forcefully terminate * the executors, otherwise it will simply signal that they * should terminate. * * @param forceTerminate Specify if the executors should be * forcefully terminated, or simply notified to shutdown when ready. */ public void shutdownExecutors(final boolean forceTerminate) { checkThread(); if (executors == null) { return; } for (V8Executor executor : executors.values()) { if (forceTerminate) { executor.forceTermination(); } else { executor.shutdown(); } } }