|
||||||||||
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)
Deprecated. since 3.1 use ClientChannel(ClientConnection, boolean, EventManager, boolean) |
|
ClientChannel(ClientConnection connection,
boolean channelEventsEnabled)
Deprecated. since 3.1 use ClientChannel(ClientConnection, boolean, EventManager, boolean) |
|
ClientChannel(ClientConnection connection,
boolean channelEventsEnabled,
EventManager eventManager)
Deprecated. since 3.1 use ClientChannel(ClientConnection, boolean, EventManager, boolean) |
|
ClientChannel(ClientConnection connection,
boolean channelEventsEnabled,
EventManager eventManager,
boolean remoteEventsOptional)
|
Method Summary | |
---|---|
ClientConnection |
getConnection()
|
EntityResolver |
getEntityResolver()
Returns EntityResolver obtained from the server. |
EventManager |
getEventManager()
Returns an EventManager associated with this channel. |
boolean |
isChannelEventsEnabled()
|
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 synchronization. |
protected java.lang.Object |
send(ClientMessage message,
java.lang.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)
ClientChannel(ClientConnection, boolean, EventManager, boolean)
public ClientChannel(ClientConnection connection, boolean channelEventsEnabled)
ClientChannel(ClientConnection, boolean, EventManager, boolean)
public ClientChannel(ClientConnection connection, boolean channelEventsEnabled, EventManager eventManager) throws CayenneRuntimeException
ClientChannel(ClientConnection, boolean, EventManager, boolean)
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 ClientConnection getConnection()
public boolean isChannelEventsEnabled()
public EventManager getEventManager()
DataChannel
getEventManager
in interface DataChannel
public QueryResponse onQuery(ObjectContext context, Query query)
DataChannel
onQuery
in interface DataChannel
context
- an ObjectContext that originated the query, used to
register result objects.
public GraphDiff onSync(ObjectContext originatingContext, GraphDiff changes, int syncType)
DataChannel
onSync
in interface DataChannel
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
.public EntityResolver getEntityResolver()
getEntityResolver
in interface DataChannel
protected boolean setupRemoteChannelListener() throws CayenneRuntimeException
CayenneRuntimeException
protected java.lang.Object send(ClientMessage message, java.lang.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 |