Class LocalConnection
java.lang.Object
org.apache.cayenne.remote.BaseConnection
org.apache.cayenne.remote.service.LocalConnection
- All Implemented Interfaces:
- ClientConnection
public class LocalConnection extends BaseConnection
A ClientConnection that connects to a DataChannel. Used as an emulator of a remote
 service. Emulation includes serialization/deserialization of objects.
- Since:
- 1.2
- 
Field SummaryFields Modifier and Type Field Description protected DataChannelchannelstatic intHESSIAN_SERIALIZATIONstatic intJAVA_SERIALIZATIONstatic intNO_SERIALIZATIONprotected intserializationPolicyFields inherited from class org.apache.cayenne.remote.BaseConnectionlogger, messageId
- 
Constructor SummaryConstructors Constructor Description LocalConnection(DataChannel handler)Creates LocalConnector with specified handler and no serialization.LocalConnection(DataChannel handler, int serializationPolicy)Creates a LocalConnector with specified handler and serialization policy.
- 
Method SummaryModifier and Type Method Description protected voidbeforeSendMessage(org.apache.cayenne.remote.ClientMessage message)Does nothing.protected ObjectdoSendMessage(org.apache.cayenne.remote.ClientMessage message)Dispatches a message to an internal handler.DataChannelgetChannel()Returns wrapped DataChannel.EventBridgegetServerEventBridge()Returns null.booleanisSerializingMessages()Methods inherited from class org.apache.cayenne.remote.BaseConnectiongetProcessedMessagesCount, sendMessage
- 
Field Details- 
NO_SERIALIZATIONpublic static final int NO_SERIALIZATION- See Also:
- Constant Field Values
 
- 
JAVA_SERIALIZATIONpublic static final int JAVA_SERIALIZATION- See Also:
- Constant Field Values
 
- 
HESSIAN_SERIALIZATIONpublic static final int HESSIAN_SERIALIZATION- See Also:
- Constant Field Values
 
- 
channel
- 
serializationPolicyprotected int serializationPolicy
 
- 
- 
Constructor Details- 
LocalConnectionCreates LocalConnector with specified handler and no serialization.
- 
LocalConnectionCreates a LocalConnector with specified handler and serialization policy. Valid policies are defined as final static int field in this class.
 
- 
- 
Method Details- 
isSerializingMessagespublic boolean isSerializingMessages()
- 
getChannelReturns wrapped DataChannel.
- 
getServerEventBridgeReturns null.- Returns:
- An EventBridge or null if server events are not supported.
 
- 
beforeSendMessageprotected void beforeSendMessage(org.apache.cayenne.remote.ClientMessage message)Does nothing.- Specified by:
- beforeSendMessagein class- BaseConnection
 
- 
doSendMessageprotected Object doSendMessage(org.apache.cayenne.remote.ClientMessage message) throws CayenneRuntimeExceptionDispatches a message to an internal handler.- Specified by:
- doSendMessagein class- BaseConnection
- Throws:
- CayenneRuntimeException
 
 
-