Changeset 4866 for source/ariba/overlay
- Timestamp:
- Jul 13, 2009, 9:42:32 AM (15 years ago)
- Location:
- source/ariba/overlay
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/OverlayBootstrap.cpp
r4850 r4866 44 44 45 45 use_logging_cpp(OverlayBootstrap); 46 SystemEventType OverlayBootstrapMethodType("OverlayBootstrapMethodType"); 46 47 47 48 OverlayBootstrap::OverlayBootstrap() … … 61 62 62 63 manager.registerCallback( this ); 63 manager.register AllModules();64 manager.registerModule( BootstrapManager::BootstrapTypePeriodicBroadcast ); 64 65 } 65 66 void OverlayBootstrap::stop(){ … … 69 70 70 71 manager.unregisterCallback( this ); 71 manager.unregisterAllModules(); 72 manager.unregisterModule( BootstrapManager::BootstrapTypePeriodicBroadcast ); 73 } 74 75 void OverlayBootstrap::handleSystemEvent(const SystemEvent& event){ 76 77 78 EventData* data = event.getData<EventData>(); 79 80 // announcement for our spovnet 81 logging_info( "found bootstrap node for our SpoVNetID " << data->spovnetid.toString() 82 << " on NodeID " << data->nodeid.toString() << " with endpoint " << data->endpoint.toString() ); 83 84 85 // TODO: do stuff on overlay 86 87 88 delete data; 72 89 } 73 90 … … 95 112 if( nid == this->nodeid ) return; 96 113 97 // announcement for our spovnet 98 logging_info( "found bootstrap node for our SpoVNetID " << sid.toString() 99 << " on NodeID " << nid << " with endpoint " << ep.toString() ); 114 // 115 // send out the bootstrap information as 116 // event to synchronize into the system queue 117 // 118 119 EventData* data = new EventData(); 120 data->spovnetid = sid; 121 data->nodeid = nid; 122 data->endpoint = ep; 123 124 SystemQueue::instance().scheduleEvent( 125 SystemEvent( this, OverlayBootstrapMethodType, data), 0 ); 100 126 } 101 127 -
source/ariba/overlay/OverlayBootstrap.h
r4836 r4866 47 47 #include "ariba/utility/bootstrap/BootstrapInformationCallback.h" 48 48 #include "ariba/communication/EndpointDescriptor.h" 49 #include "ariba/utility/system/SystemEventListener.h" 50 #include "ariba/utility/system/SystemQueue.h" 51 #include "ariba/utility/system/SystemEvent.h" 52 #include "ariba/utility/system/SystemEventType.h" 49 53 50 54 using std::string; … … 55 59 using ariba::utility::BootstrapInformationCallback; 56 60 using ariba::communication::EndpointDescriptor; 61 using ariba::utility::SystemEventType; 62 using ariba::utility::SystemEvent; 63 using ariba::utility::SystemQueue; 64 using ariba::utility::SystemEventListener; 57 65 58 66 namespace ariba { … … 61 69 class BaseOverlay; 62 70 63 class OverlayBootstrap : public BootstrapInformationCallback {71 class OverlayBootstrap : public BootstrapInformationCallback, public SystemEventListener { 64 72 use_logging_h(OverlayBootstrap); 65 73 public: … … 74 82 75 83 protected: 84 virtual void handleSystemEvent(const SystemEvent& event); 76 85 virtual void onBootstrapServiceFound(string name, string info1, string info2, string info); 77 86 78 87 private: 88 typedef struct _EventData { 89 SpoVNetID spovnetid; 90 NodeID nodeid; 91 EndpointDescriptor endpoint; 92 } EventData; 93 79 94 BootstrapManager& manager; 80 95 SpoVNetID spovnetid;
Note:
See TracChangeset
for help on using the changeset viewer.