|
|||||||||
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 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)
|
Method Summary | |
---|---|
EntityResolver |
getEntityResolver()
Returns an EntityResolver instance that contains runtime mapping information. |
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 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 boolean channelEventsEnabled
Constructor Detail |
---|
public ClientChannel(ClientConnection connection)
public ClientChannel(ClientConnection connection, boolean channelEventsEnabled)
public ClientChannel(ClientConnection connection, boolean channelEventsEnabled, EventManager eventManager) throws CayenneRuntimeException
CayenneRuntimeException
Method Detail |
---|
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()
DataChannel
getEntityResolver
in interface DataChannel
protected boolean setupRemoteChannelListener() throws CayenneRuntimeException
CayenneRuntimeException
protected java.lang.Object send(ClientMessage message, java.lang.Class resultClass)
org.apache.cayenne.client.CayenneClientException
- if an underlying
connector exception occured, or a result is not of expected type.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |