Package javax.naming

Examples of javax.naming.NameAlreadyBoundException


    public DirContext createSubcontext(String name, Attributes attrs)
        throws NamingException {

        File file = new File(base, name);
        if (file.exists())
            throw new NameAlreadyBoundException
                (sm.getString("resources.alreadyBound", name));
        if (!file.mkdir())
            throw new NamingException
                (sm.getString("resources.bindFailed", name));
        return (DirContext) lookup(name);
View Full Code Here


      synchronized (getMutex())
      {
         Map<String, Object> tmpObjects = new HashMap<String, Object>(getBindings());
         if (checkIfExists && tmpObjects.containsKey(name))
         {
            throw new NameAlreadyBoundException("An object has already been binded with the name '" + name + "'");
         }
         tmpObjects.put(name, value);
         setBindings(tmpObjects);
      }
   }
View Full Code Here

      synchronized (getMutex())
      {
         Map<String, Object> tmpObjects = new HashMap<String, Object>(getBindings());
         if (tmpObjects.containsKey(name2))
         {
            throw new NameAlreadyBoundException("An object has already been binded with the name '" + name2 + "'");
         }
         else if ((value = tmpObjects.remove(name1)) == null)
         {
            throw new NameNotFoundException("No object has been binded with the name '" + name1 + "'");
         }
View Full Code Here

      synchronized (getMutex())
      {
         Map<String, Object> tmpObjects = new HashMap<String, Object>(getBindings());
         if (checkIfExists && tmpObjects.containsKey(name))
         {
            throw new NameAlreadyBoundException("An object has already been binded with the name '" + name + "'");
         }
         tmpObjects.put(name, value);
         setBindings(tmpObjects);
      }
   }
View Full Code Here

      synchronized (getMutex())
      {
         Map<String, Object> tmpObjects = new HashMap<String, Object>(getBindings());
         if (tmpObjects.containsKey(name2))
         {
            throw new NameAlreadyBoundException("An object has already been binded with the name '" + name2 + "'");
         }
         else if ((value = tmpObjects.remove(name1)) == null)
         {
            throw new NameNotFoundException("No object has been binded with the name '" + name1 + "'");
         }
View Full Code Here

      synchronized (getMutex())
      {
         Map<String, Object> tmpObjects = new HashMap<String, Object>(getBindings());
         if (checkIfExists && tmpObjects.containsKey(name))
         {
            throw new NameAlreadyBoundException("An object has already been binded with the name '" + name + "'");
         }
         tmpObjects.put(name, value);
         setBindings(tmpObjects);
      }
   }
View Full Code Here

      synchronized (getMutex())
      {
         Map<String, Object> tmpObjects = new HashMap<String, Object>(getBindings());
         if (tmpObjects.containsKey(name2))
         {
            throw new NameAlreadyBoundException("An object has already been binded with the name '" + name2 + "'");
         }
         else if ((value = tmpObjects.remove(name1)) == null)
         {
            throw new NameNotFoundException("No object has been binded with the name '" + name1 + "'");
         }
View Full Code Here

            ne.setRemainingName(org.jboss.as.jacorb.naming.jndi.CNNameParser.cosNameToName(rest));

        } else if (e instanceof InvalidName) {
            ne = new InvalidNameException();
        } else if (e instanceof AlreadyBound) {
            ne = new NameAlreadyBoundException();
        } else if (e instanceof NotEmpty) {
            ne = new ContextNotEmptyException();
        } else {
            ne = new NamingException();
        }
View Full Code Here

        // Note: No custom attributes allowed

        File file = new File(base, name);
        if (file.exists())
            throw new NameAlreadyBoundException
                (sm.getString("resources.alreadyBound", name));

        rebind(name, obj, attrs);

    }
View Full Code Here

    public DirContext createSubcontext(String name, Attributes attrs)
        throws NamingException {

        File file = new File(base, name);
        if (file.exists())
            throw new NameAlreadyBoundException
                (sm.getString("resources.alreadyBound", name));
        if (!file.mkdir())
            throw new NamingException
                (sm.getString("resources.bindFailed", name));
        return (DirContext) lookup(name);
View Full Code Here

TOP

Related Classes of javax.naming.NameAlreadyBoundException

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.