Package net.jini.lookup.entry

Examples of net.jini.lookup.entry.Host


                logger.trace("Already have {}, service count now {}", item, serviceList.size());
            }
        }
        int ndx = -1;
        if (hostAddress != null) {
            Host host = getHostEntry(item);
            if (host != null) {
                if (hostAddress.equals(host.hostName)) {
                    for (ServiceItem si : serviceList) {
                        Host h = getHostEntry(si);
                        if (h == null) {
                            ndx = serviceList.indexOf(si);
                            break;
                        } else if (h.hostName == null) {
                            ndx = serviceList.indexOf(si);
View Full Code Here


    /*
     * Get the net.jini.lookup.entry.Host from the attribute set. Return null
     * if not found.
     */
    private Host getHostEntry(ServiceItem item) {
        Host host = null;
        if(item!=null && item.attributeSets!=null) {
            for (Entry e : item.attributeSets) {
                if (e instanceof Host) {
                    host = (Host) e;
                    break;
View Full Code Here

     * @param attrs Array of attributes
     *
     * @return A Host object
     */
    public static Host getHost(final Entry[] attrs) {
        Host host = null;
        for (Entry attr : attrs) {
            if (attr.getClass().getName().equals(
                Host.class.getName())) {
                if (attr instanceof Host) {
                    host = (Host) attr;
                    break;
                } else {
                    /*
                     * This addresses the issue where the discovered service
                     * has a Host but there is a class loading
                     * problem, which results in the classes being loaded by
                     * sibling class loaders, and assignability doesnt work.
                     */
                    host = new Host();
                    try {
                        Field hn = attr.getClass().getDeclaredField("hostName");
                        host.hostName = (String) hn.get(attr);
                        break;
                    } catch (Exception e) {
View Full Code Here

         * hostname or address matches an array element in the
         * <code>hostNames</code> array, return <code>true</code>, otherwise,
         * return <code>false</code>
         */
        public boolean hostNameMatches(final Entry[] attrs) {
            Host host = getHost(attrs);
            if(host!=null)
                return(checkHosts(host));
            ComputeResourceInfo computeResourceInfo = getComputeResourceInfo(attrs);
            if(computeResourceInfo!=null)
                return(checkHosts(computeResourceInfo));
View Full Code Here

                        updateHost();
                    } catch(RemoteException e) {
                        e.printStackTrace();
                    }
                } else {
                    Host host = getHost(item.attributeSets);
                    if(host!=null) {
                        sInfo.setHost(host.hostName);
                        updateHost();
                    } else {
                        ComputeResourceInfo computeResourceInfo = getComputeResourceInfo(item.attributeSets);
View Full Code Here

                        buff.append("\n");
                    }
                    buff.append("JVM Version=");
                    buff.append(aInfo.jvmVersion);
                } else {
                    Host host = getHost(node.getServiceItem().attributeSets);
                    if(host!=null) {
                        buff.append("\n");
                        buff.append(host.hostName);
                    }
                }
View Full Code Here

TOP

Related Classes of net.jini.lookup.entry.Host

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.