| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cayenne.remote.ClientChannel
public class ClientChannel
A DataChannel implementation that accesses a remote server
 via a ClientConnection.
| Field Summary | |
|---|---|
| protected  boolean | channelEventsEnabled | 
| protected  ClientConnection | connection | 
| protected  GraphDiffCompressor | diffCompressor | 
| protected  EntityResolver | entityResolver | 
| protected  EventManager | eventManager | 
| 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 | |
|---|---|
| ClientChannel(ClientConnection connection)Creates a new channel accessing remote server via provided connection. | |
| ClientChannel(ClientConnection connection,
              boolean channelEventsEnabled) | |
| ClientChannel(ClientConnection connection,
              boolean channelEventsEnabled,
              EventManager eventManager) | |
| ClientChannel(ClientConnection connection,
              boolean channelEventsEnabled,
              EventManager eventManager,
              boolean remoteEventsOptional) | |
| Method Summary | |
|---|---|
|  EntityResolver | getEntityResolver()Returns EntityResolver obtained from the server. | 
|  EventManager | getEventManager()Returns an EventManager associated with this channel. | 
|  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. | 
| protected  Object | send(ClientMessage message,
     Class<?> resultClass)Sends a message via connector, getting a result as an instance of a specific class. | 
| protected  boolean | setupRemoteChannelListener()Starts up an EventBridge to listen for remote updates. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected ClientConnection connection
protected EventManager eventManager
protected EntityResolver entityResolver
protected boolean channelEventsEnabled
protected GraphDiffCompressor diffCompressor
| Constructor Detail | 
|---|
public ClientChannel(ClientConnection connection)
public ClientChannel(ClientConnection connection,
                     boolean channelEventsEnabled)
public ClientChannel(ClientConnection connection,
                     boolean channelEventsEnabled,
                     EventManager eventManager)
              throws CayenneRuntimeException
CayenneRuntimeException
public ClientChannel(ClientConnection connection,
                     boolean channelEventsEnabled,
                     EventManager eventManager,
                     boolean remoteEventsOptional)
              throws CayenneRuntimeException
remoteEventsOptional - if true, failure to start an EventBridge will not
            result in an exception.
CayenneRuntimeException| Method Detail | 
|---|
public EventManager getEventManager()
DataChannel
getEventManager in interface DataChannel
public QueryResponse onQuery(ObjectContext context,
                             Query query)
DataChannel
onQuery in interface DataChannelcontext - an ObjectContext that originated the query, used to
            register result objects.
public GraphDiff onSync(ObjectContext originatingContext,
                        GraphDiff changes,
                        int syncType)
DataChannel
onSync in interface DataChanneloriginatingContext - 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.public EntityResolver getEntityResolver()
getEntityResolver in interface DataChannel
protected boolean setupRemoteChannelListener()
                                      throws CayenneRuntimeException
CayenneRuntimeException
protected Object send(ClientMessage message,
                      Class<?> resultClass)
CayenneRuntimeException - if an underlying connector
             exception occurred, or a result is not of expected type.| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||