com.cloudtran.replicator.link
Class SocketProviderBase

java.lang.Object
  extended by com.cloudtran.replicator.link.AbstractLinkProvider
      extended by com.cloudtran.replicator.link.SocketProviderBase
All Implemented Interfaces:
LinkProvider
Direct Known Subclasses:
SocketProviderClient, SocketProviderServer

public abstract class SocketProviderBase
extends AbstractLinkProvider


Constructor Summary
SocketProviderBase()
           
 
Method Summary
 void receiveBytes(byte[] byteArray, int offset, int len)
          When we hit EOF or input/output, then we throw an IOException
 void reset()
          This method is called when we're doomed, link-wise.
 void sendBytes(byte[] byteArray, int offset, int len)
          The sendBytes method writes out from a byte array.
 String toString()
           
 
Methods inherited from class com.cloudtran.replicator.link.AbstractLinkProvider
deserialize, getLocalDataCentreName, getRemoteDataCentreName, serialize, setLink, signalL2Connected, test
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.cloudtran.replicator.link.LinkProvider
connect
 

Constructor Detail

SocketProviderBase

public SocketProviderBase()
Method Detail

reset

public void reset()
This method is called when we're doomed, link-wise. We need to signal the Link that we are down and shut up shop.


sendBytes

public void sendBytes(byte[] byteArray,
                      int offset,
                      int len)
               throws IOException
Description copied from interface: LinkProvider
The sendBytes method writes out from a byte array. It must be thread-safe: if necessary, add 'synchronized' on the implementation If the link is down or there is a problem with the underlying connection, the IOException is thrown. The caller should call FSM(prod_L2Down) to reset the link and the FSM. (This method cannot do that itself, because it may be called inside an FSM action itself and would deadlock on the FSM synchronization.)

Throws:
IOException

receiveBytes

public void receiveBytes(byte[] byteArray,
                         int offset,
                         int len)
                  throws IOException
When we hit EOF or input/output, then we throw an IOException

Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object