init package
This commit is contained in:
parent
114fcb7ea1
commit
8e2591f54e
122
mx4j-3.0.1.patch
122
mx4j-3.0.1.patch
@ -1,57 +1,65 @@
|
||||
*** src/core/mx4j/remote/resolver/iiop/Resolver.java.orig 2005-05-12 12:13:28.000000000 -0400
|
||||
--- src/core/mx4j/remote/resolver/iiop/Resolver.java 2005-05-13 14:38:21.000000000 -0400
|
||||
***************
|
||||
*** 33,36 ****
|
||||
--- 33,37 ----
|
||||
|
||||
private ORB orb;
|
||||
+ private static final String ORB_KEY = "java.naming.corba.orb";
|
||||
|
||||
|
||||
***************
|
||||
*** 111,127 ****
|
||||
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);
|
||||
}
|
||||
return orb;
|
||||
--- 112,138 ----
|
||||
if (orb == null)
|
||||
{
|
||||
! 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)
|
||||
! {
|
||||
! props.setProperty((String)key, (String)value);
|
||||
! }
|
||||
! }
|
||||
! orb = ORB.init((String[])null, props);
|
||||
! }
|
||||
}
|
||||
return orb;
|
||||
From ea814e3b378a2305fb1d0e6b7e3a05458178dee6 Mon Sep 17 00:00:00 2001
|
||||
Subject: [PATCH]
|
||||
|
||||
---
|
||||
.../mx4j/remote/resolver/iiop/Resolver.java | 37 ++++++++++++-------
|
||||
1 file changed, 24 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/src/core/mx4j/remote/resolver/iiop/Resolver.java b/src/core/mx4j/remote/resolver/iiop/Resolver.java
|
||||
index 1666d05..559be34 100644
|
||||
--- a/src/core/mx4j/remote/resolver/iiop/Resolver.java
|
||||
+++ b/src/core/mx4j/remote/resolver/iiop/Resolver.java
|
||||
@@ -32,6 +32,7 @@ public class Resolver extends mx4j.remote.resolver.rmi.Resolver
|
||||
private static final String IOR_CONTEXT = "/ior/";
|
||||
|
||||
private ORB orb;
|
||||
+ private static final String ORB_KEY = "java.naming.corba.orb";
|
||||
|
||||
|
||||
//********************************************************************************************************************//
|
||||
@@ -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)
|
||||
+ {
|
||||
+ props.setProperty((String)key, (String)value);
|
||||
+ }
|
||||
+ }
|
||||
+ orb = ORB.init((String[])null, props);
|
||||
+ }
|
||||
}
|
||||
return orb;
|
||||
}
|
||||
--
|
||||
2.23.0
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user