org.apache.openjpa.writebehind
Class SimpleWriteBehindCallback

java.lang.Object
  extended by org.apache.openjpa.writebehind.AbstractWriteBehindCallback
      extended by org.apache.openjpa.writebehind.SimpleWriteBehindCallback
All Implemented Interfaces:
Runnable, WriteBehindCallback

public class SimpleWriteBehindCallback
extends AbstractWriteBehindCallback


Constructor Summary
SimpleWriteBehindCallback()
           
 
Method Summary
 void close()
          Close the WriteBehindCallback releasing resources to the JVM
 Collection<Exception> flush()
          Manually flush changes to the database.
 int getSleepTime()
           
 void handleExceptions(Collection<Exception> exceptions)
           
 void initialize(Broker broker, WriteBehindCache cache)
          Initialize the WriteBehindCallback.
 void run()
           
 void setSleepTime(int sleepTime)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleWriteBehindCallback

public SimpleWriteBehindCallback()
Method Detail

initialize

public void initialize(Broker broker,
                       WriteBehindCache cache)
Description copied from interface: WriteBehindCallback
Initialize the WriteBehindCallback. The callback will pull changes from the provided WriteBehindCache flush them using the provided broker. The WriteBehindCallback is responsible for closing the Broker.

Parameters:
broker - A new broker instance that the writebehind callback will use to flush changes to the database.
cache - A WriteBehindCache which contains the inflight changes.

flush

public Collection<Exception> flush()
Description copied from interface: WriteBehindCallback
Manually flush changes to the database.

Returns:
A Collection of Exceptions which occurred during the flush.

run

public void run()

handleExceptions

public void handleExceptions(Collection<Exception> exceptions)

close

public void close()
Description copied from interface: WriteBehindCallback
Close the WriteBehindCallback releasing resources to the JVM


getSleepTime

public int getSleepTime()

setSleepTime

public void setSleepTime(int sleepTime)


Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.