code: public ProxyTarget locateProxyTarget() {
          if (bundleContext == null) {
              throw new IllegalStateException("Bundle context is not allowed to be null");
          }
          ClassLoader oldClassloader = Thread.currentThread().getContextClassLoader();
          String filter = getApplicationContextFilter(bundleContext.getBundle().getSymbolicName());
          ServiceReference<?>[] references = null;
          try {
              references = bundleContext.getServiceReferences(getContainerClass().getName(), filter);
          } catch (InvalidSyntaxException e) {
              throw new IllegalStateException("not possible", e);
          }
          if (references == null || references.length == 0) {
              throw new IllegalStateException(String.format("Found zero service references for %s; this is not OK...",
                  bundleContext.getBundle().getSymbolicName()));
          }
          try {
              Thread.currentThread().setContextClassLoader(parent.getClassLoader());
              final BeanReactor<Container> strategy = createStrategy();
              for (ServiceReference<?> serviceReference : references) {
                  @SuppressWarnings("unchecked")
                  final Container service = (Container) bundleContext.getService(serviceReference);
                  try {
                      if (!strategy.containsBean(service)) {
                          continue;
                      }
                      return new ProxyTarget() {
  
                          public Object getTarget() {
                              return strategy.createBean(service);
                          }
                      };
                  } finally {
                      bundleContext.ungetService(serviceReference);
                  }
              }
          } finally {
              Thread.currentThread().setContextClassLoader(oldClassloader);
          }
          throw new IllegalStateException(String.format(
              "Bundle %s can no longer attach bean %s with ID %s, class %s to page %s", bundleContext
                  .getBundle().getSymbolicName(), beanType.getName(), beanName, beanType.getName(),
              parent.getName()));
      }
docs: <p>locateProxyTarget.</p>
  
  @return a {@link org.ops4j.pax.wicket.spi.ProxyTarget} object.