kaos.core.service.transport.mockets
Class MocketCommClient

java.lang.Object
  extended by kaos.core.service.transport.mockets.MocketCommClient
All Implemented Interfaces:
CommClient

public class MocketCommClient
extends java.lang.Object
implements CommClient


Field Summary
protected  Mocket _mocket
           
static long MOCKET_CONNECT_TIMEOUT
           
static long MOCKET_TIMEOUT
           
static short PRIORITY
           
static int TAG
           
 
Constructor Summary
MocketCommClient()
          used for testing
 
Method Summary
 void close()
          Closes any open connections.
 void init(java.lang.String host, int port)
          Tries to connect to the specified host on the specified port and open an object output stream to it.
static void main(java.lang.String[] args)
           
 boolean peerReachable(long timeSinceLastContact)
           
 boolean peerUnreachableWarning(long timeSinceLastContact)
           
 void SendObject(java.io.Serializable obj)
          Sends the specified Serializable object across the ObjectOutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_mocket

protected Mocket _mocket

MOCKET_TIMEOUT

public static final long MOCKET_TIMEOUT
See Also:
Constant Field Values

MOCKET_CONNECT_TIMEOUT

public static final long MOCKET_CONNECT_TIMEOUT
See Also:
Constant Field Values

TAG

public static final int TAG
See Also:
Constant Field Values

PRIORITY

public static final short PRIORITY
See Also:
Constant Field Values
Constructor Detail

MocketCommClient

public MocketCommClient()
used for testing

Method Detail

init

public void init(java.lang.String host,
                 int port)
          throws TransportFailure
Tries to connect to the specified host on the specified port and open an object output stream to it.

Specified by:
init in interface CommClient
Parameters:
String - host
int - port
Throws:
TransportFailure

close

public void close()
Closes any open connections.

Specified by:
close in interface CommClient

SendObject

public void SendObject(java.io.Serializable obj)
                throws TransportFailure
Sends the specified Serializable object across the ObjectOutputStream.

Specified by:
SendObject in interface CommClient
Parameters:
serializable - object to send
Throws:
TransportFailure

peerUnreachableWarning

public boolean peerUnreachableWarning(long timeSinceLastContact)

peerReachable

public boolean peerReachable(long timeSinceLastContact)

main

public static void main(java.lang.String[] args)