Package org.apache.felix.dm.compat
Class DependencyManagerCompat
java.lang.Object
org.apache.felix.dm.compat.DependencyManagerCompat
- Direct Known Subclasses:
DependencyManager
This class contains some methods which have been deprecated from the DependencyManager class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract AdapterComponentCreates a new adapter component.createAdapterFactoryConfigurationService(String factoryPid, String update, boolean propagate, String heading, String desc, String localization, PropertyMetaData[] propertiesMetaData) Deprecated.createAdapterService(Class<?> serviceInterface, String serviceFilter) Deprecated.createAdapterService(Class<?> serviceInterface, String serviceFilter, String autoConfig) Deprecated.createAdapterService(Class<?> serviceInterface, String serviceFilter, String autoConfig, Object callbackInstance, String add, String change, String remove, String swap, boolean propagate) Deprecated.createAdapterService(Class<?> serviceInterface, String serviceFilter, String add, String change, String remove) Deprecated.createAdapterService(Class<?> serviceInterface, String serviceFilter, String add, String change, String remove, String swap) Deprecated.abstract AspectComponentCreates a new aspect component.createAspectService(Class<?> serviceInterface, String serviceFilter, int ranking) Deprecated.createAspectService(Class<?> serviceInterface, String serviceFilter, int ranking, Object callbackInstance, String add, String change, String remove, String swap) Deprecated.createAspectService(Class<?> serviceInterface, String serviceFilter, int ranking, String autoConfig) Deprecated.createAspectService(Class<?> serviceInterface, String serviceFilter, int ranking, String add, String change, String remove) Deprecated.createAspectService(Class<?> serviceInterface, String serviceFilter, int ranking, String add, String change, String remove, String swap) Deprecated.createBundleAdapterService(int bundleStateMask, String bundleFilter, boolean propagate) Deprecated.createBundleAdapterService(int bundleStateMask, String bundleFilter, boolean propagate, Object callbackInstance, String add, String change, String remove) Deprecated.abstract BundleComponentCreates a new bundle adapter.abstract FactoryComponentCreates a new Factory Component.createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate) Deprecated.createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate, Class<?> configType) Deprecated.createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate, Object callbackInstance) Deprecated.createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate, Object callbackInstance, Class<?> configType) Deprecated.createResourceAdapterService(String resourceFilter, boolean propagate, Object callbackInstance, String callbackChanged) Deprecated.createResourceAdapterService(String resourceFilter, boolean propagate, Object callbackInstance, String callbackSet, String callbackChanged) Deprecated.createResourceAdapterService(String resourceFilter, Object propagateCallbackInstance, String propagateCallbackMethod, Object callbackInstance, String callbackChanged) Deprecated.createResourceAdapterService(String resourceFilter, Object propagateCallbackInstance, String propagateCallbackMethod, Object callbackInstance, String callbackSet, String callbackChanged) Deprecated.abstract ResourceComponentCreates a new resource adapter component.
-
Constructor Details
-
DependencyManagerCompat
public DependencyManagerCompat()
-
-
Method Details
-
createAspectComponent
Creates a new aspect component. The aspect will be applied to any service that matches the specified interface and filter. For each matching service an aspect will be created based on the aspect implementation class. The aspect will be registered with the same interface and properties as the original service, plus any extra properties you supply here. It will also inherit all dependencies, and if you declare the original service as a member it will be injected.- Returns:
- an aspect component
-
createAdapterComponent
Creates a new adapter component. The adapter will be applied to any service that matches the specified interface and filter. For each matching service an adapter will be created based on the adapter implementation class. The adapter will be registered with the specified interface and existing properties from the original service plus any extra properties you supply here. It will also inherit all dependencies, and if you declare the original service as a member it will be injected.- Returns:
- an adapter component
-
createFactoryComponent
Creates a new Factory Component. For each new factory configuration matching the factoryPid, a component will be created based on the component implementation class. The component will be registered with the specified interface, and with the specified service properties. Depending on thepropagateparameter, every public factory configuration properties (which don't start with ".") will be propagated along with the adapter service properties. It will also inherit all dependencies.- Returns:
- a factory pid component
-
createBundleComponent
Creates a new bundle adapter. The adapter will be applied to any bundle that matches the specified bundle state mask and filter condition. For each matching bundle an adapter will be created based on the adapter implementation class. The adapter will be registered with the specified interface TODO and existing properties from the original resource plus any extra properties you supply here. It will also inherit all dependencies, and if you declare the original service as a member it will be injected.- Returns:
- a service that acts as a factory for generating bundle adapters
-
createResourceComponent
Creates a new resource adapter component. The adapter will be applied to any resource that matches the specified filter condition. For each matching resource an adapter will be created based on the adapter implementation class. The adapter will be registered with the specified interface and existing properties from the original resource plus any extra properties you supply here. It will also inherit all dependencies, and if you declare the original service as a member it will be injected.- Returns:
- a Resource Adapter Component
-
createAspectService
public Component createAspectService(Class<?> serviceInterface, String serviceFilter, int ranking, String autoConfig) Deprecated.Creates a new aspect. The aspect will be applied to any service that matches the specified interface and filter. For each matching service an aspect will be created based on the aspect implementation class. The aspect will be registered with the same interface and properties as the original service, plus any extra properties you supply here. It will also inherit all dependencies, and if you declare the original service as a member it will be injected.Usage example:
manager.createAspectService(ExistingService.class, "(foo=bar)", 10, "m_service") .setImplementation(ExistingServiceAspect.class) );- Parameters:
serviceInterface- the service interface to apply the aspect toserviceFilter- the filter condition to use with the service interfaceranking- the level used to organize the aspect chain orderingautoConfig- the aspect implementation field name where to inject original service. If null, any field matching the original service will be injected.- Returns:
- a service that acts as a factory for generating aspects
-
createAspectService
Deprecated.Creates a new aspect. The aspect will be applied to any service that matches the specified interface and filter. For each matching service an aspect will be created based on the aspect implementation class. The aspect will be registered with the same interface and properties as the original service, plus any extra properties you supply here. It will also inherit all dependencies, and if you declare the original service as a member it will be injected.Usage example:
manager.createAspectService(ExistingService.class, "(foo=bar)", 10) .setImplementation(ExistingServiceAspect.class) );- Parameters:
serviceInterface- the service interface to apply the aspect toserviceFilter- the filter condition to use with the service interfaceranking- the level used to organize the aspect chain ordering- Returns:
- a service that acts as a factory for generating aspects
-
createAspectService
public Component createAspectService(Class<?> serviceInterface, String serviceFilter, int ranking, String add, String change, String remove) Deprecated.Creates a new aspect. The aspect will be applied to any service that matches the specified interface and filter. For each matching service an aspect will be created based on the aspect implementation class. The aspect will be registered with the same interface and properties as the original service, plus any extra properties you supply here. It will also inherit all dependencies, and if you declare the original service as a member it will be injected.Usage example:
manager.createAspectService(ExistingService.class, "(foo=bar)", 10, "add", "change", "remove") .setImplementation(ExistingServiceAspect.class) );- Parameters:
serviceInterface- the service interface to apply the aspect toserviceFilter- the filter condition to use with the service interfaceranking- the level used to organize the aspect chain orderingadd- name of the callback method to invoke on addchange- name of the callback method to invoke on changeremove- name of the callback method to invoke on remove- Returns:
- a service that acts as a factory for generating aspects
-
createAspectService
public Component createAspectService(Class<?> serviceInterface, String serviceFilter, int ranking, String add, String change, String remove, String swap) Deprecated.Creates a new aspect. The aspect will be applied to any service that matches the specified interface and filter. For each matching service an aspect will be created based on the aspect implementation class. The aspect will be registered with the same interface and properties as the original service, plus any extra properties you supply here. It will also inherit all dependencies, and if you declare the original service as a member it will be injected.Usage example:
manager.createAspectService(ExistingService.class, "(foo=bar)", 10, "add", "change", "remove") .setImplementation(ExistingServiceAspect.class) );- Parameters:
serviceInterface- the service interface to apply the aspect toserviceFilter- the filter condition to use with the service interfaceranking- the level used to organize the aspect chain orderingadd- name of the callback method to invoke on addchange- name of the callback method to invoke on changeremove- name of the callback method to invoke on removeswap- name of the callback method to invoke on swap- Returns:
- a service that acts as a factory for generating aspects
-
createAspectService
public Component createAspectService(Class<?> serviceInterface, String serviceFilter, int ranking, Object callbackInstance, String add, String change, String remove, String swap) Deprecated.Creates a new aspect. The aspect will be applied to any service that matches the specified interface and filter. For each matching service an aspect will be created based on the aspect implementation class. The aspect will be registered with the same interface and properties as the original service, plus any extra properties you supply here. It will also inherit all dependencies, and if you declare the original service as a member it will be injected.Usage example:
manager.createAspectService(ExistingService.class, "(foo=bar)", 10, "add", "change", "remove") .setImplementation(ExistingServiceAspect.class) );- Parameters:
serviceInterface- the service interface to apply the aspect toserviceFilter- the filter condition to use with the service interfaceranking- the level used to organize the aspect chain orderingcallbackInstance- the instance to invoke the callbacks on, or null if the callbacks have to be invoked on the aspect itselfadd- name of the callback method to invoke on addchange- name of the callback method to invoke on changeremove- name of the callback method to invoke on removeswap- name of the callback method to invoke on swap- Returns:
- a service that acts as a factory for generating aspects
-
createAdapterService
Deprecated.Creates a new adapter. The adapter will be applied to any service that matches the specified interface and filter. For each matching service an adapter will be created based on the adapter implementation class. The adapter will be registered with the specified interface and existing properties from the original service plus any extra properties you supply here. It will also inherit all dependencies, and if you declare the original service as a member it will be injected.Usage example:
manager.createAdapterService(AdapteeService.class, "(foo=bar)") .setInterface(AdapterService.class, new Hashtable() {{ put("extra", "property"); }}) .setImplementation(AdapterImpl.class);- Parameters:
serviceInterface- the service interface to apply the adapter toserviceFilter- the filter condition to use with the service interface- Returns:
- a service that acts as a factory for generating adapters
-
createAdapterService
public Component createAdapterService(Class<?> serviceInterface, String serviceFilter, String autoConfig) Deprecated.Creates a new adapter. The adapter will be applied to any service that matches the specified interface and filter. For each matching service an adapter will be created based on the adapter implementation class. The adapter will be registered with the specified interface and existing properties from the original service plus any extra properties you supply here. It will also inherit all dependencies, and if you declare the original service as a member it will be injected.Usage example:
manager.createAdapterService(AdapteeService.class, "(foo=bar)", "m_service") .setInterface(AdapterService.class, new Hashtable() {{ put("extra", "property"); }}) .setImplementation(AdapterImpl.class);- Parameters:
serviceInterface- the service interface to apply the adapter toserviceFilter- the filter condition to use with the service interfaceautoConfig- the name of the member to inject the service into- Returns:
- a service that acts as a factory for generating adapters
-
createAdapterService
public Component createAdapterService(Class<?> serviceInterface, String serviceFilter, String add, String change, String remove) Deprecated.Creates a new adapter. The adapter will be applied to any service that matches the specified interface and filter. For each matching service an adapter will be created based on the adapter implementation class. The adapter will be registered with the specified interface and existing properties from the original service plus any extra properties you supply here. It will also inherit all dependencies, and if you declare the original service as a member it will be injected.Usage example:
manager.createAdapterService(AdapteeService.class, "(foo=bar)", "add", "change", "remove") .setInterface(AdapterService.class, new Hashtable() {{ put("extra", "property"); }}) .setImplementation(AdapterImpl.class);- Parameters:
serviceInterface- the service interface to apply the adapter toserviceFilter- the filter condition to use with the service interfaceadd- name of the callback method to invoke on addchange- name of the callback method to invoke on changeremove- name of the callback method to invoke on remove- Returns:
- a service that acts as a factory for generating adapters
-
createAdapterService
public Component createAdapterService(Class<?> serviceInterface, String serviceFilter, String add, String change, String remove, String swap) Deprecated.Creates a new adapter. The adapter will be applied to any service that matches the specified interface and filter. For each matching service an adapter will be created based on the adapter implementation class. The adapter will be registered with the specified interface and existing properties from the original service plus any extra properties you supply here. It will also inherit all dependencies, and if you declare the original service as a member it will be injected.Usage example:
manager.createAdapterService(AdapteeService.class, "(foo=bar)", "add", "change", "remove", "swap") .setInterface(AdapterService.class, new Hashtable() {{ put("extra", "property"); }}) .setImplementation(AdapterImpl.class);- Parameters:
serviceInterface- the service interface to apply the adapter toserviceFilter- the filter condition to use with the service interfaceadd- name of the callback method to invoke on addchange- name of the callback method to invoke on changeremove- name of the callback method to invoke on removeswap- name of the callback method to invoke on swap- Returns:
- a service that acts as a factory for generating adapters
-
createAdapterService
public Component createAdapterService(Class<?> serviceInterface, String serviceFilter, String autoConfig, Object callbackInstance, String add, String change, String remove, String swap, boolean propagate) Deprecated.Creates a new adapter. The adapter will be applied to any service that matches the specified interface and filter. For each matching service an adapter will be created based on the adapter implementation class. The adapter will be registered with the specified interface (and existing properties from the original service if you set the propagate flag) plus any extra properties you supply here. It will also inherit all dependencies, and if you declare the original service as a member it will be injected.Usage example:
manager.createAdapterService(AdapteeService.class, "(foo=bar)", "add", "change", "remove", "swap") .setInterface(AdapterService.class, new Hashtable() {{ put("extra", "property"); }}) .setImplementation(AdapterImpl.class);- Parameters:
serviceInterface- the service interface to apply the adapter toserviceFilter- the filter condition to use with the service interfaceautoConfig- the name of the member to inject the service into, or null.callbackInstance- the instance to invoke the callbacks on, or null if the callbacks have to be invoked on the adapter itselfadd- name of the callback method to invoke on addchange- name of the callback method to invoke on changeremove- name of the callback method to invoke on removeswap- name of the callback method to invoke on swappropagate- true if the adaptee service properties should be propagated to the adapter service consumers- Returns:
- a service that acts as a factory for generating adapters
-
createFactoryConfigurationAdapterService
public Component createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate) Deprecated.Creates a new Factory Configuration Adapter. For each new factory configuration matching the factoryPid, an adapter will be created based on the adapter implementation class. The adapter will be registered with the specified interface, and with the specified adapter service properties. Depending on thepropagateparameter, every public factory configuration properties (which don't start with ".") will be propagated along with the adapter service properties. It will also inherit all dependencies.The callback you specify may accept the following method signatures:
- updated(Dictionary)
- updated(Component, Dictionary)
Usage example:
manager.createFactoryConfigurationAdapterService("MyFactoryPid", "update", true) // The interface to use when registering adapter .setInterface(AdapterService.class.getName(), new Hashtable() {{ put("foo", "bar"); }}) // the implementation of the adapter .setImplementation(AdapterServiceImpl.class);- Parameters:
factoryPid- the pid matching the factory configurationupdate- the adapter method name that will be notified when the factory configuration is created/updated.propagate- true if public factory configuration should be propagated to the adapter service properties- Returns:
- a service that acts as a factory for generating the managed service factory configuration adapter
-
createFactoryConfigurationAdapterService
public Component createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate, Object callbackInstance) Deprecated.Creates a new Factory Configuration Adapter using a specific update callback instance. For each new factory configuration matching the factoryPid, an adapter will be created based on the adapter implementation class. The adapter will be registered with the specified interface, and with the specified adapter service properties. Depending on thepropagateparameter, every public factory configuration properties (which don't start with ".") will be propagated along with the adapter service properties. It will also inherit all dependencies.The callback you specify may accept the following method signatures:
- updated(Dictionary)
- updated(Component, Dictionary)
- Parameters:
factoryPid- the pid matching the factory configurationupdate- the adapter method name that will be notified when the factory configuration is created/updated.propagate- true if public factory configuration should be propagated to the adapter service propertiescallbackInstance- the object on which the updated callback will be invoked.- Returns:
- a service that acts as a factory for generating the managed service factory configuration adapter
-
createFactoryConfigurationAdapterService
public Component createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate, Class<?> configType) Deprecated.Creates a new Factory Configuration Adapter. For each new factory configuration matching the factoryPid, an adapter will be created based on the adapter implementation class. The adapter will be registered with the specified interface, and with the specified adapter service properties. Depending on thepropagateparameter, every public factory configuration properties (which don't start with ".") will be propagated along with the adapter service properties. It will also inherit all dependencies.The callback you specify may accept the following method signatures:
- updated(Dictionary)
- updated(Component, Dictionary)
- updated(ConfigurationType)
- updated(Component, ConfigurationType)
The ConfigurationType parameter is an implementation of the
configTypeargument.- Parameters:
factoryPid- the pid matching the factory configurationupdate- the adapter method name that will be notified when the factory configuration is created/updated.propagate- true if public factory configuration should be propagated to the adapter service propertiesconfigType- the configuration type to use instead of a dictionary. See the javadoc fromConfigurationDependencyfor more informations about type-safe configuration.- Returns:
- a service that acts as a factory for generating the managed service factory configuration adapter
- See Also:
-
createFactoryConfigurationAdapterService
public Component createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate, Object callbackInstance, Class<?> configType) Deprecated.Creates a new Factory Configuration Adapter using a specific update callback instance. For each new factory configuration matching the factoryPid, an adapter will be created based on the adapter implementation class. The adapter will be registered with the specified interface, and with the specified adapter service properties. Depending on thepropagateparameter, every public factory configuration properties (which don't start with ".") will be propagated along with the adapter service properties. It will also inherit all dependencies.The callback you specify may accept the following method signatures:
- updated(Dictionary)
- updated(Component, Dictionary)
- updated(ConfigurationType)
- updated(Component, ConfigurationType)
The ConfigurationType parameter is an implementation of the
configTypeargument.- Parameters:
factoryPid- the pid matching the factory configurationpropagate- true if public factory configuration should be propagated to the adapter service propertiescallbackInstance- the object on which the updated callback will be invoked.configType- the configuration type to use instead of a dictionary. See the javadoc fromConfigurationDependencyfor more informations about type-safe configuration.- Returns:
- a service that acts as a factory for generating the managed service factory configuration adapter
-
createAdapterFactoryConfigurationService
public Component createAdapterFactoryConfigurationService(String factoryPid, String update, boolean propagate, String heading, String desc, String localization, PropertyMetaData[] propertiesMetaData) Deprecated.Creates a new Managed Service Factory Configuration Adapter with meta type support. For each new factory configuration matching the factoryPid, an adapter will be created based on the adapter implementation class. The adapter will be registered with the specified interface, and with the specified adapter service properties. Depending on thepropagateparameter, every public factory configuration properties (which don't start with ".") will be propagated along with the adapter service properties. It will also inherit all dependencies.Usage example:
PropertyMetaData[] propertiesMetaData = new PropertyMetaData[] { manager.createPropertyMetaData() .setCardinality(Integer.MAX_VALUE) .setType(String.class) .setHeading("English words") .setDescription("Declare here some valid english words") .setDefaults(new String[] {"hello", "world"}) .setId("words") }; manager.add(createFactoryConfigurationAdapterService("FactoryPid", "updated", true, // propagate CM settings "EnglishDictionary", "English dictionary configuration properties", null, propertiesMetaData) .setImplementation(Adapter.class));- Parameters:
factoryPid- the pid matching the factory configurationupdate- the adapter method name that will be notified when the factory configuration is created/updated.The following signatures are supported:
- updated(Dictionary)
- updated(Component, Dictionary)
propagate- true if public factory configuration should be propagated to the adapter service propertiesheading- The label used to display the tab name (or section) where the properties are displayed. Example: "Printer Service"desc- A human readable description of the factory PID this configuration is associated with. Example: "Configuration for the PrinterService bundle"localization- Points to the basename of the Properties file that can localize the Meta Type informations. The default localization base name for the properties is OSGI-INF/l10n/bundle, but can be overridden by the manifest Bundle-Localization header (see core specification, in section Localization on page 68). You can specify a specific localization basename file using this parameter (e.g."person"will match person_du_NL.properties in the root bundle directory).propertiesMetaData- Array of MetaData regarding configuration properties- Returns:
- a service that acts as a factory for generating the managed service factory configuration adapter
-
createBundleAdapterService
public Component createBundleAdapterService(int bundleStateMask, String bundleFilter, boolean propagate) Deprecated.Creates a new bundle adapter. The adapter will be applied to any bundle that matches the specified bundle state mask and filter condition. For each matching bundle an adapter will be created based on the adapter implementation class. The adapter will be registered with the specified interface- Parameters:
bundleStateMask- the bundle state mask to applybundleFilter- the filter to apply to the bundle manifestpropagate-trueif properties from the bundle should be propagated to the service- Returns:
- a service that acts as a factory for generating bundle adapters
-
createBundleAdapterService
public Component createBundleAdapterService(int bundleStateMask, String bundleFilter, boolean propagate, Object callbackInstance, String add, String change, String remove) Deprecated.Creates a new bundle adapter using specific callback instance. The adapter will be applied to any bundle that matches the specified bundle state mask and filter condition. For each matching bundle an adapter will be created based on the adapter implementation class, and The adapter will be registered with the specified interface.- Parameters:
bundleStateMask- the bundle state mask to applybundleFilter- the filter to apply to the bundle manifestpropagate-trueif properties from the bundle should be propagated to the servicecallbackInstance- the instance to invoke the callbacks on, or null if the callbacks have to be invoked on the adapter itselfadd- name of the callback method to invoke on addchange- name of the callback method to invoke on changeremove- name of the callback method to invoke on remove- Returns:
- a service that acts as a factory for generating bundle adapters
-
createResourceAdapterService
public Component createResourceAdapterService(String resourceFilter, boolean propagate, Object callbackInstance, String callbackChanged) Deprecated.Creates a new resource adapter. The adapter will be applied to any resource that matches the specified filter condition. For each matching resource an adapter will be created based on the adapter implementation class. The adapter will be registered with the specified interface and existing properties from the original resource plus any extra properties you supply here. It will also inherit all dependencies, and if you declare the original service as a member it will be injected.- Parameters:
resourceFilter- the filter condition to use with the resourcepropagate-trueif properties from the resource should be propagated to the servicecallbackInstance- instance to invoke the callback oncallbackChanged- the name of the callback method- Returns:
- a service that acts as a factory for generating resource adapters
-
createResourceAdapterService
public Component createResourceAdapterService(String resourceFilter, boolean propagate, Object callbackInstance, String callbackSet, String callbackChanged) Deprecated.- See Also:
-
createResourceAdapterService
public Component createResourceAdapterService(String resourceFilter, Object propagateCallbackInstance, String propagateCallbackMethod, Object callbackInstance, String callbackChanged) Deprecated.- See Also:
-
createResourceAdapterService
public Component createResourceAdapterService(String resourceFilter, Object propagateCallbackInstance, String propagateCallbackMethod, Object callbackInstance, String callbackSet, String callbackChanged) Deprecated.- See Also:
-
DependencyManager.createFactoryComponent()