Class LocalConnection
java.lang.Object
org.apache.cayenne.remote.BaseConnection
org.apache.cayenne.remote.service.LocalConnection
- All Implemented Interfaces:
ClientConnection
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 Summary
FieldsModifier and TypeFieldDescriptionprotected DataChannelstatic final intstatic final intstatic final intprotected intFields inherited from class org.apache.cayenne.remote.BaseConnection
logger, messageId -
Constructor Summary
ConstructorsConstructorDescriptionLocalConnection(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 Summary
Modifier and TypeMethodDescriptionprotected voidbeforeSendMessage(org.apache.cayenne.remote.ClientMessage message) Does nothing.protected ObjectdoSendMessage(org.apache.cayenne.remote.ClientMessage message) Dispatches a message to an internal handler.Returns wrapped DataChannel.Returns null.booleanMethods inherited from class org.apache.cayenne.remote.BaseConnection
getProcessedMessagesCount, sendMessage
-
Field Details
-
NO_SERIALIZATION
public static final int NO_SERIALIZATION- See Also:
-
JAVA_SERIALIZATION
public static final int JAVA_SERIALIZATION- See Also:
-
HESSIAN_SERIALIZATION
public static final int HESSIAN_SERIALIZATION- See Also:
-
channel
-
serializationPolicy
protected int serializationPolicy
-
-
Constructor Details
-
LocalConnection
Creates LocalConnector with specified handler and no serialization. -
LocalConnection
Creates a LocalConnector with specified handler and serialization policy. Valid policies are defined as final static int field in this class.
-
-
Method Details
-
isSerializingMessages
public boolean isSerializingMessages() -
getChannel
Returns wrapped DataChannel. -
getServerEventBridge
Returns null.- Returns:
- An EventBridge or null if server events are not supported.
-
beforeSendMessage
protected void beforeSendMessage(org.apache.cayenne.remote.ClientMessage message) Does nothing.- Specified by:
beforeSendMessagein classBaseConnection
-
doSendMessage
protected Object doSendMessage(org.apache.cayenne.remote.ClientMessage message) throws CayenneRuntimeException Dispatches a message to an internal handler.- Specified by:
doSendMessagein classBaseConnection- Throws:
CayenneRuntimeException
-