@@ -110,19 +111,29 @@ public class Resolver extends mx4j.remote.resolver.rmi.Resolver
{
if (orb == null)
{
- Properties props = new Properties();
- // Using putAll() on a Properties is discouraged, since it expects only Strings
- for (Iterator i = environment.entrySet().iterator(); i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- Object key = entry.getKey();
- Object value = entry.getValue();
- if (key instanceof String && value instanceof String)
- {
- props.setProperty((String)key, (String)value);
- }
- }
- orb = ORB.init((String[])null, props);
+ Object candidateORB = environment.get(ORB_KEY);
+ if (candidateORB != null)
+ {
+ // Throw as required by the spec
+ if (!(candidateORB instanceof ORB)) throw new IllegalArgumentException("Property " + ORB_KEY + " must specify a " + ORB.class.getName() + ", not " + candidateORB.getClass().getName());
+ orb = (ORB)candidateORB;
+ }
+ else
+ {
+ Properties props = new Properties();
+ // Using putAll() on a Properties is discouraged, since it expects only Strings
+ for (Iterator i = environment.entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ Object key = entry.getKey();
+ Object value = entry.getValue();
+ if (key instanceof String && value instanceof String)