Package com.sleepycat.bind.serial

Examples of com.sleepycat.bind.serial.SerialBinding


         * Create a serial binding for Event data objects.  Serial
         * bindings can be used to store any Serializable object.
         * We can use some pre-defined binding classes to convert
         * primitives like the long key value to the a byte array.
         */
        eventBinding = new SerialBinding(catalog, Event.class);

        /*
         * Open a secondary database to allow accessing the primary
         * database a secondary key value. In this case, access events
         * by price.
View Full Code Here


    classCatalog = new StoredClassCatalog(catalogDB);

    /*
     * Create the binding
     */
    keyBinding = new SerialBinding(classCatalog, KClass);
    valueBinding = new SerialBinding(classCatalog, VClass);

  }
View Full Code Here

    classCatalog = new StoredClassCatalog(catalogDB);

    /*
     * Create the binding
     */
    keyBinding = new SerialBinding(classCatalog, KClass);
    valueBinding = new SerialBinding(classCatalog, VClass);
    entryBinding = new SerialBinding(classCatalog, Entry.class);
    pairKeyBinding = new SerialBinding(classCatalog, PairKey.class);

    SecondaryConfig mySecConfig = new SecondaryConfig();
    mySecConfig.setAllowCreate(true);
    /*
     * Duplicates are frequently required for secondary databases.
View Full Code Here

        runner = new TransactionRunner(env);

        catalog = new StoredClassCatalog(openDb(CATALOG_FILE, false));
        catalog2 = new StoredClassCatalog(openDb("catalog2.db", true));

        SerialBinding keyBinding = new SerialBinding(catalog,
                                                  String.class);
        SerialBinding valueBinding = new SerialBinding(catalog,
                                                    TestSerial.class);
        store = openDb(STORE_FILE, false);

        map = new StoredMap(store, keyBinding, valueBinding, true);
    }
View Full Code Here

        env = testEnv.open(StoredClassCatalogTest.makeTestName(testEnv));
        runner = new TransactionRunner(env);

        catalog = new StoredClassCatalog(openDb(CATALOG_FILE));

        SerialBinding keyBinding = new SerialBinding(catalog, String.class);
        SerialBinding valueBinding =
      new SerialBinding(catalog, TestSerial.class);
        store = openDb(STORE_FILE);

        map = new StoredMap(store, keyBinding, valueBinding, true);
    }
View Full Code Here

      Database catalogDb = env.openDatabase(null, CLASS_CATALOG, dbConfig);

      javaCatalog = new StoredClassCatalog(catalogDb);

      EntryBinding storedEntryKeyBinding =
            new SerialBinding(javaCatalog, Object.class);
      EntryBinding storedEntryValueBinding =
            new InternalCacheEntryBinding(new TestObjectStreamMarshaller());

      storedEntriesDb = env.openDatabase(null, STORED_ENTRIES, dbConfig);
View Full Code Here

      cacheDb = env.openDatabase(null, cacheDbName, dbConfig);
      catalogDb = env.openDatabase(null, catalogDbName, dbConfig);

      /* Use the catalog for the serial binding. */
      catalog = new StoredClassCatalog(catalogDb);
      serialBinding = new SerialBinding(catalog, null);

      /* Start with a fresh transaction map. */
      txnMap = new ConcurrentHashMap();
   }
View Full Code Here

      cacheDb = env.openDatabase(null, cacheDbName, dbConfig);
      catalogDb = env.openDatabase(null, catalogDbName, dbConfig);

      /* Use the catalog for the serial binding. */
      catalog = new StoredClassCatalog(catalogDb);
      serialBinding = new SerialBinding(catalog, null);

      /* Start with a fresh transaction map. */
      txnMap = new ConcurrentHashMap<Object, Transaction>();
   }
View Full Code Here

      cacheDb = env.openDatabase(null, cacheDbName, dbConfig);
      catalogDb = env.openDatabase(null, catalogDbName, dbConfig);

      /* Use the catalog for the serial binding. */
      catalog = new StoredClassCatalog(catalogDb);
      serialBinding = new SerialBinding(catalog, null);

      /* Start with a fresh transaction map. */
      txnMap = new ConcurrentHashMap<Object, Transaction>();
   }
View Full Code Here

        try {
            StoredClassCatalog classCatalog = bdb.getClassCatalog();
            BdbModule.BdbConfig dbConfig = PersistProcessor.HISTORY_DB_CONFIG;

            historyDb = bdb.openDatabase(dbName, dbConfig, true);
            SerialBinding sb = new SerialBinding(classCatalog, Map.class);
            StoredSortedMap historyMap = new StoredSortedMap(historyDb, new StringBinding(), sb, true);
            store = historyMap;
        } catch (DatabaseException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

TOP

Related Classes of com.sleepycat.bind.serial.SerialBinding

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.