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 SummaryConstructorsConstructorDescriptionDeprecated.Specify serializerLateralTCPSender(ITCPLateralCacheAttributes lca, IElementSerializer serializer) Constructor for the LateralTCPSender object.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddispose()Closes connection used by all LateralTCPSenders for this lateral connection.protected voidCreates 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- 
LateralTCPSenderDeprecated.Specify serializerConstructor for the LateralTCPSender object.- Parameters:
- lca-
- Throws:
- IOException
 
- 
LateralTCPSenderpublic LateralTCPSender(ITCPLateralCacheAttributes lca, IElementSerializer serializer) throws IOException Constructor for the LateralTCPSender object.- Parameters:
- lca- the configuration object
- serializer- the serializer to use when sending
- Throws:
- IOException
- Since:
- 3.1
 
 
- 
- 
Method Details- 
initCreates a connection to a TCP server.- Parameters:
- host-
- port-
- Throws:
- IOException
 
- 
sendSends commands to the lateral cache listener.- Parameters:
- led-
- Throws:
- IOException
 
- 
sendAndReceiveSends 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
 
- 
disposeCloses 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
 
 
-