00001 #ifndef DATA_DELIVERY_H_ 00002 #define DATA_DELIVERY_H_ 00003 00004 #include <list> 00005 00006 #include <arc/Logger.h> 00007 #include <arc/Thread.h> 00008 #include "DTR.h" 00009 #include "DTRList.h" 00010 #include "DTRStatus.h" 00011 00012 namespace DataStaging { 00013 00015 00020 class DataDelivery: public DTRCallback { 00021 00022 private: 00023 00025 Arc::SimpleCondition dtr_list_lock; 00026 00028 class delivery_pair_t; 00030 std::list<delivery_pair_t*> dtr_list; 00031 00033 TransferParameters transfer_params; 00034 00036 static Arc::Logger logger; 00037 00039 ProcessState delivery_state; 00040 00042 Arc::SimpleCondition run_signal; 00043 00046 Arc::SimpleCondition cond; 00047 00049 static void start_delivery(void* arg); 00050 00052 static void stop_delivery(void* arg); 00053 00055 bool delete_delivery_pair(delivery_pair_t* dp); 00056 00058 static void main_thread(void* arg); 00060 void main_thread(void); 00061 00063 DataDelivery(const DataDelivery&); 00065 DataDelivery& operator=(const DataDelivery&); 00066 00067 public: 00068 00070 DataDelivery(); 00072 ~DataDelivery() { stop(); }; 00073 00075 00080 virtual void receiveDTR(DTR_ptr request); 00081 00083 bool cancelDTR(DTR_ptr request); 00084 00086 bool start(); 00087 00089 bool stop(); 00090 00092 void SetTransferParameters(const TransferParameters& params); 00093 00094 }; 00095 00096 } // namespace DataStaging 00097 #endif /*DATA_DELIVERY_H_*/