Code example for Exchanger

0
 
	public OSGIServiceLookup(BundleContext context, Class<? extends T> service)
	{ 
		this.context = context;
		this.service = service;
		this.serviceReferenceExchanger = new Exchanger<ServiceReference>();
	} 
 
	OSGIServiceLookup(BundleContext context, Class<? extends T> service, Exchanger<ServiceReference> serviceReferenceExchanger)
	{ 
		this.context = context;
		this.service = service;
		this.serviceReferenceExchanger = serviceReferenceExchanger;
	} 
 
	public T getService() 
	{ 
		ServiceReference serviceReference = context.getServiceReference(service.getName());
 
		if (serviceReference == null)
Experience pair programming with AI  Get Codota for Java