class OSGIServiceContext implements ServiceContext {

    @Override
    public URL getResource(String resource){
        LOG.finest("TAMAYA  Loading resource: " + resource);
        URL url = osgiServiceLoader.getBundleContext().getBundle()
                .getEntry(resource);
        if(url!=null){
            LOG.finest("TAMAYA  Resource: " + resource + " found in bundle " +
                    osgiServiceLoader.getBundleContext().getBundle().getSymbolicName());
            return url;
        }
        for(Bundle bundle: osgiServiceLoader.getResourceBundles()) {
            url = bundle.getEntry(resource);
            if(url != null){
                LOG.finest("TAMAYA  Resource: " + resource + " found in registered bundle " + bundle.getSymbolicName());
                return url;
            }
        }
        for(Bundle bundle: osgiServiceLoader.getBundleContext().getBundles()) {
            url = bundle.getEntry(resource);
            if(url != null){
                LOG.finest("TAMAYA  Resource: " + resource + " found in unregistered bundle " + bundle.getSymbolicName());
                return url;
            }
        }
        return null;
    }

    public  OSGIServiceContext(OSGIServiceLoader osgiServiceLoader);

}