Examples of ServiceRegistration


Examples of org.osgi.framework.ServiceRegistration

    }

    public void disableQueueProcessing(@Nonnull String agentName) {
        synchronized (jobConsumers) {
            log.info("unregistering job consumer for agent {}", agentName);
            ServiceRegistration jobReg = jobConsumers.remove(agentName);
            if (jobReg != null) {
                jobReg.unregister();
                log.info("job consumer for agent {} unregistered", agentName);
            }
        }
    }
View Full Code Here

Examples of org.osgi.framework.ServiceRegistration

        properties.put(EventConstants.EVENT_TOPIC, new String[]{SlingConstants.TOPIC_RESOURCE_ADDED,
                SlingConstants.TOPIC_RESOURCE_CHANGED, SlingConstants.TOPIC_RESOURCE_REMOVED});
        log.info("trigger agent {} on path '{}'", requestHandler, path);

        properties.put(EventConstants.EVENT_FILTER, "(path=" + path + "/*)");
        ServiceRegistration triggerPathEventRegistration = bundleContext.registerService(EventHandler.class.getName(),
                new TriggerAgentEventListener(requestHandler), properties);
        if (triggerPathEventRegistration != null) {
            registrations.put(requestHandler.toString(), triggerPathEventRegistration);
        } else {
            throw new ReplicationTriggerException("cannot register event handler service for triggering agent");
View Full Code Here

Examples of org.osgi.framework.ServiceRegistration

            throw new ReplicationTriggerException("cannot register event handler service for triggering agent");
        }
    }

    public void unregister(@Nonnull ReplicationRequestHandler requestHandler) throws ReplicationTriggerException {
        ServiceRegistration serviceRegistration = registrations.get(requestHandler.toString());
        if (serviceRegistration != null) {
            serviceRegistration.unregister();
        }
    }
View Full Code Here

Examples of org.osgi.framework.ServiceRegistration

        properties.put(EventConstants.EVENT_TOPIC, ReplicationEvent.getTopic(ReplicationEventType.PACKAGE_INSTALLED));
        log.info("handler {} will chain replicate on path '{}'", requestHandler, pathPrefix);

//            properties.put(EventConstants.EVENT_FILTER, "(path=" + path + "/*)");
        if (bundleContext != null) {
            ServiceRegistration triggerPathEventRegistration = bundleContext.registerService(EventHandler.class.getName(),
                    new TriggerAgentEventListener(requestHandler, pathPrefix), properties);
            if (triggerPathEventRegistration != null) {
                registrations.put(requestHandler.toString(), triggerPathEventRegistration);
            }
        } else {
View Full Code Here

Examples of org.osgi.framework.ServiceRegistration

        }
    }

    public void unregister(@Nonnull ReplicationRequestHandler requestHandler) throws ReplicationTriggerException {
        ServiceRegistration serviceRegistration = registrations.get(requestHandler.toString());
        if (serviceRegistration != null) {
            serviceRegistration.unregister();
        }
    }
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.