private void fireEvent ( int eventType , Object eventObject ) { AgentRosterListener [ ] listeners ; synchronized ( this . listeners ) { listeners = new AgentRosterListener [ this . listeners . size ( ) ] ; this . listeners . toArray ( listeners ) ; } for ( int i = 0 ; i < listeners . length ; i ++ ) { switch ( eventType ) { case EVENT_AGENT_ADDED : listeners [ i ] . agentAdded ( ( EntityBareJid ) eventObject ) ; break ; case EVENT_AGENT_REMOVED : listeners [ i ] . agentRemoved ( ( EntityBareJid ) eventObject ) ; break ; case EVENT_PRESENCE_CHANGED : listeners [ i ] . presenceChanged ( ( Presence ) eventObject ) ; break ; } } }
Fires event to listeners .