code: public ProxyTarget locateProxyTarget(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException {
          String filter = filterString;
          if (filter == null) {
              filter = String.format("(%s=%s)", Constants.OBJECTCLASS, serviceInterface);
          } else {
              filter = String.format("(&(%s=%s)%s)", Constants.OBJECTCLASS, serviceInterface, filter);
          }
          try {
              final ServiceTracker<Object, Object> tracker =
                  new ServiceTracker<Object, Object>(bundleContext, bundleContext.createFilter(filter), null);
              tracker.open();
              final Object service = tracker.waitForService(unit.toMillis(timeout));
              if (service == null) {
                  throw new TimeoutException("no service for filter = " + filter + " was avaiable in time");
              }
              return new ReleasableProxyTarget() {
  
                  public Object getTarget() {
                      return service;
                  }
  
                  public ProxyTarget releaseTarget() {
                      tracker.close();
                      return null;
                  }
  
              };
          } catch (InvalidSyntaxException e) {
              throw new RuntimeException("filter creation failed", e);
          }
  
      }
docs: {@inheritDoc}