ami
Class AMISender

java.lang.Object
  |
  +--ami.AMISender
All Implemented Interfaces:
Runnable

class AMISender
extends Object
implements Runnable

AMI packets sender (thread )

The ami sender is pretty clever and manage alone the sending of a packet. If sending fails, it will try to correct the error and try again ( until TTL of packet is zero ).

Version:
1.0
Author:
Bertrand Florat

Field Summary
private  AMIPacket ap
           
private  AMIPacket apVoid
           
private  boolean bStop
           
private  BufferedWriter bw
           
private  Socket socket
           
private  Thread t
           
 
Constructor Summary
(package private) AMISender()
          put your documentation comment here
 
Method Summary
private  void check()
          Called to check distant peer before connection
(package private)  AMIPacket getAp()
          get the AMIPacket
(package private)  String getIP()
          getIP : used by the AMIOutputSpool to get queekly the ip used ( to load balancing and keep socket on already opened senders
(package private)  boolean isAvailable()
          return status of the sender ( available or not)
 void run()
          start thread used to check movement in vXml vectors
private  void send()
          Send data
(package private)  void setAp(AMIPacket ap)
          used by the OutputSpool to valorize data to be sent
(package private)  void stop()
          Used to stop safely the AMISender.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

ap

private AMIPacket ap

bw

private BufferedWriter bw

bStop

private volatile boolean bStop

socket

private Socket socket

t

private Thread t

apVoid

private AMIPacket apVoid
Constructor Detail

AMISender

AMISender()
put your documentation comment here
Method Detail

getIP

String getIP()
getIP : used by the AMIOutputSpool to get queekly the ip used ( to load balancing and keep socket on already opened senders

setAp

void setAp(AMIPacket ap)
used by the OutputSpool to valorize data to be sent

getAp

AMIPacket getAp()
get the AMIPacket
Returns:
current ami packet or null if the sender has never been used

isAvailable

boolean isAvailable()
return status of the sender ( available or not)

stop

void stop()
Used to stop safely the AMISender.

run

public void run()
start thread used to check movement in vXml vectors
Specified by:
run in interface Runnable

check

private void check()
            throws AMIException
Called to check distant peer before connection

send

private void send()
           throws AMIException
Send data