- 浏览: 1149101 次
- 性别:
- 来自: 火星郊区
博客专栏
-
OSGi
浏览量:0
文章分类
- 全部博客 (695)
- 项目管理 (48)
- OSGi (122)
- java (79)
- Vaadin (5)
- RAP (47)
- mysql (40)
- Maven (22)
- SVN (8)
- 孔雀鱼 (10)
- hibernate (9)
- spring (10)
- css (3)
- 年审 (6)
- ant (1)
- jdbc (3)
- FusionCharts (2)
- struts (4)
- 决策分析 (2)
- 生活 (10)
- 架构设计 (5)
- 破解 (2)
- 狼文化 (4)
- JVM (14)
- J2EE (1)
- 应用服务器 (1)
- 我的链接 (5)
- 数学 (2)
- 报表 (1)
- 百科 (6)
- Flex (7)
- log4j (2)
- PHP (1)
- 系统 (2)
- Web前端 (7)
- linux (6)
- Office (1)
- 安全管理 (5)
- python (2)
- dom4j (1)
- 工作流 (3)
- 养生保健 (4)
- Eclipse (8)
- 监控开发 (1)
- 设计 (3)
- CAS (1)
- ZK (41)
- BluePrint (3)
- 工具 (1)
- SWT (7)
- google (2)
- NIO (1)
- 企业文化 (2)
- Windoes (0)
- RCP (7)
- JavaScript (10)
- UML (1)
- 产品经理 (2)
- Velocity (10)
- C (1)
- 单元测试 (1)
- 设计模式 (2)
- 系统分析师 (2)
- 架构 (4)
- 面试 (2)
- 代码走查 (1)
- MongoDB (1)
- 企业流程优化 (1)
- 模式 (1)
- EJB (1)
- Jetty (1)
- Git (13)
- IPV6 (1)
- JQuery (8)
- SSH (1)
- mybatis (10)
- SiteMesh (2)
- JSTL (1)
- veloctiy (1)
- Spring MVC (1)
- struts2 (3)
- Servlet (1)
- 权限管理 (1)
- Java Mina (1)
- java 系统信息 (6)
- OSGi 基础 (3)
- html (1)
- spring--security (6)
- HTML5 (1)
- java爬虫搜索 (1)
- mvc (3)
最新评论
-
Tom.X:
http://osgia.com/
将web容器置于OSGi框架下进行web应用的开发 -
chenyuguxing:
你好, 为什么我的bundle export到felix工程中 ...
在Apache Felix中运行bundle -
string2020:
<niceManifest>true</ni ...
Bundle Plugin for Maven -
jsonmong:
OSGI,是未来的主流,目前已相当成熟。应用OSGI比较好的, ...
基于OSGi的声明式服务 -
zyhui98:
貌似是翻译过来的,有很少人在linux上做开发吧
如何成为“10倍效率”开发者
This document describes the set of functions provided by the Service Component Runtime Bundle. It also contains a developer's guide to managing OSGi services by the means defined in the OSGi Declarative Services Specification Release 4.2.
Contents:
- Bundle Information
- Overview
- Service Component API
- Creating a Component
- Services
- Console Commands
- System Properties
- References
Bundle Information
Bundle JAR
The JAR file of the Service Component Runtime bundle is fw.scr.jar , located in the bundles directory.
Symbolic Name
The symbolic name of the Service Component Runtime bundle is com.prosyst.mbs.scr .
Import
|
Export
None.
Overview
The Service Component Runtime bundle provides an implementation of the Service Component Runtime according to the OSGi Declarative Services Specification Release 4.2.
The specification defines a declarative model of using OSGi services that allows delaying the creation of the service object till the moment it will be actually used. Using the declarative services model provides the following benefits:
- Delayed creation of service objects and their class loaders.
- Reduced startup time and memory footprint.
- Low resource requirements as the model is applicable on resource constrained systems.
- Simplified mechanism for authoring services.
- Simplified programming model provided by a lightweight API.
- Decreased amount of required code.
Service Component
The declarative services model defines a service component as main unit for manipulating with OSGi services functionality.
A service component is an entity consisting of a Java class and its XML description, which can register or reference a service in a lazy fashion. Both, service component's Java class and its description are packed in a bundle that is deployed in the OSGi framework where it functions like any traditional OSGi bundle.
A service component has the following features:
- Its lifecycle is contained in its bundle's lifecycle.
- It is uniquely identified by its implementation class.
- It can provide services to the OSGi framework.
- It can reference services provided by other components and traditional OSGi bundles in the framework.
- It can be configured through the OSGi Configuration Admin service.
A service component will be referred to as component and its XML description as component description from now on in this document.
Service Component Runtime
The Service Component Runtime (SCR) is the module that manages the components and their lifecycle. It performs the following functions:
- Track component dependencies and manage their dynamics.
- Activate the component when its dependencies are met.
- Publish the component in the service registry on its activation.
- Create the component instance when the component is going to be used.
- Dispose component instances when they are no longer used.
Component Context
A component may receive its Component Context through its activate
method. Component Context can be used to locate services declared in
the component's description. It can be used also to enable or disable
components from the component's bundle.
Component Description
The declaration of a component in an XML format is the component description . It uniquely identifies the component to the SCR and provides information about the component's functionality that will be used by the SCR to perform its management operations.
The component description provides information for:
- The name of the component
- The name of the Java class implementing the component
- Services provided by the component
- Services referenced by the component
- Configurable properties of the component
Component Factories
The declarative services model supports producing multiple instances of the same component type in compliance with the Service Factory concept in the OSGi framework.
Multiple instances of same component type can be produced by:
- A Component Factory service - It is registered as an OSGi service by the SCR and it can create multiple instances of a component.
- A Managed Service Factory - If defined in a Configuration Metatype XML, the SCR can produce a Managed Service Factory for a component with a set of properties. For each newly produced configuration instance from the SCR-provided Managed Service Factory, the SCR produces a new component instance. If the component registers a service, for each component instance a new service object will be created with property values taken from the configuration instance.
- A Service Factory - A component can be declared in its description to use
a Service Factory without need to implement an
org.osgi.framework.ServiceFactory
. It will produce new instances of the component for each referencing bundle or component. The properties of the service provided by the component will be the same for all newly produced component instances.
Note: A component cannot be declared as a factory component and use a Managed Service Factory and Service Factory at the same time. You have to choose only one of these factories to produce new instances of the same component type.
Component Properties
A component can have a set of properties specified in three places in the following order of precedence:
- Properties passed to the Component Factory service when creating new instances of the same component type.
- Properties retrieved from the Configuration Admin service.
- Properties specified in the component description. In the case of
a service-providing component, they are exported as properties
of registered service with specific default values. The values of
these properties can be overridden through the Configuration Admin
service or by passing new property values to the
newInstance
method of the Component Factory service. New component properties can be passed to this method, as well.
Each component also has COMPONENT_NAME
property defined in its description and COMPONENT_ID
property given by the SCR. These properties are obligatory and their
values cannot be overridden as they uniquely identify the component to
the SCR.
Service Component API
The Service Component API is contained in the org.osgi.service.component
package. It is a lightweight API that defines base interfaces for using components.
Creating a Component
To create a component, write its implementation Java class and component description then pack them into a bundle JAR file.
Component Description Manifest Header
A bundle providing a component must have special header in its manifest that specifies the XML document of the component description:
Service-Component: <path to the XML document's location>
For example:
Service-Component: myComponent/ComponentDescriptionXML.xml
Component Description Elements
The elements included in a component description vary depending on the functionality a component provides.
Generally, the possible elements of a component description are:
-
component
- This is the opening element of the component description.
It can have the following attributes:
- name - The component name. A component's name must be unique, it will be also used as a service PID in case the component implements a service or its properties are exported for configuration in the OSGi Configuration Admin service. This attribute is mandatory.
- factory - This attribute is included for factory components and specifies a factory name.
- immediate - This attribute specifies if the component should be activated right after its bundle is deployed and its dependencies are met. The default value is "false". This attribute is optional.
- enabled - This attribute indicates whether the component should be enabled for usage immediately after its bundle is started. Its default value is "true". If set to "false" the component will remain disabled until it is explicitly enabled.The attribute is optional.
-
implementation
- The component's implementation class. This element
has the following attribute:
- class - The fully qualified name of the component's implementation class.
-
service
- This element provides information about the services registered
by the component. Each provided service interface name is declared in a provide
sub-element with an interface=<interface_name>
attribute. The
service
element can have the following attribute:
- servicefactory - It enables using a Service Factory concept for the provided service. Its default value is "false". When "true", a different component configuration is created, activated and its component instance returned as a service object for each bundle that requests the corresponding service.
-
reference
- This element provides information about the references
a component makes to other services. The reference element can include the
following attributes:
- name - The name of the reference.
- interface - The fully qualified name of the referenced service interface.
- bind - The name of the method binding the service object to the component. See "Referencing a Service " section.
- unbind - The name of the method unbinding the service object from the component. See "Referencing a Service "section.
- cardinality - The reference cardinality.
- target - A filter that further constraints the set of referenced services.
-
property
- A component property. It has the following attributes:
- name - The name of the property.
- value - The default value of the property.
- type - The property type. As the default type is "String", you are not required to include the type attribute for a String property.
- properties - Here you can specify the path to a standard Java properties file containing the set of properties that the component uses.
For further information on the component description elements, refer to the component description schema provided in the OSGi Declarative Services Specification Release 4. .
Providing a Service
To create a component that provides a service, you have to go through the following stages:
- Write the service interface.
package simple.service; public interface HelloService { public void hello(); }
Listing 1:HelloService interface
- Write the service interface implementation class which will be the component's
implementation class as well:
package simple.service.impl; import simple.service.HelloService; public class HelloServiceImpl implements HelloService { public void hello() { System.out.println("Hello components!"); } }
Listing 2: HelloService implementation class.
- Write the component description.
<?xml version="1.0" encoding="UTF-8"?> < scr:component name =" HelloServiceComponent" xmlns:scr =" http://www.osgi.org/xmlns/scr/v1.0.0"> <!-- The component's implementation class--> <implementation class =" simple.service.impl.HelloServiceImpl"/> < service > <!--The interface of the service provided by the component--> < provide interface =" simple.service.HelloService"/> </ service > </scr:component>
Listing 3: HelloServiceComponent XML description
Referencing a Service
A component can reference services provided by other components or bundles in the framework by using one of the following models:
- Lookup model - In this model you have to call the
locateService
orlocateServices
methods of theComponentConext
object provided to your component's Java class. ThelocateService(s)
method allows a component to "look up" the services it needs instead of keeping their objects. This model is suitable for referencing services with dynamic behavior. - Event model - Using this model requires writing bind and unbind methods
for the referenced service in the component's implementation class. The bind
method will be called by the SCR to obtain the service object and the unbind
to withdraw it. These methods must take a single parameter and the service
object must be assignable to the parameter's type or the parameter has to be
ServiceReference
. The binding and unbinding methods are declared in the reference element of the component's description.
Lookup Model
To reference a service using this model:
- Write a reference element in the component's description to declare the referenced service(s).
- Get the component's
ComponentContext
object allocated to the instance of your component's class, passed as an argument to the component'sactivate
method. - Call the
locateService
orlocateServices
method of theComponentContext
.
The code example snippet below contains a component's implementation class which references the service provided by the component introduced in the "Providing a Service " section.
package simple.service.reference; import org.osgi.service.component.ComponentContext; import simple.service.HelloService; public class HelloServiceReference { protected ComponentContext context; HelloService helloService; protected void activate(ComponentContext ctxt){ this.context = ctxt; helloService = (HelloService) ctxt.locateService("helloService"); helloService.hello(); } protected void deactivate(ComponentContext ctxt){ this.context = null; } } |
And the component description:
<?xml version="1.0" encoding="UTF-8"?> < scr:component name =" HelloServiceReference" xmlns:scr =" http://www.osgi.org/xmlns/scr/v1.0.0"> <implementation class =" simple.service.reference.HelloServiceReference"/> < reference name =" helloService" interface =" simple.service.HelloService" /> </ scr:component > |
Event Model
To obtain a service using this model:
- Write bind and unbind methods.
- Declare them in the reference element of the component description.
The SCR passes the referenced service as an argument of the bind and unbind methods.
The listing below contains a class which implements bind (setHelloService
)
and unbind (unsetHelloService
) methods to obtain the service provided
by the component introduced in the "Providing a Service
"
section:
package simple.service.reference; import simple.service.HelloService; public class HelloServiceBind { HelloService helloService; public void setHelloService(HelloService helloService){ this.helloService = helloService; helloService.hello(); } public void unsetHelloService(HelloService helloSerivce){ this.helloService = null; } } |
The XML description of the HelloServiceBind
class:
<?xml version="1.0" encoding="UTF-8"?> < scr:component name =" HelloServiceBind" xmlns:scr =" http://www.osgi.org/xmlns/scr/v1.0.0"> <implementation class =" simple.service.reference.HelloServiceBind"/> < reference name =" helloService" interface =" simple.service.HelloService" bind =" setHelloService" unbind =" unsetHelloService" /> </ scr:component > |
Using the Component Factory service
To use the Component Factory service:
- Define the component you want to produce multiple instances of as a factory component. To define a component as a factory component, declare a factory="<factory_name>" attribute in the component element of its description.
- Declare component properties in the component's description that will be passed to the Component Factory service when creating new instances of the same component type. Component properties are declared in property or properties elements as described in the "Component Description Elements " section.
- Get the Component Factory OSGi service and call its
newInstance
method by providing some custom properties.
The Component Factory, that the SCR creates and associates with the component definition, can create multiple instances if the component is satisfied. If the a factory component's dependencies are not met, the component is disposed and the Component Factory service is unregistered.
If the factory component is supposed to provide a service, a service object
will be registered on its behalf each time the newInstance
method
of the associated ComponentFactory
is called.
Following is the implementation class of a factory component that provides
the Hello Service introduced in the "Providing a Service
"
section. For simplicity, the service's hello
method is called in
the component's activate
method:
package simple.service.impl; import org.osgi.service.component.ComponentContext; import simple.service.HelloService; public class HelloServiceImpl implements HelloService { ComponentContext context; protected void activate(ComponentContext ctxt){ this.context = ctxt; hello(); } public void hello() { System.out.println("Hello components!"); } protected void deactivate(ComponentContext ctxt){ this.context = null; } } |
And the component description where the component is declared as a factory component:
<?xml version="1.0" encoding="UTF-8"?> < scr:component name =" HelloComponentFactory" factory =" hello.component.factory" xmlns:scr =" http://www.osgi.org/xmlns/scr/v1.0.0"> <implementation class =" simple.service.impl.HelloServiceImpl"/> < service > < provide interface =" simple.service.HelloService"/> </ service > < property name =" Prop1" value =" init value"/> < property name =" Prop2" type =" Integer" value =" 0"/> </ scr:component > |
The next example is a component which gets the Component Factory service and creates an instance of the factory component from the previous example:
package simple.component.factory; import java.util.Hashtable; import org.osgi.service.component.ComponentContext; import org.osgi.service.component.ComponentFactory; import org.osgi.service.component.ComponentInstance; public class HelloComponentFactoryRef { ComponentContext context; ComponentFactory factory; ComponentInstance compInstance; Hashtable factoryProps; public void setFactory(ComponentFactory cmpFact){ this.factory = cmpFact; factoryProps = new Hashtable(); factoryProps.put("Prop1","new value"); factoryProps.put("Prop2",new Integer(20)); compInstance = factory.newInstance(factoryProps); } public void unsetFactory(ComponentFactory cmpFact){ this.factory = null; } } |
The next listing contains the component description of the SimpleComponentFactoryRef
component. Its reference
element includes a target
attribute who's value is an LDAP filter that constrains the referenced
Component Factory services to the one associated with the SimpleComponent
component. The filter is in (component.factory=<component factory name>)
format.
<?xml version="1.0" encoding="UTF-8"?> < scr:component name =" HelloComponentFactoryRef" xmlns:scr =" http://www.osgi.org/xmlns/scr/v1.0.0"> < implementation class =" simple.component.factory.HelloComponentFactoryRef"/> < reference name =" ComponentFactoryRef" interface =" org.osgi.service.component.ComponentFactory" bind =" setFactory" unbind =" unsetFactory" target =" (component.factory=hello.component.factory)" /> </ scr:component > |
Using a Service Factory
To create unique instances of a component-providing service for each bundle referencing the service over the traditional OSGi Framework API or by using another service component, declare a servicefactory="true" attribute in the service element of the component's description like this:
<service servicefactory="true">
Providing Configurable Component Properties
To make a component's properties configurable through the Configuration Admin, write a metatype XML resource to export them as metadata as defined in the OSGi Metatype Service Specification, linking the defined metatype with the component name. Then, create the component configuration in the Configuration Admin using the component name as the configuration PID.
The example that follows is an XML document providing the metadata of a component's properties. Their IDs must be same as their names declared in the component description:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> < metatype:MetaData xmlns:metatype =" http://www.osgi.org/xmlns/metatype/v1.0.0" xmlns:xsi =" http://www.w3.org/2001/XMLSchema-instance"> <OCD name =" Hello Component Config" id =" ocd1"> < AD name =" Property One" id =" Prop1" type =" String" default =" init value"/> < AD name =" Property Two" id =" Prop2" type =" Integer" default =" 0"/> </ OCD > < Designate pid =" HelloServiceComponent"> < Object ocdref =" ocd1"/> </ Designate > </ metatype:MetaData > |
If you want to produce and preconfigure multiple component instances, set the factory attribute of the Designate element to true to indicate that this metatype will be for a Managed Service Factory.
Services
Pluggable Commands
The Services Component Runtime bundle registers a com.prosyst.util.pcommands.PluggableCommands
service that provides the console commands of the scr
group. Refer to the "Console Commands
" section for description of the scr
command.
Console Commands
The Services Component Runtime bundle provides the scr group of commands in the framework text console for executing operations over the components available in the framework. The scr command group is enabled only when there are instantiated components in the framework.
|
System Properties
|
References
发表评论
-
关于Felix Log Service
2012-12-07 16:44 1567OSGi服务纲要规范中定义了服务于OSGi平台的通用日志服 ... -
Maven 3 Felix 4 Eclipse 的搭建与部署(部分转载自别人文章)
2012-10-18 10:24 20324.1.开发环境搭建 4.2开发工具 Maven 3 F ... -
【绝对路径】OSGi环境中获取Plugin/Bundle中文件资源的绝对路径
2012-10-08 10:53 2492摘要:在进行Eclipse RCP开发的过程中,需要使用一 ... -
OpenCore:基于OSGi开发纯插件体系结构的WEB应用程序
2012-09-21 17:46 1423随着OSGi/Equinox逐渐成为Java EE服务端的基础 ... -
OSGi技术在Java Web开发中的应用
2012-09-20 11:26 1411随着 Java SE 对模块化功能原生支持的一再推迟(据最 ... -
OSGI典型的应用案例
2012-09-20 11:26 1634OSGI典型的应用案例主要有两个:分别是Eclipse和BMW ... -
OSGi特点
2012-09-20 11:26 12491、JRE版本无关性。虽然Java一直被人们认为是“Write ... -
OSGI与JMX 的关系
2012-09-19 17:09 1058不过重点是: JMX 本来设计的用途就只为了管理,我们不 ... -
在equinox环境开发web应用的"利器" -- registerResources()方法 详解
2012-09-19 17:07 1227registerResources()方法详解 1、简介 ... -
在equinox环境开发web应用的"利器" -- 序
2012-09-19 17:05 1362在equinox环境中开发web应用必须要借助一些工具包提供的 ... -
equinox环境下web应用资源的部署
2012-09-19 17:04 1307osgi的equinox实现环境下,web服务器和web应用都 ... -
OSGi产生的背景--在繁荣的混乱之中走出困惑
2012-09-19 16:58 1165软件的复杂性正在以惊 ... -
将web容器置于OSGi框架下进行web应用的开发
2012-09-16 14:26 3539将web容器置于OSGi框架下,其实就是将web容器做成OSG ... -
在Eclipse中开发OSGi Bundle
2012-09-16 14:26 1330Eclipse为开发OSGI Bundle提供了良好的支持,它 ... -
【第一代服务注册形式】 - 将一个Bundle注册为服务
2012-09-14 10:09 11551、创建业务接口类及其实现类 Java代码 ... -
Declarative Services规范简介及应用
2012-09-14 10:08 1421Declarative Services 是一 ... -
用FileInstall管理Bundle的动态安装、启动、卸载
2012-09-14 10:07 13321、文件目录如下: F:\study_osgi ... -
服务工厂 - Bundle消费者返回不同的服务对象
2012-09-14 10:03 1207一般情况下,服务对象在注册后,任何其它的Bundle在请求 ... -
服务跟踪(ServiceTracker)
2012-09-14 09:58 1159当多个Bundle使用同一 ... -
OSGi容器中Bundle之间Synchronous Communication
2012-09-11 17:07 1560OSGi Core定义了一个服务层,提供了一个Bundl ...
相关推荐
7. **服务组件运行时(SCR)**:OSGi 4.1中的服务组件运行时(Service Component Runtime)提供了一种声明式的方式来定义和管理服务。开发者可以通过XML配置文件声明服务接口、实现和依赖关系,简化了服务的管理和...
Felix SCR是Apache Felix框架的一部分,它实现了OSGi服务组件运行时(Service Component Runtime)规范。这个插件使得开发者能够在Gradle构建环境中方便地为OSGi模块创建和管理这些元数据,从而简化了在OSGi容器中...
在 Axis2 中,Web服务被视为一个服务组件(Service Component),这些组件可以在服务组件运行时环境(Service Component Runtime,SCRunTime)中部署和执行。 1. **模块化架构**:Axis2 的核心是一个模块化的架构,...
此外,我们需要确保所有涉及事务的服务都在同一个transaction scope内,这通常通过在OSGi的 Blueprint或Apache Felix的Service Component Runtime (SCR)配置中声明服务依赖和事务属性来完成。例如,我们可以使用`...
1. **服务组件运行时(Service Component Runtime, SCA)**:SCA是定义服务接口、组件和服务关系的标准化模型。它允许开发者以声明式的方式定义服务的依赖和交互,简化了服务的组合和部署。 2. **服务数据对象...
Apache Felix SCR(Service Component Runtime)是OSGi服务组件运行时的一部分,它提供了基于Declarative Services(DS)标准的组件管理系统。DS允许开发者声明式地定义服务组件及其依赖关系,使得组件可以在运行时...
Gemini Blueprint是Eclipse基金会的一个项目,它提供了一个实现OSGi服务组件模型(Service Component Runtime, SCR)的框架,使得在OSGi环境中开发和管理基于注解的Java EE服务变得更为简单。 OSGi是Java领域的一个...
4. **使用Felix SCR**:Apache Felix Service Component Runtime (SCR)是OSGi服务组件的实现,它允许你在OSGi环境中声明和管理组件。在Spring Bean上使用@Component和@Service等注解,声明它们为OSGi服务。 5. **...
在这个框架下,组件描述符(Service Component Runtime, SCR)是用于定义OSGi服务的关键组件。本文将围绕"carrot-osgi-anno-scr-make-2.0.1.zip"这个开源项目,深入探讨其在OSGi DS(Declarative Services)中的作用...
- **Service Component Runtime (SCR)**:Spring OSGi 使用 SCR 来管理和激活 Spring 组件。SCR 是 OSGi 规范的一部分,负责组件的生命周期管理。 - **Declarative Services (DS)**:DS 是一种声明式服务配置机制...
1. **DS元数据定义**:DS通过服务组件描述符(Service Component Runtime,SCR)元数据定义组件和服务。这些元数据通常位于`META-INF/spring`或`OSGI-INF`目录下的XML文件中,包含了服务接口、实现类、依赖服务等...
OSGi的核心在于其模块系统,称为服务组件运行时(Service Component Runtime,SCR),它定义了一种将Java类打包成称为“bundle”的模块化单元的方式。 OSGi的优势主要体现在以下几个方面: 1. **模块化**:OSGi...
Spring DM(Dynamic Modules)或Apache Felix的 SCR(Service Component Runtime)等工具可以帮助处理这种动态性,确保当服务可用时,对应的bean可以被正确注入。 5. **使用Blueprint或PAX Wiring**:这两个是OSGI...
同样地,还可以导入其他的Bundle,例如Servlet支持和Service Component Runtime (SCR)等。 #### 4. 使用Maven创建OSGi Bundle 除了导入现有的Bundle外,我们还可以创建自己的Bundle。这可以通过Maven命令实现: `...
californium是一个开源项目,它实现了OSGi服务组件运行时(Service Component Runtime, SCR)和CoAP(Constrained Application Protocol)协议,用于物联网(IoT)和嵌入式设备通信。在开发基于CoAP的应用程序时,这...
1. **Apache Aries Project Activator**:Activator是Apache Aries项目的一部分,它提供了服务组件模型(Service Component Runtime, SCD)的轻量级实现,帮助开发者在OSGi环境中管理服务生命周期。 2. **JDBC...
##### 2.3 服务组件模型(Service Component Runtime) OSGi R4引入了服务组件模型(SCR),这是一种用于管理服务生命周期和依赖关系的声明式方式。通过配置文件,开发人员可以定义服务的元数据以及与其他服务的...
在OSGi中,类型安全配置通常通过服务组件运行时(Service Component Runtime,SCR)来实现,开发者可以通过XML配置文件或者注解来定义服务组件及其依赖。配置信息会经过验证,以确保提供给组件的服务引用与其接口...
1. **CarrotGarden SCR**: 这可能是一个针对 Service Component Runtime (SCR) 的扩展或实现。SCR 是 OSGi(开放服务网关倡议)框架中的一个标准,它提供了一种管理和激活服务的方式。在 Java 应用程序中,SCR 允许...