Re: PrevaylerImpl example?

"Justin T. Sampson" <[email protected]> Wed, 23 Oct 2013 22:53:33 -0700
Newsgroups gmane.comp.java.prevayler
Message-ID <CAAshuuH6Kksgh8zk2sKka+jLztKgraeH5QeOHqP8yu868Dwi6Q@mail.gmail.com>
Totally reasonable request. I just grabbed the code from PrevaylerFactory
and simplified it down with all the default values. I haven't actually
tried compiling this, and I didn't bother keeping the import statements,
but it should get you close. Change P to whatever your prevalent system
root class is, and fill in TODO to instantiate it.

P _prevalentSystem = TODO;

Clock clock = new MachineClock();
Monitor monitor = new SimpleMonitor(System.err);
Serializer serializer = new JavaSerializer();

PrevaylerDirectory directory = new PrevaylerDirectory("PrevalenceBase");

Journal journal = new PersistentJournal(directory, 0, 0, true, "journal",
monitor);

GenericSnapshotManager<P> snapshotManager = new
GenericSnapshotManager<P>(Collections.singletonMap("snapshot", serializer),
"snapshot", prevalentSystem, directory, serializer);

TransactionPublisher publisher = new CentralPublisher(clock, journal);

Prevayler<P> prevayler = new PrevaylerImpl<P>(snapshotManager, publisher,
serializer, true);

On Wed, Oct 23, 2013 at 8:00 PM, Jon Carlson <[email protected]> wrote:

I'm a noob, trying to get a simple prevalent system going.  I'm not
> using Maven and it appears that PrevaylerFactory is only available
> there.  I tried copying it into my project, but it has a lot of
> dependencies that I don't want to chase down.
>
> Could you provide an example of creating a basic PrevaylerImpl for
> noobs just trying to take Prevayler for a spin?
>
> Thanks!
>
> - Jon
>
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
> from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
> _______________________________________________
> To unsubscribe go to the end of this page:
> http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
> _______________________________________________
> "Databases in Memoriam" -- http://www.prevayler.org
>

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk

_______________________________________________
To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
_______________________________________________
"Databases in Memoriam" -- http://www.prevayler.org