Package org.entityfs

Examples of org.entityfs.Directory


  }

  @Override
  public JavaFileObject getJavaFileForOutput(JavaFileManager.Location loc, String className, JavaFileObject.Kind kind, FileObject sibling)
  {
    Directory dir;
    int pos = className.lastIndexOf('.');
    if (pos >= 0)
    {
      dir = Directories.putIfAbsentDirectory(m_outDir, new RelativeLocation(className.substring(0, pos).replace('.', '/')));
      className = className.substring(pos + 1);
View Full Code Here


    if (location == StandardLocation.CLASS_PATH)
    {
      RelativeLocation packageLocation = new RelativeLocation(packageName.replace('.', '/'));
      Collection<JavaFileObject> res = new ArrayList<JavaFileObject>();
      // Search the target dir
      Directory classDir = (Directory) Directories.getEntityOrNull(m_outDir, packageLocation);
      if (classDir != null)
      {
        res.addAll(getClassFilesForDirectory(m_outDir, classDir, recurse));
      }
      return res;
View Full Code Here

    for (int i = 0; i < noOfDatabases; i++)
    {
      File f = FileSupport.createTempFile();
      ReadWritableFile ff = new ReadWritableFileAdapter(f);
      File tmpDir = FileSupport.createTempDirectory();
      Directory tmpDirD = new FSRWFileSystemBuilder().setRoot(tmpDir).create().getRootDirectory();

      DatabaseBackendFactory<Integer, Long, Long> baf = new ConstantRecordSizeHeapBackendFactory<Integer, Long>(IntegerSerializer.INSTANCE, LongSerializer.INSTANCE, 0, 8192, lah);
      ShadowCopyTransactionalDatabase<Integer, Long, Long> db = new ShadowCopyTransactionalDatabase<Integer, Long, Long>(new SingleFileManager(ff, tmpDirD), baf, false, lah);
      m_dbFiles.put(System.identityHashCode(db), new File[] { f, tmpDir });
      m_databases.add(db);
View Full Code Here

    for (int i = 0; i < noOfDatabases; i++)
    {
      File f = FileSupport.createTempFile();
      ReadWritableFile ff = new ReadWritableFileAdapter(f);
      File tmpDir = FileSupport.createTempDirectory();
      Directory tmpDirD = new FSRWFileSystemBuilder().setRoot(tmpDir).create().getRootDirectory();

      DatabaseBackendFactory<String, String, Long> baf = new HeapBackendFactory<String, String>(StringSerializer.INSTANCE, StringSerializer.INSTANCE, lah);
      ShadowCopyTransactionalDatabase<String, String, Long> db = new ShadowCopyTransactionalDatabase<String, String, Long>(new SingleFileManager(ff, tmpDirD), baf, false, lah);
      m_dbFiles.put(System.identityHashCode(db), new File[] { f, tmpDir });
      m_databases.add(db);
View Full Code Here

    for (int i = 0; i < noOfDatabases; i++)
    {
      File f = FileSupport.createTempFile();
      ReadWritableFile ff = new ReadWritableFileAdapter(f);
      File tmpDir = FileSupport.createTempDirectory();
      Directory tmpDirD = new FSRWFileSystemBuilder().setRoot(tmpDir).create().getRootDirectory();

      NodeRepositoryBuilder<Integer> nrb = new FileBackedNodeRepositoryBuilder<Integer, Long>().setKeySerializer(IntegerNullSerializer.INSTANCE).setValueSerializer(LongSerializer.INSTANCE).setNodeSizeStrategy(new FixedSizeNodeSizeStrategy(m_nodeSize));
      if (m_lruCacheSize > 0)
      {
        nrb = new LruCacheNodeRepositoryBuilder<Integer, Long>().setProxiedBuilder(nrb).setMaxCacheSize(m_lruCacheSize);
View Full Code Here

      File f = FileSupport.createTempFile();
      ReadWritableFile ff = new ReadWritableFileAdapter(f);
      File indf = FileSupport.createTempFile();
      ReadWritableFile indff = new ReadWritableFileAdapter(indf);
      File tmpDir = FileSupport.createTempDirectory();
      Directory tmpDirD = new FSRWFileSystemBuilder().setRoot(tmpDir).create().getRootDirectory();

      NodeRepositoryBuilder<BigInteger> nrb = new FileBackedNodeRepositoryBuilder<BigInteger, Long>().setNodeSizeStrategy(new FixedSizeNodeSizeStrategy(m_bTreeNodeSize)).setKeySerializer(new FixedSizeBigIntegerNullSerializer(STRING_HASH_SIZE + 1)).setValueSerializer(LongSerializer.INSTANCE);
      if (m_bTreeLruNodeCacheSize > 0)
      {
        nrb = new LruCacheNodeRepositoryBuilder<BigInteger, Long>().setProxiedBuilder(nrb).setMaxCacheSize(m_bTreeLruNodeCacheSize);
View Full Code Here

  }

  private Object runExampleTest(String s, Object[] args) throws IOException
  {
    File targetD = FileSupport.createTempDirectory();
    Directory targetDir = FileSystems.getEntityForDirectory(targetD, false);
    try
    {
      return runExampleTest(s, args, targetDir);
    }
    finally
    {
      new IteratorDeleter(targetDir).delete();
      targetDir.getFileSystem().close();
      assertTrue(targetD.delete());
    }
  }
View Full Code Here

  @Test
  public void testExScTransactionalDb() throws IOException
  {
    String codePrefix = "org.entityfs.EFile f = (org.entityfs.EFile) args[0]; org.entityfs.Directory tmpDir = (org.entityfs.Directory) args[1];";
    File d = FileSupport.createTempDirectory();
    Directory root = FileSystems.getEntityForDirectory(d, false);
    try
    {
      EFile f = Directories.newFile(root, "f");
      runExampleMethodTest("pg/ex/ex_sc_transactional_db.javaa", codePrefix, "return null;", null, new Object[] { f, root }, null);
    }
View Full Code Here

  @Test
  public void testUsingTheMoneySerializer() throws IOException
  {
    File targetD = FileSupport.createTempDirectory();
    File f = File.createTempFile("tmp", "tmp", targetD);
    Directory targetDir = FileSystems.getEntityForDirectory(targetD, false);
    try
    {
      compileClass("Currency", runReplaces(Files.readTextFile(new FileReadableFile(getDocFile("pg/ex/serializer/ex_Currency.javaa"))), null), targetDir);
      compileClass("Money", runReplaces(Files.readTextFile(new FileReadableFile(getDocFile("pg/ex/serializer/ex_Money.javaa"))), null), targetDir);
      compileClass("MoneySerializer", runReplaces(Files.readTextFile(new FileReadableFile(getDocFile("pg/ex/serializer/ex_MoneySerializer.javaa"))), null), targetDir);
      List<TwoObjects<String, String>> replaces = new ArrayList<TwoObjects<String, String>>();
      replaces.add(new TwoObjects<String, String>("MoneySerializer", "MoooneySerializer"));
      replaces.add(new TwoObjects<String, String>("Money", "org.helidb.javabank.Money"));
      replaces.add(new TwoObjects<String, String>("MoooneySerializer", "org.helidb.javabank.MoneySerializer"));
      replaces.add(new TwoObjects<String, String>("Currency", "org.helidb.javabank.Currency"));
      runExampleMethodTest("pg/ex/serializer/ex_using_the_money_serializer.javaa", "java.io.File f = (java.io.File) args[0];\r\n", "db.close(); return null;", null, new Object[] { f }, replaces, targetDir);
    }
    finally
    {
      new IteratorDeleter(targetDir).delete();
      targetDir.getFileSystem().close();
      assertTrue(targetD.delete());
    }
  }
View Full Code Here

      File f = FileSupport.createTempFile();
      ReadWritableFile ff = new ReadWritableFileAdapter(f);
      File indf = FileSupport.createTempFile();
      ReadWritableFile indff = new ReadWritableFileAdapter(indf);
      File tmpDir = FileSupport.createTempDirectory();
      Directory tmpDirD = new FSRWFileSystemBuilder().setRoot(tmpDir).create().getRootDirectory();

      NodeRepositoryBuilder<Integer> nrb = new FileBackedNodeRepositoryBuilder<Integer, Long>().setNodeSizeStrategy(new FixedSizeNodeSizeStrategy(m_bTreeNodeSize)).setKeySerializer(IntegerNullSerializer.INSTANCE).setValueSerializer(LongSerializer.INSTANCE);
      if (m_bTreeLruNodeCacheSize > 0)
      {
        nrb = new LruCacheNodeRepositoryBuilder<Integer, Long>().setProxiedBuilder(nrb).setMaxCacheSize(m_bTreeLruNodeCacheSize);
View Full Code Here

TOP

Related Classes of org.entityfs.Directory

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.