I don't think I am wrong because same code with lookup works.
BTW I use a flat namespace.
 
here are two snippets of code on NamingService
 
lookup :
         ....
         } else if (ctx instanceof Reference)
         {
            // Federation
            if (((Reference)ctx).get("nns") != null)
            {
               CannotProceedException cpe = new CannotProceedException();
               cpe.setResolvedObj(ctx);
               cpe.setRemainingName(name.getSuffix(1));
               throw cpe;
            }
            result = new ResolveResult(ctx, name.getSuffix(1)); // that will trigger NamingContext to ask the federated Context to lookup the value
         } else
         ....
 
unbind :
 
         ....
         } else if (ctx instanceof Reference)
         {
            // Federation
            if (((Reference)ctx).get("nns") != null)
            {
               CannotProceedException cpe = new CannotProceedException();
               cpe.setResolvedObj(ctx);
               cpe.setRemainingName(name.getSuffix(1));
               throw cpe;
            } else
            {
               // its going here
               throw new NotContextException(); // the code goes here when unbind executes and lets no further chance to the federated context to unbind
            }
         } else
         .....
 
----- Original Message -----
Sent: Wednesday, August 14, 2002 6:51 PM
Subject: Re: [JBoss-user] unbinding with a federated context

This would happen in the naming convention in the A context did
not use '/' as the compound name seperator. You have to be careful
when using string names across federated namespaces as it may
not make any sense, or at least work the way you expect. What
type of naming service is bound under "A"?
 
xxxxxxxxxxxxxxxxxxxxxxxx
Scott Stark
Chief Technology Officer
JBoss Group, LLC
xxxxxxxxxxxxxxxxxxxxxxxx
----- Original Message -----
Sent: Wednesday, August 14, 2002 1:03 PM
Subject: [JBoss-user] unbinding with a federated context

Hi all,
 
 I have on question about naming. I am using a federated context through ExternalContext service.
My issue is about unbinding something in my federated context via NamingContext :
 
 For instance, if my context is bound under A and in my context I have an object bound under B
 
 The following code works :
 
ctx = (Context) new InitialContext().lookup("B"); // got a NamingContext and then my context
ctx.unbind("B"); // unbind on my context
 
 But the code that one doesn't work at all :
 
new InitialContext().undind("A/B"); // here I unbind directly in the NamingServer
 
 I gave a look at the code and unbind throw a NotContextException instead of forwarding
the unbind to the federated context.
 
  Is it normal behaviour ? a feature planned long ago but never achieved, or bug ?
 
Julien
 

Reply via email to