ami
Class AMIOutputSpool

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

final class AMIOutputSpool
extends Object
implements Runnable

Contains spools of AMI request waiting for sending

Singleton

The AMIOutputSpool is also responsable for merging queries in common packets if it is possible.

Version:
1.0
Author:
Bertrand Florat

Field Summary
private static AMIOutputSpool aos
          Self instance used for signleton pattern
private static boolean bStop
           
private static Hashtable hDestPacket
           
(package private)  Thread t
          Thread used for auto-start
private static Vector vas
           
 
Constructor Summary
private AMIOutputSpool()
          default constructor
 
Method Summary
private  void dispatch(AMIPacket ap)
          Used to choose best sender for this packet and give it the order to start the sending
static AMIOutputSpool getInstance()
          Return a self instance Implementation of the singleton pattern
(package private) static void put(AMIPacket ap)
          The AMIOutputProcesor uses this method to add some packets to be sent
(package private) static void removeAR(String sArid)
          Used to cancel an AR sending if it is not already transmitted to an AMIsender Can be called by the AMIOutputProcessor assumes that the AR exits
 void run()
          Main loop, dispatchs incoming packets to senders
private  Vector sort(Hashtable hCurrentSpool)
          Sorts packets by priority
(package private) static void stop()
          Finalize the output spool
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

vas

private static Vector vas

bStop

private static volatile boolean bStop

hDestPacket

private static Hashtable hDestPacket

aos

private static AMIOutputSpool aos
Self instance used for signleton pattern

t

Thread t
Thread used for auto-start
Constructor Detail

AMIOutputSpool

private AMIOutputSpool()
default constructor
Method Detail

getInstance

public static AMIOutputSpool getInstance()
Return a self instance

Implementation of the singleton pattern


run

public void run()
Main loop, dispatchs incoming packets to senders
Specified by:
run in interface Runnable

put

static void put(AMIPacket ap)
         throws AMIException
The AMIOutputProcesor uses this method to add some packets to be sent

removeAR

static void removeAR(String sArid)
Used to cancel an AR sending if it is not already transmitted to an AMIsender Can be called by the AMIOutputProcessor assumes that the AR exits

dispatch

private void dispatch(AMIPacket ap)
               throws AMIException
Used to choose best sender for this packet and give it the order to start the sending
Parameters:
ap -  

sort

private Vector sort(Hashtable hCurrentSpool)
Sorts packets by priority

stop

static void stop()
Finalize the output spool