org.apache.openjpa.writebehind
Interface WriteBehindCallback

All Superinterfaces:
Runnable
All Known Implementing Classes:
AbstractWriteBehindCallback, SimpleWriteBehindCallback

public interface WriteBehindCallback
extends Runnable

The WriteBehindCallback is responsible for flushing changes to the database when OpenJPA is used in a Write-Behind mode.


Method Summary
 void close()
          Close the WriteBehindCallback releasing resources to the JVM
 Collection<Exception> flush()
          Manually flush changes to the database.
 void initialize(Broker broker, WriteBehindCache cache)
          Initialize the WriteBehindCallback.
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

initialize

void initialize(Broker broker,
                WriteBehindCache cache)
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

Collection<Exception> flush()
Manually flush changes to the database.

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

close

void close()
Close the WriteBehindCallback releasing resources to the JVM



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