diff options
author | Julian Dolby <dolby@us.ibm.com> | 2003-10-29 14:54:00 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2003-10-29 14:54:00 +0000 |
commit | f0dc1efacea75da01f2f5d3889c6f67a46864a95 (patch) | |
tree | 2d5eae99e409be7f899b51da5a873f302360ecf0 /libjava | |
parent | 119d34b273950b9b2329846da4ca6670b23e0dbe (diff) | |
download | gcc-f0dc1efacea75da01f2f5d3889c6f67a46864a95.zip gcc-f0dc1efacea75da01f2f5d3889c6f67a46864a95.tar.gz gcc-f0dc1efacea75da01f2f5d3889c6f67a46864a95.tar.bz2 |
NamingManager.java (getContinuationContext): Call getObjectInstance() with Object...
2003-10-29 Julian Dolby <dolby@us.ibm.com>
* javax/naming/spi/NamingManager.java (getContinuationContext): Call
getObjectInstance() with Object, Name, Context and environment
Hashtable from exception. Call fillInStackTrace() on exception when
rethrown.
* javax/naming/InitialContext.java (lookup(Name)): When a
CannotProceedException is thrown use the ContinuationContext.
(lookup(String)): Likewise.
(close): Clear myProps and defaultInitCtx.
From-SVN: r73041
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 11 | ||||
-rw-r--r-- | libjava/javax/naming/InitialContext.java | 23 | ||||
-rw-r--r-- | libjava/javax/naming/spi/NamingManager.java | 9 |
3 files changed, 38 insertions, 5 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 07043ac..bea41fc 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,14 @@ +2003-10-29 Julian Dolby <dolby@us.ibm.com> + + * javax/naming/spi/NamingManager.java (getContinuationContext): Call + getObjectInstance() with Object, Name, Context and environment + Hashtable from exception. Call fillInStackTrace() on exception when + rethrown. + * javax/naming/InitialContext.java (lookup(Name)): When a + CannotProceedException is thrown use the ContinuationContext. + (lookup(String)): Likewise. + (close): Clear myProps and defaultInitCtx. + 2003-10-29 Michael Koch <konqueror@gmx.de> * java/net/InetAddress.java diff --git a/libjava/javax/naming/InitialContext.java b/libjava/javax/naming/InitialContext.java index 715f30a..e2a1ac6 100644 --- a/libjava/javax/naming/InitialContext.java +++ b/libjava/javax/naming/InitialContext.java @@ -240,12 +240,28 @@ public class InitialContext implements Context public Object lookup (Name name) throws NamingException { - return getURLOrDefaultInitCtx (name).lookup (name); + try + { + return getURLOrDefaultInitCtx (name).lookup (name); + } + catch (CannotProceedException cpe) + { + Context ctx = NamingManager.getContinuationContext (cpe); + return ctx.lookup (cpe.getRemainingName()); + } } public Object lookup (String name) throws NamingException { - return getURLOrDefaultInitCtx (name).lookup (name); + try + { + return getURLOrDefaultInitCtx (name).lookup (name); + } + catch (CannotProceedException cpe) + { + Context ctx = NamingManager.getContinuationContext (cpe); + return ctx.lookup (cpe.getRemainingName()); + } } public void rebind (Name name, Object obj) throws NamingException @@ -367,7 +383,8 @@ public class InitialContext implements Context public void close () throws NamingException { - throw new OperationNotSupportedException (); + myProps = null; + defaultInitCtx = null; } public String getNameInNamespace () throws NamingException diff --git a/libjava/javax/naming/spi/NamingManager.java b/libjava/javax/naming/spi/NamingManager.java index 65ce2d2..af9ddc3 100644 --- a/libjava/javax/naming/spi/NamingManager.java +++ b/libjava/javax/naming/spi/NamingManager.java @@ -324,8 +324,10 @@ public class NamingManager // It is really unclear to me if this is right. try { - Object obj = getObjectInstance (null, cpe.getAltName (), - cpe.getAltNameCtx (), env); + Object obj = getObjectInstance (cpe.getResolvedObj(), + cpe.getAltName (), + cpe.getAltNameCtx (), + env); if (obj != null) return (Context) obj; } @@ -333,6 +335,9 @@ public class NamingManager { } + // fix stack trace for re-thrown exception (message confusing otherwise) + cpe.fillInStackTrace(); + throw cpe; } |