Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.SynchronousChannel.take()


                                return pos % 80 == 0 ? '\n' : '.';
                            } else if (pos == blobLength) {
                                try {
                                    sync.put("x");
                                    // deleted
                                    sync.take();
                                } catch (InterruptedException e) {
                                    e.printStackTrace();
                                }
                                return 'x';
                            }
View Full Code Here


                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }.start();
        assertEquals("x", sync.take());
        DataStoreGarbageCollector gc = ((SessionImpl) session).createDataStoreGarbageCollector();
        gc.mark();
        gc.sweep();
        sync.put("deleted");
        assertEquals("saved", sync.take());
View Full Code Here

        assertEquals("x", sync.take());
        DataStoreGarbageCollector gc = ((SessionImpl) session).createDataStoreGarbageCollector();
        gc.mark();
        gc.sweep();
        sync.put("deleted");
        assertEquals("saved", sync.take());
        InputStream in = node.getProperty("slowBlob").getBinary().getStream();
        for (int pos = 1; pos < blobLength; pos++) {
            int expected = pos % 80 == 0 ? '\n' : '.';
            assertEquals(expected, in.read());
        }
View Full Code Here

                                return pos % 80 == 0 ? '\n' : '.';
                            } else if (pos == blobLength) {
                                try {
                                    sync.put("x");
                                    // deleted
                                    sync.take();
                                } catch (InterruptedException e) {
                                    e.printStackTrace();
                                }
                                return 'x';
                            }
View Full Code Here

                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }.start();
        assertEquals("x", sync.take());
        GarbageCollector gc = ((SessionImpl) session).createDataStoreGarbageCollector();
        gc.scan();
        gc.stopScan();
        gc.deleteUnused();
        sync.put("deleted");
View Full Code Here

        GarbageCollector gc = ((SessionImpl) session).createDataStoreGarbageCollector();
        gc.scan();
        gc.stopScan();
        gc.deleteUnused();
        sync.put("deleted");
        assertEquals("saved", sync.take());
        InputStream in = node.getProperty("slowBlob").getBinary().getStream();
        for (int pos = 1; pos < blobLength; pos++) {
            int expected = pos % 80 == 0 ? '\n' : '.';
            assertEquals(expected, in.read());
        }
View Full Code Here

                                return pos % 80 == 0 ? '\n' : '.';
                            } else if (pos == blobLength) {
                                try {
                                    sync.put("x");
                                    // deleted
                                    sync.take();
                                } catch (InterruptedException e) {
                                    e.printStackTrace();
                                }
                                return 'x';
                            }
View Full Code Here

                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }.start();
        assertEquals("x", sync.take());
        DataStoreGarbageCollector gc = ((SessionImpl) session).createDataStoreGarbageCollector();
        gc.setPersistenceManagerScan(false);
        gc.mark();
        gc.sweep();
        sync.put("deleted");
View Full Code Here

        DataStoreGarbageCollector gc = ((SessionImpl) session).createDataStoreGarbageCollector();
        gc.setPersistenceManagerScan(false);
        gc.mark();
        gc.sweep();
        sync.put("deleted");
        assertEquals("saved", sync.take());
        InputStream in = node.getProperty("slowBlob").getBinary().getStream();
        for (int pos = 1; pos < blobLength; pos++) {
            int expected = pos % 80 == 0 ? '\n' : '.';
            assertEquals(expected, in.read());
        }
View Full Code Here

                                return pos % 80 == 0 ? '\n' : '.';
                            } else if (pos == blobLength) {
                                try {
                                    sync.put("x");
                                    // deleted
                                    sync.take();
                                } catch (InterruptedException e) {
                                    e.printStackTrace();
                                }
                                return 'x';
                            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.