Interceptor[] tmp = {IsLocalInterceptor.singleton, InvokeRemoteInterceptor.singleton};
interceptors = tmp;
}
Naming local = NamingContext.getLocal();
if (local != null) return new NamingContext(env, null, local);
String providerUrl = (String) env.get(Context.PROVIDER_URL);
if (providerUrl == null)
{
throw new RuntimeException("PROVIDER_URL not provided in jndi.properties. Automatic discovery not implemented yet.");
}
try
{
naming = (Naming) Remoting.createPojiProxy("JNDI", interfaces, providerUrl, interceptors);
}
catch (Exception e)
{
throw new RuntimeException("Unable to create Naming proxy", e);
}
return new NamingContext(env, null, naming);
}