net.sourceforge.domian.repository
Class PersistenceService

java.lang.Object
  extended by net.sourceforge.domian.repository.PersistenceService

public class PersistenceService
extends java.lang.Object

Service for persisting PersistentRepository instances.

Since:
0.4
Author:
Eirik Torske

Nested Class Summary
private static class PersistenceService.PersistTask
          The actual task to perform whenever this service is invoked.
 
Field Summary
private  java.util.concurrent.ScheduledFuture runnableScheduledFuture
           
private  java.util.concurrent.ScheduledExecutorService scheduler
           
 
Constructor Summary
PersistenceService(PersistentRepository repository)
          The interval between each persisting job is set to 10 minutes.
PersistenceService(PersistentRepository repository, java.util.Date persistingDate, java.lang.Integer persistingIntervalInSeconds)
           
PersistenceService(PersistentRepository repository, java.lang.Integer persistingIntervalInSeconds)
           
 
Method Summary
 java.util.concurrent.ScheduledFuture getRunnableScheduledFuture()
           
 java.util.concurrent.ScheduledExecutorService getScheduler()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scheduler

private final java.util.concurrent.ScheduledExecutorService scheduler

runnableScheduledFuture

private final java.util.concurrent.ScheduledFuture runnableScheduledFuture
Constructor Detail

PersistenceService

public PersistenceService(PersistentRepository repository)
The interval between each persisting job is set to 10 minutes.

Parameters:
repository - the repository to persist

PersistenceService

public PersistenceService(PersistentRepository repository,
                          java.lang.Integer persistingIntervalInSeconds)
Parameters:
repository - the repository to persist
persistingIntervalInSeconds - the number of seconds between each persisting job, and also initial delay before first run

PersistenceService

public PersistenceService(PersistentRepository repository,
                          java.util.Date persistingDate,
                          java.lang.Integer persistingIntervalInSeconds)
Parameters:
repository - the repository to persist
persistingDate - the absolute date for the first initial persisting job to run
persistingIntervalInSeconds - the number of seconds between each persisting job
Method Detail

getScheduler

public java.util.concurrent.ScheduledExecutorService getScheduler()

getRunnableScheduledFuture

public java.util.concurrent.ScheduledFuture getRunnableScheduledFuture()


Copyright © 2006-2010. All Rights Reserved.