Package org.prevayler

Examples of org.prevayler.PrevaylerFactory


       
        if (this.prevalentSystem == null) {
            throw new BeanInstantiationException(this.getClass(), "No prevalent system found!");
        }
       
        PrevaylerFactory factory = new PrevaylerFactory();
        factory.configureClock(this.clock);
        factory.configurePrevalenceBase(this.prevalenceBase);
        factory.configurePrevalentSystem(this.prevalentSystem);
        factory.configureSnapshotManager(this.snapshotManager);
        factory.configureTransactionFiltering(this.transactionFiltering);
        factory.configureTransactionLogFileAgeThreshold(this.transactionLogAgeThreshold);
        factory.configureTransactionLogFileSizeThreshold(this.transactionLogSizeThreshold);
        factory.configureTransientMode(this.transientMode);
        this.prevayler = factory.create();
    }
View Full Code Here


    String rootObjectClassName = (String) ServerConfig.properties.get("RootObjectClass");
    Class rootObjectClass = Class.forName(rootObjectClassName);

    // Create an instance of the root object class and start the server
    //prevayler = PrevaylerFactory.createPrevayler(rootObjectClass.newInstance(), prevalenceBase);
    PrevaylerFactory factory = new PrevaylerFactory();
    factory.configurePrevalentSystem(rootObjectClass.newInstance());
    factory.configurePrevalenceDirectory(prevalenceBase);
    prevayler = factory.create();
    snapshotThread = new SnapshotThread(prevayler);
    snapshotThread.start();
  }
View Full Code Here

  private File prevalenceBase;

  protected void setUp() throws Exception {
    super.setUp();
    prevalenceBase = createTempDirectory();
    factory = new PrevaylerFactory();
    factory.configureTransientMode(true);
    factory.configurePrevalentSystem(new ListSystem());
    prevayler1 = createPrevayler("1");
    prevayler2 = createPrevayler("2");
  }
View Full Code Here

    recover("MyJournal", strategy);
  }

  public void testBadSuffix() {
    PrevaylerFactory factory = new PrevaylerFactory();
    try {
      factory.configureJournalSerializer("JOURNAL", new JavaSerializer());
      fail();
    } catch (IllegalArgumentException expected) {
      assertEquals("Journal filename suffix must match /[a-zA-Z0-9]*[Jj]ournal/, but 'JOURNAL' does not", expected.getMessage());
    }
  }
View Full Code Here

      assertEquals("Journal filename suffix must match /[a-zA-Z0-9]*[Jj]ournal/, but 'JOURNAL' does not", expected.getMessage());
    }
  }

  public void testTryToConfigureTwo() {
    PrevaylerFactory factory = new PrevaylerFactory();
    factory.configureJournalSerializer("journal", new JavaSerializer());
    try {
      factory.configureJournalSerializer("newjournal", new JavaSerializer());
      fail();
    } catch (IllegalStateException expected) {
    }
  }
View Full Code Here

    recover(serializer);
  }

  public void testBadSuffix() {
    PrevaylerFactory factory = new PrevaylerFactory();
    try {
      factory.configureSnapshotSerializer("SNAPSHOT", new JavaSerializer());
      fail();
    } catch (IllegalArgumentException exception) {
      assertEquals("Snapshot filename suffix must match /[a-zA-Z0-9]*[Ss]napshot/, but 'SNAPSHOT' does not", exception.getMessage());
    }
  }
View Full Code Here

    private String serverId;
  private static final Logger logger = Logger.getLogger(GDConsole.class);

    public Prevayler getPrevaylerClient() throws IOException, ClassNotFoundException {
      System.out.println("Instanciando o Cliente");
        PrevaylerFactory factory = getPrevaylerFactory();
        factory.configureReplicationClient(getServerId(), PrevaylerFactory.DEFAULT_REPLICATION_PORT);
        factory.configurePrevalenceBase(Constants.PREVAYLER_DATA_DIRETORY);
//        factory.configurePrevalenceDirectory(Constants.PREVAYLER_DATA_DIRETORY);
        return factory.create();
    }
View Full Code Here

//        factory.configurePrevalenceDirectory(Constants.PREVAYLER_DATA_DIRETORY);
        return factory.create();
    }

    public PrevaylerFactory getPrevaylerFactory() {
        PrevaylerFactory factory = new PrevaylerFactory();
        factory.configurePrevalentSystem(new PrevalentSystem());
        factory.configurePrevalenceBase(Constants.PREVAYLER_DATA_DIRETORY);
//        factory.configurePrevalenceDirectory(Constants.PREVAYLER_DATA_DIRETORY);
        return factory;
    }
View Full Code Here

         return prevaylerLocal;
    }

    public Prevayler getPrevaylerClient() throws ClassNotFoundException, IOException {
      logger.info("Instanciando o Cliente");
        PrevaylerFactory factory = getPrevaylerFactory();
        factory.configureReplicationClient(serverIp, PrevaylerFactory.DEFAULT_REPLICATION_PORT);
    return factory.create();
    }
View Full Code Here

        factory.configureReplicationClient(serverIp, PrevaylerFactory.DEFAULT_REPLICATION_PORT);
    return factory.create();
    }

    public PrevaylerFactory getPrevaylerFactory() {
        PrevaylerFactory factory = new PrevaylerFactory();
        factory.configurePrevalentSystem(new PrevalentSystem());
        factory.configurePrevalenceBase(Constants.PREVAYLER_DATA_DIRETORY);
        factory.configureTransactionFiltering(false);
        return factory;
    }
View Full Code Here

TOP

Related Classes of org.prevayler.PrevaylerFactory

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.