Package org.apache.cayenne
Interface DataChannel
- All Known Subinterfaces:
- ObjectContext
- All Known Implementing Classes:
- BaseContext,- ClientChannel,- ClientServerChannel,- DataContext,- DataDomain
public interface DataChannel
DataChannel is an abstraction used by ObjectContexts to obtain mapping metadata and
 access a persistent store. There is rarely a need to use it directly.
- Since:
- 1.2
- 
Field SummaryFields Modifier and Type Field Description static intFLUSH_CASCADE_SYNCA synchronization type that results in changes from an ObjectContext to be recorded in the parent DataChannel.static intFLUSH_NOCASCADE_SYNCA synchronization type that results in changes from an ObjectContext to be recorded in the parent DataChannel.static EventSubjectGRAPH_CHANGED_SUBJECTstatic EventSubjectGRAPH_FLUSHED_SUBJECTstatic EventSubjectGRAPH_ROLLEDBACK_SUBJECTstatic intROLLBACK_CASCADE_SYNCA synchronization type that results in cascading rollback of changes through the DataChannel stack.
- 
Method SummaryModifier and Type Method Description EntityResolvergetEntityResolver()Returns an EntityResolver instance that contains runtime mapping information.EventManagergetEventManager()Returns an EventManager associated with this channel.QueryResponseonQuery(ObjectContext originatingContext, Query query)Executes a query, using provided context to register persistent objects if query returns any objects.GraphDiffonSync(ObjectContext originatingContext, GraphDiff changes, int syncType)Processes synchronization request from a child ObjectContext, returning a GraphDiff that describes changes to objects made on the receiving end as a result of synchronization.
- 
Field Details- 
FLUSH_NOCASCADE_SYNCstatic final int FLUSH_NOCASCADE_SYNCA synchronization type that results in changes from an ObjectContext to be recorded in the parent DataChannel. If the parent is itself an ObjectContext, changes are NOT propagated any further.- See Also:
- Constant Field Values
 
- 
FLUSH_CASCADE_SYNCstatic final int FLUSH_CASCADE_SYNCA synchronization type that results in changes from an ObjectContext to be recorded in the parent DataChannel. If the parent is itself an ObjectContext, it is expected to send its own sync message to its parent DataChannel to cascade synchronization all the way down the stack.- See Also:
- Constant Field Values
 
- 
ROLLBACK_CASCADE_SYNCstatic final int ROLLBACK_CASCADE_SYNCA synchronization type that results in cascading rollback of changes through the DataChannel stack.- See Also:
- Constant Field Values
 
- 
GRAPH_CHANGED_SUBJECT
- 
GRAPH_FLUSHED_SUBJECT
- 
GRAPH_ROLLEDBACK_SUBJECT
 
- 
- 
Method Details- 
getEventManagerEventManager getEventManager()Returns an EventManager associated with this channel. Channel may return null if EventManager is not available for any reason.
- 
getEntityResolverEntityResolver getEntityResolver()Returns an EntityResolver instance that contains runtime mapping information.
- 
onQueryExecutes a query, using provided context to register persistent objects if query returns any objects.- Parameters:
- originatingContext- an ObjectContext that originated the query, used to register result objects.
- Returns:
- a generic response object that encapsulates result of the execution.
 
- 
onSyncProcesses synchronization request from a child ObjectContext, returning a GraphDiff that describes changes to objects made on the receiving end as a result of synchronization.- Parameters:
- originatingContext- an ObjectContext that initiated the sync. Can be null.
- changes- diff from the context that initiated the sync.
- syncType- One of- FLUSH_NOCASCADE_SYNC,- FLUSH_CASCADE_SYNC,- ROLLBACK_CASCADE_SYNC.
 
 
-