Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A small wrapper around org.osgi.util.tracker.ServiceTracker that opens it once on first access and closes it when the OSGi bundle stops.

Example:

public class Activator implements BundleActivator {

    private volatile static TrackerRegister register; 
    
    @Override
	public void start(BundleContext context) throws Exception {
        register = new TrackerRegister(context);
	}
	
	@Override
	public void stop(BundleContext context) throws Exception {
		register.close();
	}
	
	public static TrackerRegister getRegister()
    {
        return register;
    }
}

[...]

public class SomeWhere
{
    public void foo(String[] args)
    {
        SomeType service = Activator.getRegister().getService(SomeType.class);
        service.bar();
    }
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages