Examples of CorbanameURL


Examples of com.sun.jndi.cosnaming.CorbanameUrl

        try {
            if (url.startsWith("iiop://") || url.startsWith("iiopname://")) {
                IiopUrl parsedUrl = new IiopUrl(url);
                return parsedUrl.getCosName();
            } else if (url.startsWith("corbaname:")) {
                CorbanameUrl parsedUrl = new CorbanameUrl(url);
                return parsedUrl.getCosName();
            } else {
                throw new MalformedURLException("Not a valid URL: " + url);
            }
        } catch (MalformedURLException e) {
            throw new InvalidNameException(e.getMessage());
View Full Code Here

Examples of org.apache.tuscany.sca.host.corba.CorbanameURL

            throw new CorbaHostException(e);
        }
    }

    public void registerServant(String uri, Object servantObject) throws CorbaHostException {
        CorbanameURL details = CorbaHostUtils.getServiceDetails(uri);
        try {
            NamingContext namingCtx = getNamingContext(details.getNameService());
            for (int i = 0; i < details.getNamePath().size() - 1; i++) {
                NameComponent nc = new NameComponent(details.getNamePath().get(i), "");
                NameComponent[] path = new NameComponent[] {nc};
                try {
                    namingCtx = NamingContextHelper.narrow(namingCtx.resolve(path));
                } catch (Exception e) {
                    namingCtx = namingCtx.bind_new_context(path);
                }
            }
            NameComponent finalName =
                new NameComponent(details.getNamePath().get(details.getNamePath().size() - 1), "");
            try {
                namingCtx.resolve(new NameComponent[] {finalName});
                // no exception means that some object is already registered
                // under this name, we need to crash here
                throw new CorbaHostException(CorbaHostException.BINDING_IN_USE);
View Full Code Here

Examples of org.apache.tuscany.sca.host.corba.CorbanameURL

            handleException(e);
        }
    }

    public void unregisterServant(String uri) throws CorbaHostException {
        CorbanameURL details = CorbaHostUtils.getServiceDetails(uri);
        try {
            NamingContextExt namingCtx = getNamingContext(details.getNameService());
            namingCtx.unbind(namingCtx.to_name(details.getName()));
            removeURI(uri);
        } catch (Exception e) {
            handleException(e);
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.host.corba.CorbanameURL

    }

    public Object lookup(String uri) throws CorbaHostException {
        Object result = null;
        try {
            CorbanameURL url = new CorbanameURL(uri);
            NamingContextExt context = getNamingContext(url.getNameService());
            result = context.resolve_str(url.getName());
        } catch (Exception e) {
            // e.printStackTrace();
            handleException(e);
        }
        if (result == null) {
View Full Code Here

Examples of org.apache.tuscany.sca.host.corba.CorbanameURL

            throw new CorbaHostException(e);
        }
    }

    public void registerServant(String uri, Object servantObject) throws CorbaHostException {
        CorbanameURL details = CorbaHostUtils.getServiceDetails(uri);
        ORB orb = createORB(details.getHost(), details.getPort(), false);
        try {
            NamingContext namingCtx = getNamingContext(orb, details.getNameService());
            for (int i = 0; i < details.getNamePath().size() - 1; i++) {
                NameComponent nc = new NameComponent(details.getNamePath().get(i), "");
                NameComponent[] path = new NameComponent[] {nc};
                try {
                    namingCtx = NamingContextHelper.narrow(namingCtx.resolve(path));
                } catch (Exception e) {
                    namingCtx = namingCtx.bind_new_context(path);
                }
            }
            NameComponent finalName =
                new NameComponent(details.getNamePath().get(details.getNamePath().size() - 1), "");
            try {
                namingCtx.resolve(new NameComponent[] {finalName});
                // no exception means that some object is already registered
                // under this name, we need to crash here
                throw new CorbaHostException(CorbaHostException.BINDING_IN_USE);
View Full Code Here

Examples of org.apache.tuscany.sca.host.corba.CorbanameURL

            handleException(e);
        }
    }

    public void unregisterServant(String uri) throws CorbaHostException {
        CorbanameURL details = CorbaHostUtils.getServiceDetails(uri);
        ORB orb = createORB(details.getHost(), details.getPort(), false);
        try {
            NamingContextExt namingCtx = getNamingContext(orb, details.getNameService());
            namingCtx.unbind(namingCtx.to_name(details.getName()));
        } catch (Exception e) {
            handleException(e);
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.host.corba.CorbanameURL

    }

    public Object lookup(String uri) throws CorbaHostException {
        Object result = null;
        try {
            CorbanameURL url = new CorbanameURL(uri);
            ORB orb = createORB(url.getHost(), url.getPort(), false);
            NamingContextExt context = getNamingContext(orb, url.getNameService());
            result = context.resolve_str(url.getName());
        } catch (Exception e) {
            handleException(e);
        }
        if (result == null) {
            throw new CorbaHostException(CorbaHostException.NO_SUCH_OBJECT);
View Full Code Here

Examples of org.apache.tuscany.sca.host.corba.CorbanameURL

            throw new CorbaHostException(e);
        }
    }

    public void registerServant(String uri, Object servantObject) throws CorbaHostException {
        CorbanameURL details = CorbaHostUtils.getServiceDetails(uri);
        try {
            NamingContext namingCtx = getNamingContext(details.getNameService());
            for (int i = 0; i < details.getNamePath().size() - 1; i++) {
                NameComponent nc = new NameComponent(details.getNamePath().get(i), "");
                NameComponent[] path = new NameComponent[] {nc};
                try {
                    namingCtx = NamingContextHelper.narrow(namingCtx.resolve(path));
                } catch (Exception e) {
                    namingCtx = namingCtx.bind_new_context(path);
                }
            }
            NameComponent finalName =
                new NameComponent(details.getNamePath().get(details.getNamePath().size() - 1), "");
            try {
                namingCtx.resolve(new NameComponent[] {finalName});
                // no exception means that some object is already registered
                // under this name, we need to crash here
                throw new CorbaHostException(CorbaHostException.BINDING_IN_USE);
View Full Code Here

Examples of org.apache.tuscany.sca.host.corba.CorbanameURL

            handleException(e);
        }
    }

    public void unregisterServant(String uri) throws CorbaHostException {
        CorbanameURL details = CorbaHostUtils.getServiceDetails(uri);
        try {
            NamingContextExt namingCtx = getNamingContext(details.getNameService());
            namingCtx.unbind(namingCtx.to_name(details.getName()));
            removeURI(uri);
        } catch (Exception e) {
            handleException(e);
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.host.corba.CorbanameURL

    }

    public Object lookup(String uri) throws CorbaHostException {
        Object result = null;
        try {
            CorbanameURL url = new CorbanameURL(uri);
            NamingContextExt context = getNamingContext(url.getNameService());
            result = context.resolve_str(url.getName());
        } catch (Exception e) {
            // e.printStackTrace();
            handleException(e);
        }
        if (result == null) {
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.