org.iids.aos.kernel.ac
Class ACReceiver

java.lang.Object
  extended by org.iids.aos.kernel.ac.ACReceiver

public final class ACReceiver
extends java.lang.Object

Receives agent containers from remote AOS kernels. Thread-safe.

Author:
Patrick Verkaik, Arno Bakker

Field Summary
protected  AgentContainerTransfer act
          Class containing all basic info
protected  KernelImpl kernel
          To check if TIDs are known at all by the kernel
protected static org.apache.commons.logging.Log log
           
protected  java.net.ServerSocket shipListener
          The server socket on which we listen for incoming shipments.
protected  ShipmentRendezvousTable shipmentTable
          The table of agent container shipments.
 
Constructor Summary
ACReceiver(AgentContainerTransfer act, java.net.InetSocketAddress socketAddress, javax.net.ssl.SSLContext ctx, KernelImpl kernel)
          Constructor.
 
Method Summary
static ReplyMessage createShipReplyMessage(int resultCode, int errorCode, java.lang.String verbose_message, TransactionID tid, byte[] sigBytes, java.lang.String[] secSuites)
          Creates ACTP_SHIP_REPLY_MSG
 java.net.InetSocketAddress getContactPoint()
          Returns the address of the base listener TCP/IP contact point.
 ShipmentRendezvousTable getRendezvousTable()
           
static void sendShipReplyMessage(java.net.Socket socket, int resultCode, int errorCode, java.lang.String verbose_message, TransactionID tid, byte[] sigBytes, java.lang.String[] secSuites)
          Used for errors where client does not need to be woken up.
 void shutdown()
           
 AOSapi.WaitACResult waitAgentContainer(java.util.HashMap<TransactionID,TIDRecord> tidrecs, int blockTime)
          Implements AOSapi.waitAgentContainer()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log

act

protected final AgentContainerTransfer act
Class containing all basic info


shipListener

protected final java.net.ServerSocket shipListener
The server socket on which we listen for incoming shipments. Note: The ACTP design allows shipping over a virtual connection (i.e. use the AOSapi primitives to ship ACs using a virtual connection that is multiplexed over a base TCP connection). To enable this, I assume people will implement a socket layer over the API primitives. To allow ACTP over the same base connection as the MUX protocol, people can "simply" use the sockets used by the Mux class. In other words, basing the ACTP on a socket interface to send/receive/... should allow for all design choices without having to change this code.


shipmentTable

protected ShipmentRendezvousTable shipmentTable
The table of agent container shipments.


kernel

protected final KernelImpl kernel
To check if TIDs are known at all by the kernel

Constructor Detail

ACReceiver

public ACReceiver(AgentContainerTransfer act,
                  java.net.InetSocketAddress socketAddress,
                  javax.net.ssl.SSLContext ctx,
                  KernelImpl kernel)
           throws java.io.IOException,
                  java.net.SocketException,
                  NoKnownSecuritySuiteException
Constructor.

Throws:
java.io.IOException
java.net.SocketException
NoKnownSecuritySuiteException
Method Detail

getContactPoint

public java.net.InetSocketAddress getContactPoint()
Returns the address of the base listener TCP/IP contact point.


shutdown

public void shutdown()

waitAgentContainer

public AOSapi.WaitACResult waitAgentContainer(java.util.HashMap<TransactionID,TIDRecord> tidrecs,
                                              int blockTime)
Implements AOSapi.waitAgentContainer()


sendShipReplyMessage

public static void sendShipReplyMessage(java.net.Socket socket,
                                        int resultCode,
                                        int errorCode,
                                        java.lang.String verbose_message,
                                        TransactionID tid,
                                        byte[] sigBytes,
                                        java.lang.String[] secSuites)
Used for errors where client does not need to be woken up. Also used by MUXP to send ACTP_ERROR_SEPARATE_BASE_CONNECTION error on base connection


createShipReplyMessage

public static ReplyMessage createShipReplyMessage(int resultCode,
                                                  int errorCode,
                                                  java.lang.String verbose_message,
                                                  TransactionID tid,
                                                  byte[] sigBytes,
                                                  java.lang.String[] secSuites)
Creates ACTP_SHIP_REPLY_MSG


getRendezvousTable

public ShipmentRendezvousTable getRendezvousTable()


Copyright ? 2003, 2004 IIDS Group. All Rights Reserved.