String pathFragment = validName.getSchemePath();
String schemeName = validName.getScheme();
if (validName.hasInterface()) {
if (OsgiName.FRAMEWORK_PATH.equals(pathFragment) && "bundleContext".equals(validName.getServiceName())) {
AdminPermission adminPermission =
new AdminPermission(callerContext.getBundle(), AdminPermission.CONTEXT);
try {
AccessController.checkPermission(adminPermission);
return callerContext;
} catch (AccessControlException accessControlException) {
NamingException namingException = new NameNotFoundException("Caller does not have permissions to get BundleContext.");