org.apache.cayenne.access
Class ClientServerChannel

java.lang.Object
  extended by org.apache.cayenne.access.ClientServerChannel
All Implemented Interfaces:
DataChannel

public class ClientServerChannel
extends Object
implements DataChannel

A DataChannel that provides a server-side end of the bridge between client and server objects in a Remote Object Persistence stack.

Since:
1.2
Author:
Andrus Adamchik

Field Summary
protected  boolean lifecycleCallbacksEnabled
           
protected  DataContext serverContext
           
 
Fields inherited from interface org.apache.cayenne.DataChannel
FLUSH_CASCADE_SYNC, FLUSH_NOCASCADE_SYNC, GRAPH_CHANGED_SUBJECT, GRAPH_FLUSHED_SUBJECT, GRAPH_ROLLEDBACK_SUBJECT, ROLLBACK_CASCADE_SYNC
 
Constructor Summary
ClientServerChannel(DataDomain domain)
           
ClientServerChannel(DataDomain domain, boolean lifecycleEventsEnabled)
          Deprecated. since 3.0 as DataChannel events (incorrectly called "lifecycleEvents" in 2.0) are no longer posted by ClientServerChannel.
 
Method Summary
 EntityResolver getEntityResolver()
          Returns an EntityResolver instance that contains runtime mapping information.
 EventManager getEventManager()
          Returns an EventManager associated with this channel.
 boolean isLifecycleCallbacksEnabled()
           
 boolean isLifecycleEventsEnabled()
          Deprecated. Since 3.0 - always returns false. This method was a misnomer referring to DataChannel events, not lifecycle events introduced in 3.0. Currently ClientServerChannel posts no channel events.
 QueryResponse onQuery(ObjectContext context, Query query)
          Executes a query, using provided context to register persistent objects if query returns any objects.
 GraphDiff onSync(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 syncronization.
 void setLifecycleCallbacksEnabled(boolean lifecycleCallbacksEnabled)
          Enables or disables lifecycle event callbacks for the underlying ObjectContext used by this channel.
 void setLifecycleEventsEnabled(boolean lifecycleEventsEnabled)
          Deprecated. Since 3.0 - does nothing. This method was a misnomer referring to DataChannel events, not lifecycle events introduced in 3.0. Currently ClientServerChannel posts no channel events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serverContext

protected DataContext serverContext

lifecycleCallbacksEnabled

protected boolean lifecycleCallbacksEnabled
Constructor Detail

ClientServerChannel

public ClientServerChannel(DataDomain domain)

ClientServerChannel

public ClientServerChannel(DataDomain domain,
                           boolean lifecycleEventsEnabled)
Deprecated. since 3.0 as DataChannel events (incorrectly called "lifecycleEvents" in 2.0) are no longer posted by ClientServerChannel.

Method Detail

isLifecycleEventsEnabled

public boolean isLifecycleEventsEnabled()
Deprecated. Since 3.0 - always returns false. This method was a misnomer referring to DataChannel events, not lifecycle events introduced in 3.0. Currently ClientServerChannel posts no channel events.


setLifecycleEventsEnabled

public void setLifecycleEventsEnabled(boolean lifecycleEventsEnabled)
Deprecated. Since 3.0 - does nothing. This method was a misnomer referring to DataChannel events, not lifecycle events introduced in 3.0. Currently ClientServerChannel posts no channel events.


onQuery

public QueryResponse onQuery(ObjectContext context,
                             Query query)
Description copied from interface: DataChannel
Executes a query, using provided context to register persistent objects if query returns any objects.

Specified by:
onQuery in interface DataChannel
Parameters:
context - an ObjectContext that originated the query, used to register result objects.
Returns:
a generic response object that encapsulates result of the execution.

getEntityResolver

public EntityResolver getEntityResolver()
Description copied from interface: DataChannel
Returns an EntityResolver instance that contains runtime mapping information.

Specified by:
getEntityResolver in interface DataChannel

getEventManager

public EventManager getEventManager()
Description copied from interface: DataChannel
Returns an EventManager associated with this channel. Channel may return null if EventManager is not available for any reason.

Specified by:
getEventManager in interface DataChannel

onSync

public GraphDiff onSync(ObjectContext originatingContext,
                        GraphDiff changes,
                        int syncType)
Description copied from interface: DataChannel
Processes synchronization request from a child ObjectContext, returning a GraphDiff that describes changes to objects made on the receiving end as a result of syncronization.

Specified by:
onSync in interface DataChannel
Parameters:
originatingContext - an ObjectContext that initiated the sync. Can be null.
changes - diff from the context that initiated the sync.
syncType - One of DataChannel.FLUSH_NOCASCADE_SYNC, DataChannel.FLUSH_CASCADE_SYNC, DataChannel.ROLLBACK_CASCADE_SYNC.

isLifecycleCallbacksEnabled

public boolean isLifecycleCallbacksEnabled()
Since:
3.0

setLifecycleCallbacksEnabled

public void setLifecycleCallbacksEnabled(boolean lifecycleCallbacksEnabled)
Enables or disables lifecycle event callbacks for the underlying ObjectContext used by this channel. Enabling callbacks allows server side logic to be applied to the persistent objects during select and commit operations.

Since:
3.0


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