org.apache.cayenne.lifecycle.changeset
Class ChangeSetFilter

java.lang.Object
  extended by org.apache.cayenne.lifecycle.changeset.ChangeSetFilter
All Implemented Interfaces:
DataChannelFilter

public class ChangeSetFilter
extends Object
implements DataChannelFilter

A DataChannelFilter that provides interested parties with a thread-local access to the current commit changeset. It will only return a non-null change set when commit within the scope of the filter onSync(ObjectContext, GraphDiff, int, DataChannelFilterChain) method. The filter is intended to be used by pre-commit and post-commit listeners.

Since:
3.1

Constructor Summary
ChangeSetFilter()
           
 
Method Summary
 void init(DataChannel channel)
           
 QueryResponse onQuery(ObjectContext originatingContext, Query query, DataChannelFilterChain filterChain)
           
 GraphDiff onSync(ObjectContext originatingContext, GraphDiff changes, int syncType, DataChannelFilterChain filterChain)
           
static ChangeSet preCommitChangeSet()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeSetFilter

public ChangeSetFilter()
Method Detail

preCommitChangeSet

public static ChangeSet preCommitChangeSet()

init

public void init(DataChannel channel)
Specified by:
init in interface DataChannelFilter

onQuery

public QueryResponse onQuery(ObjectContext originatingContext,
                             Query query,
                             DataChannelFilterChain filterChain)
Specified by:
onQuery in interface DataChannelFilter

onSync

public GraphDiff onSync(ObjectContext originatingContext,
                        GraphDiff changes,
                        int syncType,
                        DataChannelFilterChain filterChain)
Specified by:
onSync in interface DataChannelFilter


Copyright © 2001-2013 Apache Cayenne. All Rights Reserved.