Class LateralTCPSender
java.lang.Object
org.apache.commons.jcs3.auxiliary.lateral.socket.tcp.LateralTCPSender
This class is based on the log4j SocketAppender class. I'm using a different repair structure, so
it is significantly different.
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Specify serializerLateralTCPSender
(ITCPLateralCacheAttributes lca, IElementSerializer serializer) Constructor for the LateralTCPSender object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Closes connection used by all LateralTCPSenders for this lateral connection.protected void
Creates a connection to a TCP server.<K,
V> void send
(LateralElementDescriptor<K, V> led) Sends commands to the lateral cache listener.<K,
V> Object sendAndReceive
(LateralElementDescriptor<K, V> led) Sends commands to the lateral cache listener and gets a response.
-
Constructor Details
-
LateralTCPSender
Deprecated.Specify serializerConstructor for the LateralTCPSender object.- Parameters:
lca
-- Throws:
IOException
-
LateralTCPSender
public LateralTCPSender(ITCPLateralCacheAttributes lca, IElementSerializer serializer) throws IOException Constructor for the LateralTCPSender object.- Parameters:
lca
- the configuration objectserializer
- the serializer to use when sending- Throws:
IOException
- Since:
- 3.1
-
-
Method Details
-
init
Creates a connection to a TCP server.- Parameters:
host
-port
-- Throws:
IOException
-
send
Sends commands to the lateral cache listener.- Parameters:
led
-- Throws:
IOException
-
sendAndReceive
Sends commands to the lateral cache listener and gets a response. I'm afraid that we could get into a pretty bad blocking situation here. This needs work. I just wanted to get some form of get working. However, get is not recommended for performance reasons. If you have 10 laterals, then you have to make 10 failed gets to find out none of the caches have the item.- Parameters:
led
-- Returns:
- ICacheElement
- Throws:
IOException
-
dispose
Closes connection used by all LateralTCPSenders for this lateral connection. Dispose request should come into the facade and be sent to all lateral cache services. The lateral cache service will then call this method.- Throws:
IOException
-