Index: source/ariba/overlay/BaseOverlay.cpp
===================================================================
--- source/ariba/overlay/BaseOverlay.cpp	(revision 3037)
+++ source/ariba/overlay/BaseOverlay.cpp	(revision 3041)
@@ -47,12 +47,22 @@
 use_logging_cpp(BaseOverlay);
 
-BaseOverlay::BaseOverlay( BaseCommunication& _basecomm, const NodeID& _nodeid )
-	: 	bc( _basecomm ), nodeId( _nodeid ), spovnetId( SpoVNetID::UNSPECIFIED), overlayInterface( NULL ),
-		initiatorLink( LinkID::UNSPECIFIED ), state( BaseOverlayStateInvalid ) {
+BaseOverlay::BaseOverlay()
+	: bc(NULL), overlayInterface(NULL),
+		nodeId(NodeID::UNSPECIFIED), spovnetId(SpoVNetID::UNSPECIFIED),
+		initiatorLink(LinkID::UNSPECIFIED), state(BaseOverlayStateInvalid){
+}
+
+BaseOverlay::~BaseOverlay(){
+}
+
+void BaseOverlay::start( BaseCommunication& _basecomm, const NodeID& _nodeid ){
+
+	bc = &_basecomm;
+	nodeId = _nodeid;
 
 	logging_info("creating base overlay");
 
-	bc.registerMessageReceiver( this );
-	bc.registerEventListener( this );
+	bc->registerMessageReceiver( this );
+	bc->registerEventListener( this );
 
 	ovl.visCreate( ovlId, nodeId, string(""), string("") );
@@ -75,11 +85,11 @@
 }
 
-BaseOverlay::~BaseOverlay() {
+void BaseOverlay::stop() {
 
 	logging_info("deleting base overlay");
 
 	Timer::stop();
-	bc.unregisterMessageReceiver( this );
-	bc.unregisterEventListener( this );
+	bc->unregisterMessageReceiver( this );
+	bc->unregisterEventListener( this );
 }
 
@@ -101,5 +111,6 @@
 	state = BaseOverlayStateJoinInitiated;
 
-	initiatorLink = bc.establishLink( bootstrapEp );
+	initiatorLink = bc->establishLink( bootstrapEp );
+	logging_info("join process initiated for " << id.toString() << "...");
 }
 
@@ -124,8 +135,8 @@
 		// then, leave the spovnet baseoverlay
 		OverlayMsg overMsg( OverlayMsg::OverlayMessageTypeBye, nodeId );
-		bc.sendMessage( initiatorLink, &overMsg );
+		bc->sendMessage( initiatorLink, &overMsg );
 
 		// drop the link and set to correct state
-		bc.dropLink( initiatorLink );
+		bc->dropLink( initiatorLink );
 		initiatorLink = LinkID::UNSPECIFIED;
 	}
@@ -175,5 +186,5 @@
 const EndpointDescriptor& BaseOverlay::getEndpointDescriptor(const LinkID& link) const {
 
-	return bc.getEndpointDescriptor( link );
+	return bc->getEndpointDescriptor( link );
 }
 
@@ -181,5 +192,5 @@
 
 	if( node == nodeId || node == NodeID::UNSPECIFIED )
-		return bc.getEndpointDescriptor();
+		return bc->getEndpointDescriptor();
 
 	if( overlayInterface == NULL ){
@@ -216,5 +227,5 @@
 
 	ServiceInterface* receiver = listenerMux.get( service );
-	const LinkID link = bc.establishLink( ep );
+	const LinkID link = bc->establishLink( ep );
 
 	LinkItem item (link, NodeID::UNSPECIFIED, service, receiver);
@@ -237,5 +248,5 @@
 
 	LinkItem item = i->second;
-	bc.dropLink( link );
+	bc->dropLink( link );
 
 	if( item.interface != NULL )
@@ -257,5 +268,5 @@
 
 	i->second.markused();
-	return bc.sendMessage( link, &overmsg );
+	return bc->sendMessage( link, &overmsg );
 }
 
@@ -349,5 +360,5 @@
 
 		state = BaseOverlayStateJoinInitiated; // state remains in JoinInitiated
-		bc.sendMessage( id, &overMsg );
+		bc->sendMessage( id, &overMsg );
 
 		return;
@@ -384,5 +395,5 @@
 			);
 
-		bc.sendMessage( id, &overMsg );
+		bc->sendMessage( id, &overMsg );
 		i->second.markused();
 
@@ -555,5 +566,5 @@
 
 		retmsg.encapsulate(&replyMsg);
-		bc.sendMessage( link, &retmsg );
+		bc->sendMessage( link, &retmsg );
 
 		return true;
@@ -597,7 +608,7 @@
 		if( ! replyMsg->getJoinAllowed() ){
 
-			logging_warn( "our join request has been denied" );
-
-			bc.dropLink( initiatorLink );
+			logging_error( "our join request has been denied" );
+
+			bc->dropLink( initiatorLink );
 			initiatorLink = LinkID::UNSPECIFIED;
 			state = BaseOverlayStateInvalid;
@@ -624,5 +635,5 @@
 			logging_error( "overlay structure not supported" );
 
-			bc.dropLink( initiatorLink );
+			bc->dropLink( initiatorLink );
 			initiatorLink = LinkID::UNSPECIFIED;
 			state = BaseOverlayStateInvalid;
@@ -698,5 +709,5 @@
 		if( changed ){
 			OverlayMsg overMsg( OverlayMsg::OverlayMessageTypeUpdate, i->second.service, nodeId );
-			bc.sendMessage( link, &overMsg );
+			bc->sendMessage( link, &overMsg );
 		}
 
@@ -744,5 +755,5 @@
 		if( overlayMsg->getSourceNode() == spovnetInitiator ){
 
-			bc.dropLink( initiatorLink );
+			bc->dropLink( initiatorLink );
 			initiatorLink = LinkID::UNSPECIFIED;
 			state = BaseOverlayStateInvalid;
@@ -800,5 +811,5 @@
 	for( ; i != iend; i++ ){
 		if( *i == nodeId) continue; // don't send to ourselfs
-		sendMessage( message, *i, service ); // TODO: sollte auto links aufbauen fÃŒr sowas
+		sendMessage( message, *i, service );
 	}
 }
@@ -857,5 +868,4 @@
 void BaseOverlay::incomingRouteMessage(Message* msg){
 	// gets handled as normal data message
-	// TODO: passt das so?
 	receiveMessage( msg, LinkID::UNSPECIFIED, NodeID::UNSPECIFIED );
 }
