Package javax.naming

Examples of javax.naming.Context.rename()


        }

        if (nOld instanceof CompositeName && nOld.size() > 1
                && nNew instanceof CompositeName && nNew.size() > 1) {
            Context context = findNnsContext(nOld);
            context.rename(nOld.getSuffix(1), nNew.getSuffix(1));
            return;
        }

        // get absolute dn name
        String oldTargetDN = getTargetDN(nOld, contextDn);
View Full Code Here


    boolean renamed = false;
    for (Iterator i = contexts.iterator(); i.hasNext();) {
      Context c = (Context) i.next();
      try {
        c.rename(oldName, newName);
        renamed = true;
      } catch (NamingException ignore) {}
    }
    if (!renamed) throw new InvalidNameException("Names not compatible with any managed subcontext");
  }
View Full Code Here

    context1.rebind("myinteger", i);
    String s = "";
    context2.bind("mystring", s);

    Context context3 = (Context) context2.lookup("");
    context3.rename("java:comp/env/jdbc/myds", "jdbc/myds");
    context3.unbind("myobject");

    assertTrue("Correct environment", context3.getEnvironment() != context2.getEnvironment());
    context3.addToEnvironment("key2", "value2");
    assertTrue("key2 added", "value2".equals(context3.getEnvironment().get("key2")));
View Full Code Here

         {
            if (node.getParent() instanceof ContextTreeNode)
            {
               ContextTreeNode contextNode = (ContextTreeNode) node.getParent();
               Context context = (Context) contextNode.getContextFactory().createContext().lookup(node.getPathFromRoot());
               context.rename(node.getId(), binding);
               context.close();

               Hermes.ui.getDefaultMessageSink().add(node.getId() + " renamed to " + binding);
            }
         }
View Full Code Here

  /**  
         * Binds a new name to the object bound to an old name, and unbinds the old name.
         */  
  public void rename(Name oldName, Name newName) throws NamingException {
    Context ctx = getImpl();
    ctx.rename(oldName, newName);
  }
         

  /**  
         * Binds a new name to the object bound to an old name, and unbinds the old name.
View Full Code Here

  /**  
         * Binds a new name to the object bound to an old name, and unbinds the old name.
         */  
  public void rename(String oldName, String newName) throws NamingException {
    Context ctx = getImpl();
    ctx.rename(oldName, newName);
  }
         

  /**  
         * Unbinds the named object.
View Full Code Here

                        Messages.getString("jndi.28", oldName, newName)); //$NON-NLS-1$
            }
            Context context = getContinuationContext(oldName);

            try {
                context.rename(oldName.getSuffix(1), newName.getSuffix(1));
            } finally {
                context.close();
            }
        }
    }
View Full Code Here

        }
        ResolveResult result = getRootURLContext(oldName, environment);
        Context context = (Context) result.getResolvedObj();

        try {
            context.rename(result.getRemainingName(),
                    getURLSuffix(newPrefix, newName));
        } finally {
            context.close();
        }
    }
View Full Code Here

                        "jndi.28", oldName, newName)); //$NON-NLS-1$
            }
            Context context = getContinuationContext(oldName);

            try {
                context.rename(oldName.getSuffix(1), newName.getSuffix(1));
            } finally {
                context.close();
            }
        }
    }
View Full Code Here

        }
        ResolveResult result = getRootURLContext(oldName, environment);
        Context context = (Context) result.getResolvedObj();

        try {
            context.rename(result.getRemainingName(), getURLSuffix(newPrefix,
                    newName));
        } finally {
            context.close();
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.