public class MockBundleContext extends Object implements org.osgi.framework.BundleContext
Constructor and Description |
---|
MockBundleContext(MockBundle bundle) |
Modifier and Type | Method and Description |
---|---|
void |
addBundleListener(org.osgi.framework.BundleListener bundleListener) |
void |
addFrameworkListener(org.osgi.framework.FrameworkListener frameworkListener) |
void |
addServiceListener(org.osgi.framework.ServiceListener serviceListener) |
void |
addServiceListener(org.osgi.framework.ServiceListener serviceListener,
String s) |
org.osgi.framework.Filter |
createFilter(String s) |
org.osgi.framework.ServiceReference[] |
getAllServiceReferences(String s,
String s1) |
org.osgi.framework.Bundle |
getBundle() |
org.osgi.framework.Bundle |
getBundle(long l) |
org.osgi.framework.Bundle |
getBundle(String location) |
org.osgi.framework.Bundle[] |
getBundles() |
File |
getDataFile(String s) |
String |
getProperty(String s) |
Object |
getService(org.osgi.framework.ServiceReference serviceReference) |
<S> org.osgi.framework.ServiceObjects<S> |
getServiceObjects(org.osgi.framework.ServiceReference<S> reference) |
<S> org.osgi.framework.ServiceReference<S> |
getServiceReference(Class<S> clazz) |
org.osgi.framework.ServiceReference |
getServiceReference(String s) |
<S> Collection<org.osgi.framework.ServiceReference<S>> |
getServiceReferences(Class<S> clazz,
String filter) |
org.osgi.framework.ServiceReference[] |
getServiceReferences(String s,
String s1) |
org.osgi.framework.Bundle |
installBundle(String s) |
org.osgi.framework.Bundle |
installBundle(String s,
InputStream inputStream) |
<S> org.osgi.framework.ServiceRegistration<S> |
registerService(Class<S> clazz,
S service,
Dictionary<String,?> properties) |
<S> org.osgi.framework.ServiceRegistration<S> |
registerService(Class<S> clazz,
org.osgi.framework.ServiceFactory<S> factory,
Dictionary<String,?> properties) |
org.osgi.framework.ServiceRegistration |
registerService(String[] strings,
Object o,
Dictionary dictionary) |
org.osgi.framework.ServiceRegistration |
registerService(String s,
Object o,
Dictionary dictionary) |
void |
removeBundleListener(org.osgi.framework.BundleListener bundleListener) |
void |
removeFrameworkListener(org.osgi.framework.FrameworkListener frameworkListener) |
void |
removeServiceListener(org.osgi.framework.ServiceListener serviceListener) |
boolean |
ungetService(org.osgi.framework.ServiceReference serviceReference) |
public MockBundleContext(MockBundle bundle)
public String getProperty(String s)
getProperty
in interface org.osgi.framework.BundleContext
public org.osgi.framework.Bundle getBundle()
getBundle
in interface org.osgi.framework.BundleContext
getBundle
in interface org.osgi.framework.BundleReference
public org.osgi.framework.Bundle installBundle(String s) throws org.osgi.framework.BundleException
installBundle
in interface org.osgi.framework.BundleContext
org.osgi.framework.BundleException
public org.osgi.framework.Bundle installBundle(String s, InputStream inputStream) throws org.osgi.framework.BundleException
installBundle
in interface org.osgi.framework.BundleContext
org.osgi.framework.BundleException
public org.osgi.framework.Bundle getBundle(long l)
getBundle
in interface org.osgi.framework.BundleContext
public org.osgi.framework.Bundle[] getBundles()
getBundles
in interface org.osgi.framework.BundleContext
public void addServiceListener(org.osgi.framework.ServiceListener serviceListener, String s) throws org.osgi.framework.InvalidSyntaxException
addServiceListener
in interface org.osgi.framework.BundleContext
org.osgi.framework.InvalidSyntaxException
public void addServiceListener(org.osgi.framework.ServiceListener serviceListener)
addServiceListener
in interface org.osgi.framework.BundleContext
public void removeServiceListener(org.osgi.framework.ServiceListener serviceListener)
removeServiceListener
in interface org.osgi.framework.BundleContext
public void addBundleListener(org.osgi.framework.BundleListener bundleListener)
addBundleListener
in interface org.osgi.framework.BundleContext
public void removeBundleListener(org.osgi.framework.BundleListener bundleListener)
removeBundleListener
in interface org.osgi.framework.BundleContext
public void addFrameworkListener(org.osgi.framework.FrameworkListener frameworkListener)
addFrameworkListener
in interface org.osgi.framework.BundleContext
public void removeFrameworkListener(org.osgi.framework.FrameworkListener frameworkListener)
removeFrameworkListener
in interface org.osgi.framework.BundleContext
public org.osgi.framework.ServiceRegistration registerService(String[] strings, Object o, Dictionary dictionary)
registerService
in interface org.osgi.framework.BundleContext
public org.osgi.framework.ServiceRegistration registerService(String s, Object o, Dictionary dictionary)
registerService
in interface org.osgi.framework.BundleContext
public org.osgi.framework.ServiceReference[] getServiceReferences(String s, String s1) throws org.osgi.framework.InvalidSyntaxException
getServiceReferences
in interface org.osgi.framework.BundleContext
org.osgi.framework.InvalidSyntaxException
public org.osgi.framework.ServiceReference[] getAllServiceReferences(String s, String s1) throws org.osgi.framework.InvalidSyntaxException
getAllServiceReferences
in interface org.osgi.framework.BundleContext
org.osgi.framework.InvalidSyntaxException
public org.osgi.framework.ServiceReference getServiceReference(String s)
getServiceReference
in interface org.osgi.framework.BundleContext
public Object getService(org.osgi.framework.ServiceReference serviceReference)
getService
in interface org.osgi.framework.BundleContext
public boolean ungetService(org.osgi.framework.ServiceReference serviceReference)
ungetService
in interface org.osgi.framework.BundleContext
public File getDataFile(String s)
getDataFile
in interface org.osgi.framework.BundleContext
public org.osgi.framework.Filter createFilter(String s) throws org.osgi.framework.InvalidSyntaxException
createFilter
in interface org.osgi.framework.BundleContext
org.osgi.framework.InvalidSyntaxException
public <S> org.osgi.framework.ServiceRegistration<S> registerService(Class<S> clazz, S service, Dictionary<String,?> properties)
registerService
in interface org.osgi.framework.BundleContext
public <S> org.osgi.framework.ServiceRegistration<S> registerService(Class<S> clazz, org.osgi.framework.ServiceFactory<S> factory, Dictionary<String,?> properties)
registerService
in interface org.osgi.framework.BundleContext
public <S> org.osgi.framework.ServiceReference<S> getServiceReference(Class<S> clazz)
getServiceReference
in interface org.osgi.framework.BundleContext
public <S> Collection<org.osgi.framework.ServiceReference<S>> getServiceReferences(Class<S> clazz, String filter) throws org.osgi.framework.InvalidSyntaxException
getServiceReferences
in interface org.osgi.framework.BundleContext
org.osgi.framework.InvalidSyntaxException
public <S> org.osgi.framework.ServiceObjects<S> getServiceObjects(org.osgi.framework.ServiceReference<S> reference)
getServiceObjects
in interface org.osgi.framework.BundleContext
public org.osgi.framework.Bundle getBundle(String location)
getBundle
in interface org.osgi.framework.BundleContext
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.