Code example for Exchanger

Methods: exchange

0
				return (T) context.getService(serviceReference);
			} 
 
			try 
			{ 
				serviceReference = serviceReferenceExchanger.exchange(null);
			} 
			catch (InterruptedException e)
			{ 
				logger.error(e.getMessage(), e);
			} 
 
			context.removeServiceListener(this);
		} 
 
		return (T) context.getService(serviceReference);
	} 
 
	@Override 
	public void serviceChanged(ServiceEvent event)
	{