Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLOntologyChangeBroadcastStrategy


            return;
        }
        for (OWLOntologyChangeListener listener : new ArrayList<>(
                listenerMap.keySet())) {
            assert listener != null;
            OWLOntologyChangeBroadcastStrategy strategy = listenerMap
                    .get(listener);
            if (strategy == null) {
                // This listener may have been removed during the broadcast of
                // the changes, so when we attempt to retrieve it from the map
                // it isn't there (because we iterate over a copy).
                continue;
            }
            try {
                // Handle exceptions on a per listener basis. If we have
                // badly behaving listeners, we don't want one listener
                // to prevent the other listeners from receiving events.
                strategy.broadcastChanges(listener, changes);
            } catch (Exception e) {
                LOGGER.warn("BADLY BEHAVING LISTENER: {} has been removed",
                        e.getMessage(), e);
                listenerMap.remove(listener);
            }
View Full Code Here


    private void broadcastChanges(List<? extends OWLOntologyChange> changes) {
        if (!broadcastChanges) {
            return;
        }
        for (OWLOntologyChangeListener listener : new ArrayList<OWLOntologyChangeListener>(listenerMap.keySet())) {
            OWLOntologyChangeBroadcastStrategy strategy = listenerMap.get(listener);
            if (strategy == null) {
                // This listener may have been removed during the broadcast of the changes,
                // so when we attempt to retrieve it from the map it isn't there (because
                // we iterate over a copy).
                continue;
            }
            try {
                // Handle exceptions on a per listener basis.  If we have
                // badly behaving listeners, we don't want one listener
                // to prevent the other listeners from receiving events.
                strategy.broadcastChanges(listener, changes);
            }
            catch (Throwable e) {
                logger.warning("BADLY BEHAVING LISTENER: " + e);
                e.printStackTrace();
            }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.OWLOntologyChangeBroadcastStrategy

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.