@Override
	public void run() {
		LOG.info("Ready to fly.");

		loop : while (true) {
			
			Message message = null;
			
			while( (message = this.messagesQueue.poll()) != null ){
				LOG.info(message.toString());				
				switch (message.getType()) {
				
				case SHUTDOWN: {
					LOG.warn("Shutdown signal receveid.Aborting...");
					break loop;
				}					
					
				case MOVE_TO_LOCATION: {
					
					try {						
						Thread.sleep(SPEED);
						this.location = MessageConvertor.messageToLocation(message);
						
						if( this.location.isHasStationsNearby() ){							
							this.transport.sendMessage(transport.getDispatcherDestination(), new Message(MessageType.TRAFFIC_REPORT,newTrafficReportEntry(this.location)));							
						}
						 
					} catch (InterruptedException e) {						
						LOG.warn(
								"Moving state is interrupted.Aborting.",e);
						
						break loop;
					}																			
				}
				break;
				
				default:
					LOG.info("Invalid message! Ignoring...");									
				}								
			}
			
			this.transport.sendMessage(transport.getDispatcherDestination(), new Message(MessageType.ASK_FOR_LOCATION,this.id.getBytes()));
			
			synchronized (LOCK) {

				try {
					LOG.info("Waiting for locations...");
					LOCK.wait();
				} catch (InterruptedException e) {
					LOG.warn(
							"Waiting state interrupted.Aborting!", e);
					break;
				}
			}
		}
		

		LOG.info("Returning to base .", id);
	}