Package javax.naming

Examples of javax.naming.NameAlreadyBoundException


        if (name == null) {
            throw new IllegalArgumentException("name == null");
        }
        synchronized (namespace) {
            if (namespace.containsKey(name)) {
                throw new NameAlreadyBoundException(name.getName());
            }
            namespace.put(name, service);
        }
    }
View Full Code Here


        if (name == null) {
            throw new IllegalArgumentException("name == null");
        }
        synchronized (namespace) {
            if (namespace.containsKey(VmType.fromClass(name))) {
                throw new NameAlreadyBoundException(name.getName());
            }
            namespace.put(VmType.fromClass(name), service);
        }
       
        // notify listeners
View Full Code Here

      String str = name.toString();
      Fqn<String> fqn = Fqn.fromString(str);
      Fqn<String> ctx = new Fqn<String>(this.m_root, fqn);
      if (this.m_cache.getRoot().hasChild(ctx))
      {
         throw new NameAlreadyBoundException();
      }
     
      // does the prefix context already exist?
      Fqn<String> pctx;
      String newctx = name.get(size - 1);
View Full Code Here

      if (!rebind)
      {
         Node<String, Binding> node = this.m_cache.getRoot().getChild(ctx);
         if ((node != null) && (node.get(key) != null))
         {
            throw new NameAlreadyBoundException(key);
         }
      }
     
      this.m_cache.put(ctx, key, new Binding(key, className, obj, true));
   }
View Full Code Here

                } else {
                    logger.error("Jndi(name=" + externalName + ") cannot be bound to Ejb(deployment-id=" + beanInfo.ejbDeploymentId + ").  Name already taken by another object in the system.");
                }
                // Construct a new exception as the IvmContext doesn't include
                // the name in the exception that it throws
                if (failOnCollision) throw new NameAlreadyBoundException(externalName);
            }
        } else {
            try {
                openejbContext.bind(name, ref);
                logger.debug("bound ejb at name: " + name + ", ref: " + ref);
                bindings.add(name);
            } catch (NameAlreadyBoundException e) {
                logger.error("Jndi name could not be bound; it may be taken by another ejb.  Jndi(name=" + name + ")");
                // Construct a new exception as the IvmContext doesn't include
                // the name in the exception that it throws
                throw new NameAlreadyBoundException(name);
            }
        }

    }
View Full Code Here

                alreadyBound = false;
            }

            if( !rebind && alreadyBound )
            {
                throw new NameAlreadyBoundException( name.get( 0 ) );
            }
            else
            {
                if( object instanceof Referenceable )
                {
View Full Code Here

        try {
            registry.bind(stringName, getStateToBind(stringName, obj));
        } catch (AlreadyBoundException e) {
            // jndi.7C=Name is already bound: {0}
            throw (NameAlreadyBoundException) new NameAlreadyBoundException(
                    Messages.getString("jndi.7C", stringName)).initCause(e); //$NON-NLS-1$
        } catch (RemoteException e) {
            throw (NamingException) newNamingException(e).fillInStackTrace();
        }
    }
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

        // 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

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.