Package org.apache.cayenne.rop
Class HttpClientConnection
java.lang.Object
org.apache.cayenne.remote.BaseConnection
org.apache.cayenne.rop.HttpClientConnection
- All Implemented Interfaces:
ClientConnection
public class HttpClientConnection extends BaseConnection
-
Field Summary
Fields inherited from class org.apache.cayenne.remote.BaseConnection
logger, messageId
-
Constructor Summary
Constructors Constructor Description HttpClientConnection(org.apache.cayenne.remote.RemoteService remoteService, String sharedSession)
-
Method Summary
Modifier and Type Method Description protected void
beforeSendMessage(org.apache.cayenne.remote.ClientMessage message)
Called before logging the beginning of message processing.protected void
connect()
protected EventBridge
createServerEventBridge(org.apache.cayenne.remote.RemoteSession session)
Creates an EventBridge that will listen for server events.protected Object
doSendMessage(org.apache.cayenne.remote.ClientMessage message)
The worker method invoked to process message.EventBridge
getServerEventBridge()
Returns an EventBridge that receives remote server events.org.apache.cayenne.remote.RemoteSession
getSession()
void
shutdown()
Methods inherited from class org.apache.cayenne.remote.BaseConnection
getProcessedMessagesCount, sendMessage
-
Constructor Details
-
HttpClientConnection
public HttpClientConnection(org.apache.cayenne.remote.RemoteService remoteService, String sharedSession)
-
-
Method Details
-
getSession
public org.apache.cayenne.remote.RemoteSession getSession() -
beforeSendMessage
protected void beforeSendMessage(org.apache.cayenne.remote.ClientMessage message) throws CayenneRuntimeExceptionDescription copied from class:BaseConnection
Called before logging the beginning of message processing.- Specified by:
beforeSendMessage
in classBaseConnection
- Throws:
CayenneRuntimeException
-
doSendMessage
protected Object doSendMessage(org.apache.cayenne.remote.ClientMessage message) throws CayenneRuntimeExceptionDescription copied from class:BaseConnection
The worker method invoked to process message.- Specified by:
doSendMessage
in classBaseConnection
- Throws:
CayenneRuntimeException
-
getServerEventBridge
Description copied from interface:ClientConnection
Returns an EventBridge that receives remote server events. Caller would normally register returned bridge with a local EventManager, thus allowing local listeners to receive server events.- Returns:
- An EventBridge or null if server events are not supported.
- Throws:
CayenneRuntimeException
-
shutdown
- Throws:
RemoteException
-
connect
protected void connect() -
createServerEventBridge
protected EventBridge createServerEventBridge(org.apache.cayenne.remote.RemoteSession session) throws CayenneRuntimeExceptionCreates an EventBridge that will listen for server events. Returns null if server events support is not configured in the descriptor.- Throws:
CayenneRuntimeException
- if EventBridge startup fails for any reason.
-