private synchronized void resolveService ( ) { T newService = null ; final Iterator < T > it = m_serviceCollection . iterator ( ) ; while ( newService == null && it . hasNext ( ) ) { final T candidateService = it . next ( ) ; if ( ! candidateService . equals ( getService ( ) ) ) { newService = candidateService ; } } setService ( newService ) ; }
Resolves a new service by serching the services collection for first available service .