Package org.jnp.interfaces

Examples of org.jnp.interfaces.NamingContext


               for (Object obj: children)
               {
                  String child = (String) obj;
                  Name fullName = (Name) name.clone();
                  fullName.add(child);
                  NamingContext subCtx = new NamingContext(null, fullName, this.getHAStub());
                  list.add(new Binding(child, NamingContext.class.getName(), subCtx, true));
               }
            }
         }
        
View Full Code Here


         }

         Name fullName = PARSER.parse("");
         fullName.addAll(name);
         commit = true;
         return new NamingContext(null, fullName, this.getHAStub());
      }
      finally
      {
         cache.getCache().endBatch(commit);
      }
View Full Code Here

                                Name name,
                                Context nameCtx,
                                Hashtable environment)
                         throws Exception
   {
      return new NamingContext(environment, name, root);
   }
View Full Code Here

   {
      Object value = invocation.nextInterceptor().invoke(invocation);
      if( value instanceof NamingContext )
      {
         initNamingProxy();
         NamingContext ctx = (NamingContext) value;
         ctx.setNaming(proxy);
      }
      return value;
   }
View Full Code Here

      }
  
      if (name.isEmpty())
      {
         // Return this
         return new NamingContext(null, PARSER.parse(""), this.getHAStub());
      }

      // is the name a context?
      try
      {
         Node<String, Binding> n = this.cache.getRoot().getChild(Fqn.fromRelativeFqn(FQN_ROOT, Fqn.fromString(name.toString())));
         if (n != null)
         {
            Name fullName = (Name) name.clone();
            return new NamingContext(null, fullName, this.getHAStub());
         }
      }
      catch (CacheException ce)
      {
         // don't chain CacheException since Infinispan may not be on remote client's classpath
View Full Code Here

               for (Object obj: children)
               {
                  String child = (String) obj;
                  Name fullName = (Name) name.clone();
                  fullName.add(child);
                  NamingContext subCtx = new NamingContext(null, fullName, this.getHAStub());
                  list.add(new Binding(child, NamingContext.class.getName(), subCtx, true));
               }
            }
         }
        
View Full Code Here

      }
  
      Name fullName = PARSER.parse("");
      fullName.addAll(name);
     
      return new NamingContext(null, fullName, this.getHAStub());
   }
View Full Code Here

   protected Context createContext(Hashtable environment)
           throws NamingException
   {
      Context compCtx;
      NamingServer srv = new NamingServer();
      compCtx = new NamingContext(environment, null, srv);
      return compCtx;
   }
View Full Code Here

   {
    Object result;
      if (name.isEmpty())
      {
         // Return this
         result = new NamingContext(null, (Name)(prefix.clone()), getRoot());
      } else if (name.size() > 1)
      {
         // Recurse to find correct context
//         System.out.println("lookup#"+name+"#");
        
         Object ctx = getObject(name);
         if (ctx instanceof NamingServer)
         {
            result = ((NamingServer)ctx).lookup(name.getSuffix(1));
         } 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));
         } else
         {
            throw new NotContextException();
         }
      } else
      {
         // Get object to return
         if (name.get(0).equals(""))
         {
            result = new NamingContext(null, prefix, getRoot());
         } else
         {
//            System.out.println("lookup "+name);
            Object res = getObject(name);
           
            if (res instanceof NamingServer)
            {
               Name fullName = (Name)(prefix.clone());
               fullName.addAll(name);
               result = new NamingContext(null, fullName, getRoot());
            }
            else
               result = res;
         }
      }
View Full Code Here

            {
               Name n = (Name)prefix.clone();
               n.add(b.getName());
               newBindings.add(new Binding(b.getName(),
                                           b.getClassName(),
                                           new NamingContext(null, n, getRoot())));
            } else
            {
               newBindings.add(b);
            }
         }
View Full Code Here

TOP

Related Classes of org.jnp.interfaces.NamingContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.