Skip to content

Instantly share code, notes, and snippets.

@mathieuancelin
Created May 13, 2011 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathieuancelin/970202 to your computer and use it in GitHub Desktop.
Save mathieuancelin/970202 to your computer and use it in GitHub Desktop.
OSGi bridge for hybrid Java EE app
import java.util.Collection;
import java.util.Properties;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleListener;
import org.osgi.framework.ServiceListener;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
public interface OSGiBridge {
boolean registerBundleListener(BundleListener listener);
boolean registerServiceListener(ServiceListener listener);
<C, S extends C> ServiceRegistration registerService(
Class<C>[] contracts, S service, Properties properties);
<C, S extends C> ServiceRegistration registerService(
Class<C> contract, S service, Properties properties);
ServiceReference getServiceReference(Class<?> contract);
Collection<ServiceReference> getServiceReferences(Class<?> contract, String filter);
Object getService(ServiceReference ref);
void ungetService(ServiceReference ref);
Collection<Bundle> getBundles();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment