com.github.dynamicextensionsalfresco.proxy.Tracker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alfresco-integration Show documentation
Show all versions of alfresco-integration Show documentation
Adds an OSGi container to alfresco repository supporting dynamic code reloading, classpath isolation and a bunch of other useful features
package com.github.dynamicextensionsalfresco.proxy;
import com.github.dynamicextensionsalfresco.osgi.FrameworkManager;
import com.github.dynamicextensionsalfresco.osgi.FrameworkService;
import org.osgi.framework.Filter;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Tracks services within the embedded OSGi context using interface matching or a custom {@link Filter}.
* When {@link #invokeUsing(ServiceInvoker)} is called, the {@link ServiceInvoker} receives the sole matching instance.
* This pattern is used so that we can avoid keeping a reference to the service. (dynamic nature of service discovery)
*
* @author Laurent Van der Linden
*/
public class Tracker {
private final static Logger logger = LoggerFactory.getLogger(Tracker.class);
private final FilterModel filterModel;
private final FrameworkService frameworkService;
private volatile ServiceTracker
© 2015 - 2025 Weber Informatics LLC | Privacy Policy