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
This commit is contained in:
Julian Dolby 2003-10-29 14:54:00 +00:00 committed by Michael Koch
parent 119d34b273
commit f0dc1eface
3 changed files with 38 additions and 5 deletions

View file

@ -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> 2003-10-29 Michael Koch <konqueror@gmx.de>
* java/net/InetAddress.java * java/net/InetAddress.java

View file

@ -239,14 +239,30 @@ public class InitialContext implements Context
} }
public Object lookup (Name name) throws NamingException public Object lookup (Name name) throws NamingException
{
try
{ {
return getURLOrDefaultInitCtx (name).lookup (name); 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 public Object lookup (String name) throws NamingException
{
try
{ {
return getURLOrDefaultInitCtx (name).lookup (name); 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 public void rebind (Name name, Object obj) throws NamingException
{ {
@ -367,7 +383,8 @@ public class InitialContext implements Context
public void close () throws NamingException public void close () throws NamingException
{ {
throw new OperationNotSupportedException (); myProps = null;
defaultInitCtx = null;
} }
public String getNameInNamespace () throws NamingException public String getNameInNamespace () throws NamingException

View file

@ -324,8 +324,10 @@ public class NamingManager
// It is really unclear to me if this is right. // It is really unclear to me if this is right.
try try
{ {
Object obj = getObjectInstance (null, cpe.getAltName (), Object obj = getObjectInstance (cpe.getResolvedObj(),
cpe.getAltNameCtx (), env); cpe.getAltName (),
cpe.getAltNameCtx (),
env);
if (obj != null) if (obj != null)
return (Context) obj; return (Context) obj;
} }
@ -333,6 +335,9 @@ public class NamingManager
{ {
} }
// fix stack trace for re-thrown exception (message confusing otherwise)
cpe.fillInStackTrace();
throw cpe; throw cpe;
} }