JBoss.orgCommunity Documentation
This section describes how to embed the Scribble tools into an application.
This section shows how to use Scribble tools in an OSGi environment. The components within the Scribble tools are all implemented as OSGi services, and therefore can be easily accessed by other OSGi compliant modules.
Direct injection is a mechanism for initialising the relationship between components based on the specification of interest in an interface. When an implementation of a required interface is instantiated, all components that expressed an interest in the interface will be initialised with the implementation.
Direct injection frameworks, such as Spring, can be used to automate this mechanism, by providing the necessary relationships in a configuration file. Alternatively an application can wire these relationships using an explicit mechanism.
The main benefit of this approach is that the 'using' component is unaware of the implementation of the interface - it simply expresses a need for a component that implements the required interface, without caring how it comes in to existence.
When the components are used in an OSGi context, the OSGi bundle activation mechanism is used to initialise the modules, and register them as being available for use by other components.