component.initialize(componentJID, this); component.start();
@Override public void process(Packet packet) throws PacketException { Component component = getNextComponent(); component.processPacket(packet); } }
component.shutdown();
public void initialize(JID jid, ComponentManager componentManager) throws ComponentException { component.initialize(jid, componentManager); }
public void start() { // Everything went fine so start reading packets from the server readerThread = new SocketReadThread(this, reader); readerThread.setDaemon(true); readerThread.start(); // Notify the component that it will be notified of new received packets component.start(); }
public String getName() { return component.getName(); }
public String getDescription() { return component.getDescription(); }
component.initialize(componentJID, this); component.start();
/** * Send a disco#info request to the new component. If the component provides information * then it will be added to the list of discoverable server items. * * @param component the new component that was added to this manager. * @param componentJID the XMPP address of the new component. */ private void checkDiscoSupport(Component component, JID componentJID) { // Build a disco#info request that will be sent to the component IQ iq = new IQ(IQ.Type.get); iq.setFrom(getAddress()); iq.setTo(componentJID); iq.setChildElement("query", "http://jabber.org/protocol/disco#info"); // Send the disco#info request to the component. The reply (if any) will be processed in // #process(Packet) // sendPacket(component, iq); component.processPacket(iq); }
public void shutdown() { shutdown = true; // Notify the component to shutdown component.shutdown(); disconnect(); }
@Override public void process(Packet packet) throws PacketException { Component component = getNextComponent(); component.processPacket(packet); } }
component.shutdown();
public void run() { if (packet instanceof IQ) { IQ iq = (IQ) packet; IQ.Type iqType = iq.getType(); if (IQ.Type.result == iqType || IQ.Type.error == iqType) { // The server got an answer to an IQ packet that was sent from the component IQResultListener iqResultListener = resultListeners.remove(iq.getID()); resultTimeout.remove(iq.getID()); if (iqResultListener != null) { try { iqResultListener.receivedAnswer(iq); } catch (Exception e) { manager.getLog().error("Error processing answer of remote entity", e); } return; } } } component.processPacket(packet); } });
/** * Send a disco#info request to the new component. If the component provides information * then it will be added to the list of discoverable server items. * * @param component the new component that was added to this manager. * @param componentJID the XMPP address of the new component. */ private void checkDiscoSupport(Component component, JID componentJID) { // Build a disco#info request that will be sent to the component IQ iq = new IQ(IQ.Type.get); iq.setFrom(getAddress()); iq.setTo(componentJID); iq.setChildElement("query", "http://jabber.org/protocol/disco#info"); // Send the disco#info request to the component. The reply (if any) will be processed in // #process(Packet) // sendPacket(component, iq); component.processPacket(iq); }