ExternalComponent externalComponent = (ExternalComponent) component;
ExternalComponent externalComponent = components.get(component);
    public IQ query(Component component, IQ packet, int timeout) throws ComponentException {        final LinkedBlockingQueue<IQ> answer = new LinkedBlockingQueue<IQ>(8);        ExternalComponent externalComponent = (ExternalComponent) component;        externalComponent.addIQResultListener(packet.getID(), new IQResultListener() {            public void receivedAnswer(IQ packet) {                answer.offer(packet);            }        });        sendPacket(component, packet);        IQ reply = null;        try {            reply = answer.poll(timeout, TimeUnit.MILLISECONDS);        } catch (InterruptedException e) {            // Ignore        }        if (reply == null) {            reply = IQ.createResultIQ(packet);            reply.setError(PacketError.Condition.item_not_found);        }        return reply;    }