Package org.apache.tuscany.sca.host.corba

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


    private Map<Integer, TransientNameServer> localServers = new ConcurrentHashMap<Integer, TransientNameServer>();
    private Map<Integer, Integer> clientsCount = new ConcurrentHashMap<Integer, Integer>();
    private CorbaHost targetHost = new DefaultCorbaHost();

    public void registerServant(String uri, Object servantObject) throws CorbaHostException {
        CorbanameURL details = new CorbanameURL(uri);
        if (SocketUtil.isLocalhost(details.getHost())) {
            createLocalNameServer(details.getPort());
        }
        targetHost.registerServant(uri, servantObject);
    }
View Full Code Here


        targetHost.registerServant(uri, servantObject);
    }

    public void unregisterServant(String uri) throws CorbaHostException {
        targetHost.unregisterServant(uri);
        CorbanameURL details = new CorbanameURL(uri);
        if (SocketUtil.isLocalhost(details.getHost())) {
            releaseLocalNameServer(details.getPort());
        }
    }
View Full Code Here

            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

            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

    }

    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

            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

            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

    }

    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

    private Map<Integer, TransientNameServer> localServers = new ConcurrentHashMap<Integer, TransientNameServer>();
    private Map<Integer, Integer> clientsCount = new ConcurrentHashMap<Integer, Integer>();
    private CorbaHost targetHost = new DefaultCorbaHost();

    public void registerServant(String uri, Object servantObject) throws CorbaHostException {
        CorbanameURL details = new CorbanameURL(uri);
        if (SocketUtil.isLocalhost(details.getHost())) {
            createLocalNameServer(details.getPort());
        }
        targetHost.registerServant(uri, servantObject);
    }
View Full Code Here

        targetHost.registerServant(uri, servantObject);
    }

    public void unregisterServant(String uri) throws CorbaHostException {
        targetHost.unregisterServant(uri);
        CorbanameURL details = new CorbanameURL(uri);
        if (SocketUtil.isLocalhost(details.getHost())) {
            releaseLocalNameServer(details.getPort());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.host.corba.CorbanameURL

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.