Package javax.naming

Examples of javax.naming.NameNotFoundException


        }

        @Override
        protected String getName(String name) throws NamingException {
            if ("inject".equals(name)) return name;
            if (!name.startsWith("java:")) throw new NameNotFoundException("Name must be in java: namespace");
            return name.substring("java:".length());
        }
View Full Code Here


        AbstractName target;
        try {
            target = resolveTargetName();
        } catch (GBeanNotFoundException e) {
            throw (NameNotFoundException) new NameNotFoundException("Could not resolve name query: " + abstractNameQueries).initCause(e);
        }

        Object proxy;
        try {
            proxy = kernel.invoke(target, "$getResource");
View Full Code Here

        Kernel kernel = getKernel();
        try {
            AbstractName targetName = resolveTargetName();
            return kernel.getAttribute(targetName, "handleDelegate");
        } catch (Exception e) {
            throw (NameNotFoundException) new NameNotFoundException("Error getting handle delegate attribute from CORBAGBean: name query =" + abstractNameQueries).initCause(e);
        }
    }
View Full Code Here

    public Object getContent() throws IllegalStateException, NameNotFoundException {
        AbstractName target;
        try {
            target = resolveTargetName();
        } catch (GBeanNotFoundException e) {
            throw (NameNotFoundException)new NameNotFoundException("Could not resolve gbean from name query: " + abstractNameQueries).initCause(e);
        }
        try {
            return getKernel().getGBean(target);
        } catch (GBeanNotFoundException e) {
            IllegalStateException illegalStateException = new IllegalStateException();
View Full Code Here

            }

            Context compCtx = (Context) compContext.get();
            if (compCtx == null) {
                // the component context was not set for this thread
                throw new NameNotFoundException(name);
            }

            if ("comp".equals(name)) {
                return compCtx;
            } else if (name.startsWith("comp/")) {
                return compCtx.lookup(name.substring(5));
            } else if ("/comp".equals(name)) {
                return compCtx;
            } else if (name.startsWith("/comp/")) {
                return compCtx.lookup(name.substring(6));
            } else {
                throw new NameNotFoundException("Unrecognized name, does not start with expected 'comp': " + name);
            }
        }
        return super.lookup(name);
    }
View Full Code Here

    }

    public Object getObject() throws NamingException {
        Object component = SystemInstance.get().getComponent(type);
        if (component == null) {
            throw new NameNotFoundException("No " + type.getSimpleName() + " registered with the OpenEJB system");
        }
        return component;
    }
View Full Code Here

     * not notify the error listeners.
     */
    @Test
    public void testGetKeysNoData()
    {
        conf.installException(new NameNotFoundException("Test exception"));
        assertFalse("Got keys", conf.getKeys().hasNext());
        listener.verify();
    }
View Full Code Here

     * Tests getKeys() if no data is found. This should not cause a problem and
     * not notify the error listeners.
     */
    public void testGetKeysNoData()
    {
        conf.installException(new NameNotFoundException("Test exception"));
        assertFalse("Got keys", conf.getKeys().hasNext());
        listener.verify();
    }
View Full Code Here

        throws NamingException {

        File file = file(name);

        if (file == null)
            throw new NameNotFoundException(
                    sm.getString("resources.notFound", name));

        if (!file.delete())
            throw new NamingException
                (sm.getString("resources.unbindFailed", name));
View Full Code Here

        throws NamingException {

        File file = file(oldName);

        if (file == null)
            throw new NameNotFoundException
                (sm.getString("resources.notFound", oldName));

        File newFile = new File(base, newName);

        file.renameTo(newFile);
View Full Code Here

TOP

Related Classes of javax.naming.NameNotFoundException

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.