Package javax.jmdns

Examples of javax.jmdns.ServiceInfo


            jmdns = null;
        }
    }

    public void registerService(String name) throws IOException {
        ServiceInfo si = createServiceInfo(name, new HashMap());
        serviceInfos.add(si);
        getJmdns().registerService(si);
    }
View Full Code Here


  public void serviceAdded(ServiceEvent serviceEvent)
  {
    logger.log(Level.INFO, "Service added: " + serviceEvent);

    ServiceInfo serviceInfo = serviceEvent.getInfo();
    if(serviceInfo == null || serviceInfo.getInetAddress() == null)
    {
      serviceInfo = serviceEvent.getDNS().getServiceInfo(serviceEvent.getType(), serviceEvent.getName(), 2000);
    }
    JettyCommandService.addDevice(new Device(serviceEvent.getName(), serviceInfo.getInetAddress(), serviceInfo.getPort()));
  }
View Full Code Here

  public void serviceRemoved(ServiceEvent serviceEvent)
  {
    logger.log(Level.INFO, "Service removed: " + serviceEvent);
   
    ServiceInfo serviceInfo = serviceEvent.getInfo();
    if(serviceInfo == null || serviceInfo.getInetAddress() == null)
    {
      serviceInfo = serviceEvent.getDNS().getServiceInfo(serviceEvent.getType(), serviceEvent.getName(), 2000);
    }
    Device device = new Device(serviceEvent.getName(), serviceInfo.getInetAddress(), serviceInfo.getPort());
    JettyCommandService.removeDevice(device.getId());
  }
View Full Code Here

    }

    public void stop() {
        if (jmdns != null) {
            for (Iterator<ServiceInfo> iter = serviceInfos.iterator(); iter.hasNext();) {
                ServiceInfo si = iter.next();
                jmdns.unregisterService(si);
            }

            // Close it down async since this could block for a while.
            final JmDNS closeTarget = jmdns;
View Full Code Here

            jmdns = null;
        }
    }

    public void registerService(String name) throws IOException {
        ServiceInfo si = createServiceInfo(name, new HashMap());
        serviceInfos.add(si);
        getJmdns().registerService(si);
    }
View Full Code Here

        int port = MapHelper.getInt(map, "port", 0);

        if (log.isDebugEnabled()) {
            log.debug("Registering service type: " + type + " name: " + name + " details: " + map);
        }
        return new ServiceInfo(type, name, port, weight, priority, new Hashtable(map));
    }
View Full Code Here

    }

    public void stop() {
        if( jmdns!=null ) {
            for (Iterator iter = serviceInfos.iterator(); iter.hasNext();) {
                ServiceInfo si = (ServiceInfo) iter.next();
                jmdns.unregisterService(si);
            }
           
            // Close it down async since this could block for a while.
            final JmDNS closeTarget = jmdns;
View Full Code Here

            jmdns=null;
        }
    }
   
    public void registerService(String name) throws IOException {
        ServiceInfo si = createServiceInfo(name, new HashMap());
        serviceInfos.add(si);
        getJmdns().registerService(si);
    }
View Full Code Here

        String type = getType();

        if (log.isDebugEnabled()) {
            log.debug("Registering service type: " + type + " name: " + name + " details: " + map);
        }
        return new ServiceInfo(type, name+"."+type, port, weight, priority, "");
    }
View Full Code Here

        public void serviceRemoved(ServiceEvent event) {
            String svcName = event.getName();
            // logger.debug("NAMEDREMOVED " + event.getType() + " : " +
            // svcName);
            ServiceInfo svcInfo = event.getInfo();
            if (svcInfo != null) {
                String svcHost = svcInfo.getHostAddress();
                if (poolSet.contains(svcHost)) {
                    logger.debug("Removed" + svcName);
                    foundDead(new InetSocketAddress(svcHost, svcInfo.getPort()));
                }
                if (pendingResolution.contains(svcName)) {
                    pendingResolution.remove(svcName);
                }
            }
View Full Code Here

TOP

Related Classes of javax.jmdns.ServiceInfo

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.