Examples of addServiceListener()


Examples of asia.stampy.server.mina.ServerMinaMessageGateway.addServiceListener()

    ServerMinaMessageGateway gateway = new ServerMinaMessageGateway();
    gateway.setPort(1234);
    gateway.setHeartbeat(1000);
    gateway.setAutoShutdown(true);
    gateway.addServiceListener(new MinaServiceAdapter() {

      @Override
      public void sessionDestroyed(IoSession session) throws Exception {
        System.out.println("Session destroyed, exiting...");
        System.exit(0);
View Full Code Here

Examples of com.hellblazer.slp.ServiceScope.addServiceListener()

                                                 executor,
                                                 Generators.randomBasedGenerator());
        ServiceURL url1 = new ServiceURL("service:http://foo.bar/two");
        ServiceURL url2 = new ServiceURL("service:http://foo.bar/one");

        localScope.addServiceListener(serviceListener, "(" + SERVICE_TYPE
                                                       + "=service:http)");

        UUID reference1 = localScope.register(url1,
                                              new HashMap<String, String>());
        localScope.register(url2, new HashMap<String, String>());
View Full Code Here

Examples of javax.jmdns.JmDNS.addServiceListener()

          sinfo.getType());

        machineFactory.newRemoteMachine(url, id, false);
    }

    current.addServiceListener(MDNS_TYPE, this);

      } catch (IOException e) {
    e.printStackTrace();
    throw new RuntimeException(e);
      }
View Full Code Here

Examples of javax.jmdns.JmDNS.addServiceListener()

                jmdns.registerServiceType(argv[i]);
            }
        } else if ((argc == 1) && "-bt".equals(argv[0])) {
            jmdns.addServiceTypeListener(new SampleListener());
        } else if ((argc == 3) && "-bs".equals(argv[0])) {
            jmdns.addServiceListener(argv[1] + "." + argv[2], new SampleListener());
        } else if ((argc > 4) && "-rs".equals(argv[0])) {
            String type = argv[2] + "." + argv[3];
            String name = argv[1];
            Hashtable props = null;
            for (int i = 5 ; i < argc ; i++) {
View Full Code Here

Examples of javax.jmdns.JmDNS.addServiceListener()

            logger.addHandler(handler);
            logger.setLevel(Level.FINER);
            handler.setLevel(Level.FINER);
            */
            JmDNS jmdns = JmDNS.create();
            jmdns.addServiceListener("_http._tcp.local.", new SampleListener());
           
            System.out.println("Press q and Enter, to quit");
            int b;
            while ((b = System.in.read()) != -1 && (char) b != 'q');
            jmdns.close();
View Full Code Here

Examples of javax.jmdns.JmDNS.addServiceListener()

                            // Add Service Listeners
                            for (String type : serviceListeners.keySet()) {
                                List<ServiceListener> listeners = serviceListeners.get(type);
                                synchronized (listeners) {
                                    for (ServiceListener listener : listeners) {
                                        dns.addServiceListener(type, listener);
                                    }
                                }
                            }
                        }
                    });
View Full Code Here

Examples of javax.jmdns.JmDNS.addServiceListener()

            EasyMock.replay(serviceListenerMock);
            // EasyMock.makeThreadSafe(serviceListenerMock, false);

            registry = JmDNS.create();

            registry.addServiceListener(service.getType(), serviceListenerMock);

            registry.registerService(service);

            // We get the service added event when we register the service. However the service has not been resolved at this point.
            // The info associated with the event only has the minimum information i.e. name and type.
View Full Code Here

Examples of javax.jmdns.JmDNS.addServiceListener()

            serviceListenerMock.serviceAdded(capture(capServiceAddedEvent));
            serviceListenerMock.serviceResolved(capture(capServiceResolvedEvent));
            replay(serviceListenerMock);

            registry = JmDNS.create();
            registry.addServiceListener(service.getType(), serviceListenerMock);
            registry.registerService(service);

            // We get the service added event when we register the service. However the service has not been resolved at this point.
            // The info associated with the event only has the minimum information i.e. name and type.
            assertTrue("We did not get the service added event.", capServiceAddedEvent.hasCaptured());
View Full Code Here

Examples of javax.jmdns.JmDNS.addServiceListener()

                logger.setLevel(Level.FINER);
                handler.setLevel(Level.FINER);
            }

            final JmDNS jmdns = JmDNS.create();
            jmdns.addServiceListener("_http._tcp.local.", new SampleListener());

            System.out.println("Press q and Enter, to quit");
            int b;
            while ((b = System.in.read()) != -1 && (char) b != 'q') {
                /* Stub */
 
View Full Code Here

Examples of javax.jmdns.JmDNS.addServiceListener()

                jmdns.registerServiceType(argv[i]);
            }
        } else if ((argc == 1) && "-bt".equals(argv[0])) {
            jmdns.addServiceTypeListener(new SampleListener());
        } else if ((argc == 3) && "-bs".equals(argv[0])) {
            jmdns.addServiceListener(argv[1] + "." + argv[2], new SampleListener());
        } else if ((argc > 4) && "-rs".equals(argv[0])) {
            String type = argv[2] + "." + argv[3];
            String name = argv[1];
            Hashtable<String, Object> props = null;
            for (int i = 5; i < argc; i++) {
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.