Examples of ServiceEvent


Examples of atg.nucleus.ServiceEvent

        );
        //    newRepository.nameContextElementBound(bindingEvent);
        //    nc.removeElement(this.getName()+"_ver");
        //    super.setWrappedRepository(null);

        ServiceEvent ev = new ServiceEvent(this, getWrappedRepository(), getNucleus(), c);
    /*
     * We are purposefully not putting the new repository into the parent's name
     * context. The existing repository is always the valid one. We're starting
     * this new guy, then we're going to synchronize on the repository and get
     * all of its info into us.
View Full Code Here

Examples of com.hellblazer.slp.ServiceEvent

            final ServiceReference ref = reference;
            executor.execute(new Runnable() {
                @Override
                public void run() {
                    try {
                        listener.serviceChanged(new ServiceEvent(
                                                                 EventType.REGISTERED,
                                                                 ref));
                    } catch (Throwable e) {
                        log.error("Error when notifying listener on reference "
                                  + EventType.REGISTERED, e);
View Full Code Here

Examples of javax.jmdns.ServiceEvent

                final String type = rec.getName();
                final String name = ((DNSRecord.Pointer) rec).getAlias();
                // DNSRecord old = (DNSRecord)services.get(name.toLowerCase());
                if (!expired) {
                    // new record
                    final ServiceEvent event = new ServiceEventImpl(this, type, toUnqualifiedName(type, name), null);
                    for (final Iterator iterator = serviceListenerList.iterator(); iterator.hasNext();) {
                        ((ServiceListener) iterator.next()).serviceAdded(event);
                    }
                } else {
                    // expire record
                    final ServiceEvent event = new ServiceEventImpl(this, type, toUnqualifiedName(type, name), null);
                    for (final Iterator iterator = serviceListenerList.iterator(); iterator.hasNext();) {
                        ((ServiceListener) iterator.next()).serviceRemoved(event);
                    }
                }
            }
View Full Code Here

Examples of javax.jmdns.ServiceEvent

    void handleServiceResolved(ServiceEvent event) {
        List<ServiceListenerStatus> list = _serviceListeners.get(event.getType().toLowerCase());
        final List<ServiceListenerStatus> listCopy;
        if ((list != null) && (!list.isEmpty())) {
            if ((event.getInfo() != null) && event.getInfo().hasData()) {
                final ServiceEvent localEvent = event;
                synchronized (list) {
                    listCopy = new ArrayList<ServiceListenerStatus>(list);
                }
                for (final ServiceListenerStatus listener : listCopy) {
                    _executor.submit(new Runnable() {
View Full Code Here

Examples of javax.jmdns.ServiceEvent

        }
        if (!_serviceTypes.containsKey(loname) && !application.toLowerCase().equals("dns-sd") && !domain.toLowerCase().endsWith("in-addr.arpa") && !domain.toLowerCase().endsWith("ip6.arpa")) {
            typeAdded = _serviceTypes.putIfAbsent(loname, new ServiceTypeEntry(name)) == null;
            if (typeAdded) {
                final ServiceTypeListenerStatus[] list = _typeListeners.toArray(new ServiceTypeListenerStatus[_typeListeners.size()]);
                final ServiceEvent event = new ServiceEventImpl(this, name, "", null);
                for (final ServiceTypeListenerStatus status : list) {
                    _executor.submit(new Runnable() {
                        /** {@inheritDoc} */
                        @Override
                        public void run() {
                            status.serviceTypeAdded(event);
                        }
                    });
                }
            }
        }
        if (subtype.length() > 0) {
            ServiceTypeEntry subtypes = _serviceTypes.get(loname);
            if ((subtypes != null) && (!subtypes.contains(subtype))) {
                synchronized (subtypes) {
                    if (!subtypes.contains(subtype)) {
                        typeAdded = true;
                        subtypes.add(subtype);
                        final ServiceTypeListenerStatus[] list = _typeListeners.toArray(new ServiceTypeListenerStatus[_typeListeners.size()]);
                        final ServiceEvent event = new ServiceEventImpl(this, "_" + subtype + "._sub." + name, "", null);
                        for (final ServiceTypeListenerStatus status : list) {
                            _executor.submit(new Runnable() {
                                /** {@inheritDoc} */
                                @Override
                                public void run() {
View Full Code Here

Examples of javax.jmdns.ServiceEvent

            }
        }
        if (DNSRecordType.TYPE_PTR.equals(rec.getRecordType()))
        // if (DNSRecordType.TYPE_PTR.equals(rec.getRecordType()) || DNSRecordType.TYPE_SRV.equals(rec.getRecordType()))
        {
            ServiceEvent event = rec.getServiceEvent(this);
            if ((event.getInfo() == null) || !event.getInfo().hasData()) {
                // We do not care about the subtype because the info is only used if complete and the subtype will then be included.
                ServiceInfo info = this.getServiceInfoFromCache(event.getType(), event.getName(), "", false);
                if (info.hasData()) {
                    event = new ServiceEventImpl(this, event.getType(), event.getName(), info);
                }
            }

            List<ServiceListenerStatus> list = _serviceListeners.get(event.getType().toLowerCase());
            final List<ServiceListenerStatus> serviceListenerList;
            if (list != null) {
                synchronized (list) {
                    serviceListenerList = new ArrayList<ServiceListenerStatus>(list);
                }
            } else {
                serviceListenerList = Collections.emptyList();
            }
            if (logger.isLoggable(Level.FINEST)) {
                logger.finest(this.getName() + ".updating record for event: " + event + " list " + serviceListenerList + " operation: " + operation);
            }
            if (!serviceListenerList.isEmpty()) {
                final ServiceEvent localEvent = event;

                switch (operation) {
                    case Add:
                        for (final ServiceListenerStatus listener : serviceListenerList) {
                            if (listener.isSynchronous()) {
View Full Code Here

Examples of javax.jmdns.ServiceEvent

                    break;
            }
            if (serviceUpdated && this.hasData()) {
                JmDNSImpl dns = this.getDns();
                if (dns != null) {
                    ServiceEvent event = ((DNSRecord) rec).getServiceEvent(dns);
                    event = new ServiceEventImpl(dns, event.getType(), event.getName(), this);
                    dns.handleServiceResolved(event);
                }
            }
            // This is done, to notify the wait loop in method JmDNS.waitForInfoData(ServiceInfo info, int timeout);
            synchronized (this) {
View Full Code Here

Examples of net.jini.core.lookup.ServiceEvent

        public Listener() throws RemoteException {
            super();
        }
        /** Method called remotely by lookup to handle the generated event. */
        public void notify(RemoteEvent ev) {
            ServiceEvent srvcEvnt = (ServiceEvent)ev;
            evntVec.addElement(srvcEvnt);
            try {
                QATestUtils.SrvcAttrTuple tuple = (QATestUtils.SrvcAttrTuple)
                                      (srvcEvnt.getRegistrationObject().get());

                receivedTuples.addElement(new QATestUtils.SrvcAttrTuple
                                                   (srvcItems,tmplAttrs,
                                                    tuple.getSrvcObj(),
                                                    tuple.getAttrObj(),
                                                    srvcEvnt.getTransition()));
            } catch (ClassNotFoundException e) {
    logger.log(Level.INFO, "Unexpected exception", e);
            } catch (IOException e) {
    logger.log(Level.INFO, "Unexpected exception", e);
            }
View Full Code Here

Examples of net.jini.core.lookup.ServiceEvent

        public Listener() throws RemoteException {
            super();
        }
        /** Method called remotely by lookup to handle the generated event. */
        public void notify(RemoteEvent ev) {
            ServiceEvent srvcEvnt = (ServiceEvent)ev;
            evntVec.addElement(srvcEvnt);
            try {
                QATestUtils.SrvcAttrTuple tuple = (QATestUtils.SrvcAttrTuple)
                                      (srvcEvnt.getRegistrationObject().get());

                receivedTuples.addElement(new QATestUtils.SrvcAttrTuple
                                                   (srvcItems,tmplAttrs,
                                                    tuple.getSrvcObj(),
                                                    tuple.getAttrObj(),
                                                    srvcEvnt.getTransition()));
            } catch (ClassNotFoundException e) {
                logger.log(Level.INFO, "Unexpected exception", e);
            } catch (IOException e) {
                logger.log(Level.INFO, "Unexpected exception", e);
            }
View Full Code Here

Examples of net.jini.core.lookup.ServiceEvent

        public Listener() throws RemoteException {
            super();
        }
        /** Method called remotely by lookup to handle the generated event. */
        public void notify(RemoteEvent ev) {
            ServiceEvent srvcEvnt = (ServiceEvent)ev;
            evntVec.addElement(srvcEvnt);
            try {
                QATestUtils.SrvcAttrTuple tuple = (QATestUtils.SrvcAttrTuple)
                                      (srvcEvnt.getRegistrationObject().get());

                receivedTuples.addElement(new QATestUtils.SrvcAttrTuple
                                                   (srvcItems,modAttrs,
                                                    tuple.getSrvcObj(),
                                                    tuple.getAttrObj(),
                                                    srvcEvnt.getTransition()));
            } catch (ClassNotFoundException e) {
                logger.log(Level.INFO, "Unexpected exception", e);
            } catch (IOException e) {
                logger.log(Level.INFO, "Unexpected exception", e);
            }
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.