Package org.apache.derby.impl.io.vfmem

Examples of org.apache.derby.impl.io.vfmem.DataStore


    /**
     * Tests that {@code listChildren} doesn't include too many entries.
     */
    public void testListChilderen() {
        DataStore store = getStore();
        VirtualFile dir1 = new VirtualFile(PathUtilTest.abs("mydir"), store);
        VirtualFile dir2 = new VirtualFile(
                PathUtilTest.abs("mydirectory"), store);
        VirtualFile file1 = new VirtualFile(
                PathUtilTest.joinAbs("mydir", "file1.txt"), store);
View Full Code Here


    /**
     * Makes sure that the root can be created.
     */
    public void testCreateRoot() {
        DataStore store = new DataStore("testCreateRootStore");
        String path = PathUtilTest.joinAbs("these", "are", "directories");
        assertTrue(store.createAllParents(path));
        assertNotNull(store.createEntry(path, true));
        VirtualFile vf = new VirtualFile(path, store);
        assertTrue(vf.exists());
        assertTrue(vf.isDirectory());

        // Also test one Windows specific root.
        path = PathUtilTest.join("c:", "Documents and Settings", "directories");
        assertTrue(store.createAllParents(path));
        assertNotNull(store.createEntry(path, true));
        vf = new VirtualFile(path, store);
        assertTrue(vf.exists());
        assertTrue(vf.isDirectory());
    }
View Full Code Here

    /** A counter used to obtain unique data store names. */
    private static int dbStoreIndex = 0;
    /** Utility method returning a fresh data store. */
    private static synchronized DataStore getStore() {
        DataStore store = new DataStore("testVFMemDB-" + dbStoreIndex++);
        // We need the root to exist.
        assertNotNull(store.createEntry(java.io.File.separator, true));
        return store;
    }
View Full Code Here

                    dbData = null;
                }
                if (dbData == null) {
                    if (uniqueName != null) {
                        // Create a new data store.
                        this.dbData = new DataStore(canonicalName);
                        DATABASES.put(canonicalName, dbData);
                    } else {
                        // We have a database name, but no unique name.
                        // Assume that the client only wants to do some
                        // "book-keeping" operations, like getting the
View Full Code Here

    public void shutdown() {
        // If the data store has been scheduled for deletion, which happens
        // when the store detects that the service root has been deleted, then
        // delete the whole store to release the memory.
        if (dbData.scheduledForDeletion()) {
            DataStore store;
            synchronized (DATABASES) {
                store = (DataStore)DATABASES.remove(canonicalName);
                // Must clean up the dummy while holding monitor.
                if (store != null && store == dbData) {
                    dbDropCleanupInDummy(canonicalName);
View Full Code Here

                    dbData = null;
                }
                if (dbData == null) {
                    if (uniqueName != null) {
                        // Create a new data store.
                        this.dbData = new DataStore(canonicalName);
                        DATABASES.put(canonicalName, dbData);
                    } else {
                        // We have a database name, but no unique name.
                        // Assume that the client only wants to do some
                        // "book-keeping" operations, like getting the
View Full Code Here

    public void shutdown() {
        // If the data store has been scheduled for deletion, which happens
        // when the store detects that the service root has been deleted, then
        // delete the whole store to release the memory.
        if (dbData.scheduledForDeletion()) {
            DataStore store;
            synchronized (DATABASES) {
                store = (DataStore)DATABASES.remove(canonicalName);
                // Must clean up the dummy while holding monitor.
                if (store != null && store == dbData) {
                    dbDropCleanupInDummy(canonicalName);
View Full Code Here

                    dbData = null;
                }
                if (dbData == null) {
                    if (uniqueName != null) {
                        // Create a new data store.
                        this.dbData = new DataStore(canonicalName);
                        DATABASES.put(canonicalName, dbData);
                    } else {
                        // We have a database name, but no unique name.
                        // Assume that the client only wants to do some
                        // "book-keeping" operations, like getting the
View Full Code Here

    public void shutdown() {
        // If the data store has been scheduled for deletion, which happens
        // when the store detects that the service root has been deleted, then
        // delete the whole store to release the memory.
        if (dbData.scheduledForDeletion()) {
            DataStore store;
            synchronized (DATABASES) {
                store = (DataStore)DATABASES.remove(canonicalName);
                // Must clean up the dummy while holding monitor.
                if (store != null && store == dbData) {
                    dbDropCleanupInDummy(canonicalName);
View Full Code Here

TOP

Related Classes of org.apache.derby.impl.io.vfmem.DataStore

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.