We have received notification that a device is no longer on the network, so clear out all its beat grids.

@param announcement the packet which reported the device’s disappearance
343591
private void clearBeatGrids(DeviceAnnouncement announcement) {
        final int player = announcement.getNumber();
        // Iterate over a copy to avoid concurrent modification issues
        for (DeckReference deck : new HashSet<DeckReference>(hotCache.keySet())) {
            if (deck.player == player) {
                hotCache.remove(deck);
                if (deck.hotCue == 0) {
                    deliverBeatGridUpdate(player, null);  // Inform listeners the beat grid is gone.
                }
            }
        }
    }
78107
def destroy
      @announcement = Announcement.find(params[:id])
      @announcement.destroy
  
      respond_to do |format|
        format.html { redirect_to announcements_url }
        format.json { head :no_content }
      end
    end
832980
private void deliverMasterChangedAnnouncement(final DeviceUpdate update) {
        for (final MasterListener listener : getMasterListeners()) {
            try {
                listener.masterChanged(update);
            } catch (Throwable t) {
                logger.warn("Problem delivering master changed announcement to listener", t);
            }
        }
    }
1251253
private void onSessionClose(){
        synchronized(pendingQueue){
            while(! pendingQueue.isEmpty()){
                Packet p = pendingQueue.remove();
                onLossPacket(p);
            }
        }
    }
985312
@Override
	public void stopped() {

		// Stop heartbeat timer
		if (heartBeatTimer != null) {
			heartBeatTimer.cancel(false);
			heartBeatTimer = null;
		}

		// Stop timeout checker's timer
		if (checkTimeoutTimer != null) {
			checkTimeoutTimer.cancel(false);
			checkTimeoutTimer = null;
		}

		// Send "disconnected" packet
		sendDisconnectPacket();

		// Clear all stored data
		nodes.clear();
	}
788430
private void cleanup_heartbeat_proxies() {
        // disconnect the pushsupplier to stop receiving events
        Enumeration keys = event_callback_map.keys();
        while (keys.hasMoreElements()) {
            String name = (String) keys.nextElement();
            EventCallBackStruct callback_struct = event_callback_map.get(name);
            try {
                EventChannelStruct ec_struct = channel_map.get(callback_struct.channel_name);
                if (ec_struct.structuredProxyPushSupplier != null) {
                    //System.out.println("Disconnect " + callback_struct.channel_name);
                    ec_struct.structuredProxyPushSupplier.disconnect_structured_push_supplier();
                    ec_struct.structuredProxyPushSupplier = null;
                }
            } catch (Exception e) {
                System.out.println(e);
            }
            event_callback_map.remove(name);
        }
    }
756381
def device_unmounted(self, device):
        """"""
        if not self._mounter.is_handleable(device):
            return
        self._show_notification(
            'device_unmounted',
            _('Device unmounted'),
            _('{0.ui_label} unmounted', device),
            device.icon_name)
1083384
private void signalDisconnected() {
        if (alternate != null) {
            LOGGER.info("Disconnected from Node {} ({})",
                system(hostname.nameAndAddress()), system(alternate.nameAndAddress()));
        } else {
            LOGGER.info("Disconnected from Node {}", system(hostname.nameAndAddress()));
        }
        if (eventBus != null && eventBus.hasSubscribers()) {
            eventBus.publish(new NodeDisconnectedEvent(hostname));
        }
    }
90416
@Override
    public void onMessageDelivered(MessageDeliveredEvent event) {
        for (IMessagingListener listener : messagingListeners) {
            try {
                listener.onMessageDelivered(event);
            } catch (Exception e) {
                logError(e, "message delivered "+event.getMessageId());
            }
        }
    }
289050
public void removeMessageListener(DigitalChannel channel, MessageListener<? extends Message> messageListener) {
        removeListener(channel.getIdentifier(), messageListener.getMessageType(), messageListener);
    }
