public final class MockOsgi extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
activate(Object target)
Simulate activation of service instance.
|
static boolean |
activate(Object target,
org.osgi.framework.BundleContext bundleContext,
Dictionary<String,Object> properties)
Simulate activation of service instance.
|
static boolean |
activate(Object target,
org.osgi.framework.BundleContext bundleContext,
Map<String,Object> properties)
Simulate activation of service instance.
|
static boolean |
activate(Object target,
Dictionary<String,Object> properties)
Simulate activation of service instance.
|
static boolean |
activate(Object target,
Map<String,Object> properties)
Simulate activation of service instance.
|
static boolean |
deactivate(Object target)
Simulate deactivation of service instance.
|
static boolean |
deactivate(Object target,
org.osgi.framework.BundleContext bundleContext,
Dictionary<String,Object> properties)
Simulate deactivation of service instance.
|
static boolean |
deactivate(Object target,
org.osgi.framework.BundleContext bundleContext,
Map<String,Object> properties)
Simulate activation of service instance.
|
static boolean |
deactivate(Object target,
Dictionary<String,Object> properties)
Simulate deactivation of service instance.
|
static boolean |
deactivate(Object target,
Map<String,Object> properties)
Simulate deactivation of service instance.
|
static boolean |
injectServices(Object target,
org.osgi.framework.BundleContext bundleContext)
Simulate OSGi service dependency injection.
|
static boolean |
modified(Object target,
org.osgi.framework.BundleContext bundleContext,
Dictionary<String,Object> properties)
Simulate configuration modification of service instance.
|
static boolean |
modified(Object target,
org.osgi.framework.BundleContext bundleContext,
Map<String,Object> properties)
Simulate configuration modification of service instance.
|
static org.osgi.framework.BundleContext |
newBundleContext() |
static org.osgi.service.component.ComponentContext |
newComponentContext() |
static org.osgi.service.component.ComponentContext |
newComponentContext(org.osgi.framework.BundleContext bundleContext,
Dictionary<String,Object> properties) |
static org.osgi.service.component.ComponentContext |
newComponentContext(org.osgi.framework.BundleContext bundleContext,
Map<String,Object> properties) |
static org.osgi.service.component.ComponentContext |
newComponentContext(Dictionary<String,Object> properties) |
static org.osgi.service.component.ComponentContext |
newComponentContext(Map<String,Object> properties) |
static org.osgi.service.log.LogService |
newLogService(Class<?> loggerContext) |
static void |
sendBundleEvent(org.osgi.framework.BundleContext bundleContext,
org.osgi.framework.BundleEvent bundleEvent)
Simulates a bundle event on the given bundle context (that is forwarded
to registered bundle listeners).
|
public static org.osgi.framework.BundleContext newBundleContext()
BundleContext
instancepublic static void sendBundleEvent(org.osgi.framework.BundleContext bundleContext, org.osgi.framework.BundleEvent bundleEvent)
bundleContext
- Bundle contextbundleEvent
- Bundle eventpublic static org.osgi.service.component.ComponentContext newComponentContext()
ComponentContext
instancepublic static org.osgi.service.component.ComponentContext newComponentContext(Dictionary<String,Object> properties)
properties
- PropertiesComponentContext
instancepublic static org.osgi.service.component.ComponentContext newComponentContext(Map<String,Object> properties)
properties
- PropertiesComponentContext
instancepublic static org.osgi.service.component.ComponentContext newComponentContext(org.osgi.framework.BundleContext bundleContext, Dictionary<String,Object> properties)
bundleContext
- Bundle contextproperties
- PropertiesComponentContext
instancepublic static org.osgi.service.component.ComponentContext newComponentContext(org.osgi.framework.BundleContext bundleContext, Map<String,Object> properties)
bundleContext
- Bundle contextproperties
- PropertiesComponentContext
instancepublic static org.osgi.service.log.LogService newLogService(Class<?> loggerContext)
loggerContext
- Context class for loggingLogService
instancepublic static boolean injectServices(Object target, org.osgi.framework.BundleContext bundleContext)
target
- Service instancebundleContext
- Bundle context from which services are fetched to inject.public static boolean activate(Object target)
target
- Service instance.public static boolean activate(Object target, Dictionary<String,Object> properties)
target
- Service instance.properties
- Propertiespublic static boolean activate(Object target, Map<String,Object> properties)
target
- Service instance.properties
- Propertiespublic static boolean activate(Object target, org.osgi.framework.BundleContext bundleContext, Dictionary<String,Object> properties)
target
- Service instance.bundleContext
- Bundle contextproperties
- Propertiespublic static boolean activate(Object target, org.osgi.framework.BundleContext bundleContext, Map<String,Object> properties)
target
- Service instance.bundleContext
- Bundle contextproperties
- Propertiespublic static boolean deactivate(Object target)
target
- Service instance.public static boolean deactivate(Object target, Dictionary<String,Object> properties)
target
- Service instance.properties
- Propertiespublic static boolean deactivate(Object target, Map<String,Object> properties)
target
- Service instance.properties
- Propertiespublic static boolean deactivate(Object target, org.osgi.framework.BundleContext bundleContext, Dictionary<String,Object> properties)
target
- Service instance.bundleContext
- Bundle contextproperties
- Propertiespublic static boolean deactivate(Object target, org.osgi.framework.BundleContext bundleContext, Map<String,Object> properties)
target
- Service instance.bundleContext
- Bundle contextproperties
- Propertiespublic static boolean modified(Object target, org.osgi.framework.BundleContext bundleContext, Dictionary<String,Object> properties)
target
- Service instance.bundleContext
- Bundle contextproperties
- Propertiespublic static boolean modified(Object target, org.osgi.framework.BundleContext bundleContext, Map<String,Object> properties)
target
- Service instance.bundleContext
- Bundle contextproperties
- PropertiesCopyright © 2007–2014 The Apache Software Foundation. All rights reserved.