Class MockBundleContext
java.lang.Object
org.apache.sling.commons.testing.osgi.MockBundleContext
- All Implemented Interfaces:
org.osgi.framework.BundleContext,org.osgi.framework.BundleReference
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBundleListener(org.osgi.framework.BundleListener bundleListener) voidaddFrameworkListener(org.osgi.framework.FrameworkListener frameworkListener) voidaddServiceListener(org.osgi.framework.ServiceListener serviceListener) voidaddServiceListener(org.osgi.framework.ServiceListener serviceListener, String s) org.osgi.framework.Filterorg.osgi.framework.ServiceReference[]getAllServiceReferences(String s, String s1) org.osgi.framework.Bundleorg.osgi.framework.BundlegetBundle(long l) org.osgi.framework.Bundleorg.osgi.framework.Bundle[]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<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.Bundleorg.osgi.framework.BundleinstallBundle(String s, InputStream inputStream) <S> org.osgi.framework.ServiceRegistration<S> registerService(Class<S> clazz, org.osgi.framework.ServiceFactory<S> factory, Dictionary<String, ?> properties) <S> org.osgi.framework.ServiceRegistration<S> registerService(Class<S> clazz, S service, Dictionary<String, ?> properties) org.osgi.framework.ServiceRegistrationregisterService(String[] strings, Object o, Dictionary dictionary) org.osgi.framework.ServiceRegistrationregisterService(String s, Object o, Dictionary dictionary) voidremoveBundleListener(org.osgi.framework.BundleListener bundleListener) voidremoveFrameworkListener(org.osgi.framework.FrameworkListener frameworkListener) voidremoveServiceListener(org.osgi.framework.ServiceListener serviceListener) booleanungetService(org.osgi.framework.ServiceReference serviceReference)
-
Constructor Details
-
MockBundleContext
-
-
Method Details
-
getProperty
- Specified by:
getPropertyin interfaceorg.osgi.framework.BundleContext
-
getBundle
public org.osgi.framework.Bundle getBundle()- Specified by:
getBundlein interfaceorg.osgi.framework.BundleContext- Specified by:
getBundlein interfaceorg.osgi.framework.BundleReference
-
installBundle
- Specified by:
installBundlein interfaceorg.osgi.framework.BundleContext- Throws:
org.osgi.framework.BundleException
-
installBundle
public org.osgi.framework.Bundle installBundle(String s, InputStream inputStream) throws org.osgi.framework.BundleException - Specified by:
installBundlein interfaceorg.osgi.framework.BundleContext- Throws:
org.osgi.framework.BundleException
-
getBundle
public org.osgi.framework.Bundle getBundle(long l) - Specified by:
getBundlein interfaceorg.osgi.framework.BundleContext
-
getBundles
public org.osgi.framework.Bundle[] getBundles()- Specified by:
getBundlesin interfaceorg.osgi.framework.BundleContext
-
addServiceListener
public void addServiceListener(org.osgi.framework.ServiceListener serviceListener, String s) throws org.osgi.framework.InvalidSyntaxException - Specified by:
addServiceListenerin interfaceorg.osgi.framework.BundleContext- Throws:
org.osgi.framework.InvalidSyntaxException
-
addServiceListener
public void addServiceListener(org.osgi.framework.ServiceListener serviceListener) - Specified by:
addServiceListenerin interfaceorg.osgi.framework.BundleContext
-
removeServiceListener
public void removeServiceListener(org.osgi.framework.ServiceListener serviceListener) - Specified by:
removeServiceListenerin interfaceorg.osgi.framework.BundleContext
-
addBundleListener
public void addBundleListener(org.osgi.framework.BundleListener bundleListener) - Specified by:
addBundleListenerin interfaceorg.osgi.framework.BundleContext
-
removeBundleListener
public void removeBundleListener(org.osgi.framework.BundleListener bundleListener) - Specified by:
removeBundleListenerin interfaceorg.osgi.framework.BundleContext
-
addFrameworkListener
public void addFrameworkListener(org.osgi.framework.FrameworkListener frameworkListener) - Specified by:
addFrameworkListenerin interfaceorg.osgi.framework.BundleContext
-
removeFrameworkListener
public void removeFrameworkListener(org.osgi.framework.FrameworkListener frameworkListener) - Specified by:
removeFrameworkListenerin interfaceorg.osgi.framework.BundleContext
-
registerService
public org.osgi.framework.ServiceRegistration registerService(String[] strings, Object o, Dictionary dictionary) - Specified by:
registerServicein interfaceorg.osgi.framework.BundleContext
-
registerService
public org.osgi.framework.ServiceRegistration registerService(String s, Object o, Dictionary dictionary) - Specified by:
registerServicein interfaceorg.osgi.framework.BundleContext
-
getServiceReferences
public org.osgi.framework.ServiceReference[] getServiceReferences(String s, String s1) throws org.osgi.framework.InvalidSyntaxException - Specified by:
getServiceReferencesin interfaceorg.osgi.framework.BundleContext- Throws:
org.osgi.framework.InvalidSyntaxException
-
getAllServiceReferences
public org.osgi.framework.ServiceReference[] getAllServiceReferences(String s, String s1) throws org.osgi.framework.InvalidSyntaxException - Specified by:
getAllServiceReferencesin interfaceorg.osgi.framework.BundleContext- Throws:
org.osgi.framework.InvalidSyntaxException
-
getServiceReference
- Specified by:
getServiceReferencein interfaceorg.osgi.framework.BundleContext
-
getService
- Specified by:
getServicein interfaceorg.osgi.framework.BundleContext
-
ungetService
public boolean ungetService(org.osgi.framework.ServiceReference serviceReference) - Specified by:
ungetServicein interfaceorg.osgi.framework.BundleContext
-
getDataFile
- Specified by:
getDataFilein interfaceorg.osgi.framework.BundleContext
-
createFilter
public org.osgi.framework.Filter createFilter(String s) throws org.osgi.framework.InvalidSyntaxException - Specified by:
createFilterin interfaceorg.osgi.framework.BundleContext- Throws:
org.osgi.framework.InvalidSyntaxException
-
registerService
public <S> org.osgi.framework.ServiceRegistration<S> registerService(Class<S> clazz, S service, Dictionary<String, ?> properties) - Specified by:
registerServicein interfaceorg.osgi.framework.BundleContext
-
registerService
public <S> org.osgi.framework.ServiceRegistration<S> registerService(Class<S> clazz, org.osgi.framework.ServiceFactory<S> factory, Dictionary<String, ?> properties) - Specified by:
registerServicein interfaceorg.osgi.framework.BundleContext
-
getServiceReference
- Specified by:
getServiceReferencein interfaceorg.osgi.framework.BundleContext
-
getServiceReferences
public <S> Collection<org.osgi.framework.ServiceReference<S>> getServiceReferences(Class<S> clazz, String filter) throws org.osgi.framework.InvalidSyntaxException - Specified by:
getServiceReferencesin interfaceorg.osgi.framework.BundleContext- Throws:
org.osgi.framework.InvalidSyntaxException
-
getServiceObjects
public <S> org.osgi.framework.ServiceObjects<S> getServiceObjects(org.osgi.framework.ServiceReference<S> reference) - Specified by:
getServiceObjectsin interfaceorg.osgi.framework.BundleContext
-
getBundle
- Specified by:
getBundlein interfaceorg.osgi.framework.BundleContext
-