554812
private void requestPlayerDBServerPort(DeviceAnnouncement announcement) {
        Socket socket = null;
        try {
            InetSocketAddress address = new InetSocketAddress(announcement.getAddress(), DB_SERVER_QUERY_PORT);
            socket = new Socket();
            socket.connect(address, socketTimeout.get());
            InputStream is = socket.getInputStream();
            OutputStream os = socket.getOutputStream();
            socket.setSoTimeout(socketTimeout.get());
            os.write(DB_SERVER_QUERY_PACKET);
            byte[] response = readResponseWithExpectedSize(is, 2, "database server port query packet");
            if (response.length == 2) {
                setPlayerDBServerPort(announcement.getNumber(), (int)Util.bytesToNumber(response, 0, 2));
            }
        } catch (java.net.ConnectException ce) {
            logger.info("Player " + announcement.getNumber() +
                    " doesn't answer rekordbox port queries, connection refused. Won't attempt to request metadata.");
        } catch (Exception e) {
            logger.warn("Problem requesting database server port number", e);
        } finally {
            if (socket != null) {
                try {
                    socket.close();
                } catch (IOException e) {
                    logger.warn("Problem closing database server port request socket", e);
                }
            }
        }
    }
870182
private void remove() {
        if (removing) {
            return;
        }
        if (deactiveNotifications.size() == 0) {
            return;
        }
        removing = true;
        final NotificationPopupView view = deactiveNotifications.get(0);
        final LinearFadeOutAnimation fadeOutAnimation = new LinearFadeOutAnimation(view) {

            @Override
            public void onUpdate(double progress) {
                super.onUpdate(progress);
                for (int i = 0; i < activeNotifications.size(); i++) {
                    NotificationPopupView v = activeNotifications.get(i);
                    final int left = v.getPopupLeft();
                    final int top = (int) (((i + 1) * SPACING) - (progress * SPACING));
                    v.setPopupPosition(left,
                                       top);
                }
            }

            @Override
            public void onComplete() {
                super.onComplete();
                view.hide();
                deactiveNotifications.remove(view);
                activeNotifications.remove(view);
                removing = false;
                remove();
            }
        };
        fadeOutAnimation.run(500);
    }
629439
public void clear() {
        @SuppressWarnings("unchecked") SparseArray<BaseNotificationItem> cloneArray =
                (SparseArray<BaseNotificationItem>) notificationArray.clone();
        notificationArray.clear();

        for (int i = 0; i < cloneArray.size(); i++) {
            final BaseNotificationItem n = cloneArray.get(cloneArray.keyAt(i));
            n.cancel();
        }

    }
205337
private void deliverBeatAnnouncement(final Beat beat) {
        for (final MasterListener listener : getMasterListeners()) {
            try {
                listener.newBeat(beat);
            } catch (Throwable t) {
                logger.warn("Problem delivering master beat announcement to listener", t);
            }
        }
    }
529255
private void clearArt(DeviceAnnouncement announcement) {
        final int player = announcement.getNumber();
        // Iterate over a copy to avoid concurrent modification issues
        for (DeckReference deck : new HashSet<DeckReference>(hotCache.keySet())) {
            if (deck.player == player) {
                hotCache.remove(deck);
                if (deck.hotCue == 0) {
                    deliverAlbumArtUpdate(player, null);  // Inform listeners that the artwork is gone.
                }
            }
        }
        // Again iterate over a copy to avoid concurrent modification issues
        for (DataReference art : new HashSet<DataReference>(artCache.keySet())) {
            if (art.player == player) {
                artCache.remove(art);
            }
        }
    }
415779
@Override
	public void removeBySent(boolean sent) {
		for (CommerceNotificationQueueEntry commerceNotificationQueueEntry : findBySent(
				sent, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceNotificationQueueEntry);
		}
	}
842777
def clear_notify(self, messages):
        
        newpile = self._notificationbar.widget_list
        for l in messages:
            if l in newpile:
                newpile.remove(l)
        if newpile:
            self._notificationbar = urwid.Pile(newpile)
        else:
            self._notificationbar = None
        self.update()