public void run()
    {
        AbstractMessage message;
        try {
            // Take a new message from the queue or wait.
            while (!isInterrupted()) {
                if (targetName == null || targetNode == null) {
                    // Master is dead
                    Thread.sleep(100);
                    continue;
                }

                message = queue.peek();

                if (message == null) {
                    // Check if the last message was more than MASTER_CHECK_INTERVAL ms ago
                    if (trackTime && lastMessage < System.currentTimeMillis() - MASTER_CHECK_INTERVAL) {
                        message = new Message("Status check message");
                        message.setSender(parent.getId());
                        message.setReceiver(targetName);
                        queue.add(message);
                    } else {
                        Thread.sleep(100);
                        continue;
                    }
                }

                lastMessage = System.currentTimeMillis();
                deliver(message);
            }
        } catch (InterruptedException e) {
            System.out.println("GSMessageChannel " + targetName + " just got killed.");
        }
        System.out.println("Politely exiting");
    }