@Inject public XMPPFriendConnectionImpl( @Assisted FriendConnectionConfiguration configuration, @Assisted ListeningExecutorService executorService, AsynchronousEventBroadcaster<RosterEvent> rosterBroadcaster, EventBroadcaster<FriendRequestEvent> friendRequestBroadcaster, AsynchronousEventMulticaster<FriendConnectionEvent> connectionMulticaster, AddressFactory addressFactory, EventMulticaster<FeatureEvent> featureSupport, List<ConnectionConfigurationFactory> connectionConfigurationFactories, AddressIQListenerFactory addressIQListenerFactory, AuthTokenIQListenerFactory authTokenIQListenerFactory, ConnectBackRequestIQListenerFactory connectBackRequestIQListenerFactory, LibraryChangedIQListenerFactory libraryChangedIQListenerFactory, FileTransferIQListenerFactory fileTransferIQListenerFactory, ListenerSupport<FriendPresenceEvent> friendPresenceSupport, FeatureRegistry featureRegistry, IdleStatusMonitorFactory idleStatusMonitorFactory, JabberSettings jabberSettings, ListenerSupport<XmppActivityEvent> xmppActivitySupport) { this.configuration = configuration; this.friendRequestBroadcaster = friendRequestBroadcaster; this.connectionMulticaster = connectionMulticaster; this.addressFactory = addressFactory; this.featureSupport = featureSupport; this.executorService = executorService; this.connectionConfigurationFactories = connectionConfigurationFactories; this.addressIQListenerFactory = addressIQListenerFactory; this.authTokenIQListenerFactory = authTokenIQListenerFactory; this.libraryChangedIQListenerFactory = libraryChangedIQListenerFactory; this.connectBackRequestIQListenerFactory = connectBackRequestIQListenerFactory; this.fileTransferIQListenerFactory = fileTransferIQListenerFactory; this.friendPresenceSupport = friendPresenceSupport; this.featureRegistry = featureRegistry; this.idleStatusMonitorFactory = idleStatusMonitorFactory; this.jabberSettings = jabberSettings; this.xmppActivitySupport = xmppActivitySupport; rosterListeners = new EventListenerList<RosterEvent>(); // FIXME: this is only used by tests if (configuration.getRosterListener() != null) { rosterListeners.addListener(configuration.getRosterListener()); } rosterListeners.addListener(new EventRebroadcaster<RosterEvent>(rosterBroadcaster)); friends = new TreeMap<String, XMPPFriendImpl>(String.CASE_INSENSITIVE_ORDER); smackConnectionListener = new SmackConnectionListener(); }
@Override public void addListener(EventListener<UpdateEvent> listener) { listeners.addListener(listener); }