- 浏览: 544985 次
- 性别:
- 来自: 西安
文章分类
- 全部博客 (251)
- UML/RUP/软件工程 (0)
- DDD:领域驱动设计 (1)
- IaaS/Paas/SaaS (1)
- Hadoop/YARN (10)
- PBDP项目 (2)
- OSGi-基础 (7)
- OSGi-Aries (2)
- OSGi-SpringDM (32)
- Oracle/MySQL/SS (8)
- Felix/Equinox/Bnd (14)
- Virgo Server/Gemini (7)
- Weblogic/JBoss/Tomcat (10)
- ActiveMQ (14)
- Camel (1)
- Spring Roo/Eclipse (7)
- Java/JSP/JSF (10)
- Maven (19)
- ESB-Mule (1)
- ESB-ServiceMix (18)
- SOA/SCA/SDO (12)
- WebService/RESTful (17)
- JS/jQuery/ExtJS (4)
- Spring/JPA/MVC (15)
- SpringSecurity (5)
- BPM/jBPM (3)
- Hudson/SVN/CI (0)
- LinuxOS/虚拟化 (25)
- Office/OpenOffice (1)
- 项目管理 (5)
- POI/jFreeChart (1)
最新评论
-
panamera:
请问JMS Transport 发布的webservice 是 ...
CXF 提供的Service Transport-JMS Transpor -
jianyi296:
where is attachment.
CXF WebService Dynamic Client -
hj01kkk:
您好,我用jdbc-user-service为什么每次验证时都 ...
SpringSecurity笔记3-Authenticating Users:Authenticaton Strategy -
wufenglin1231:
你好,我在实现Mapping exceptions to re ...
RESTful 异常处理 -
xchd:
[echo] Project: common
[echo ...
Hive安装配置学习笔记
Any bean in a Spring DM application context can easily get a reference to its bundle context by implementing the BundleContextAware interface (located in the org.springframework.osgi.context
package). When instantiating the bean, the Spring DM application context implementation detects that it implements this special interface and automatically hands the bundle context to the bean by calling the sole method of the interface, setBundleContext .
1. 自动注入BundleContext
public class OsgiAddict implements BundleContextAware
{
public void setBundleContext(BundleContext bundleContext) {
...
}
}
<bean id="osgiAddict" class="com.manning.sdmia.ch04.OsgiAddict" />
2. Setter注入BundleContext
public class PojoOsgiAddict {
private BundleContext bundleContext;
public void setBundleContext(BundleContext bundleContext) {
this.bundleContext = bundleContext;
}
}
<bean id="pojoOsgiAddict" class="com.manning.sdmia.ch04.PojoOsgiAddict">
<property name="bundleContext" ref="bundleContext" />
</bean>
3. Interact declaratively with bundles
The Spring DM osgi namespace comes with a bundle element that makes it possible to get
references to OSGi bundles and even manipulate them. By using the bundle element in an
application context, you define an org.osgi.framework.Bundle bean in it. For example:
<osgi:bundle id="springDmExtenderBundle" symbolic-
name="org.springframework.osgi.extender" />
<osgi:bundle id="myBundle" location="file:/my/bundle/repo/somebundle.jar" action="start" />
Attributes of the bundle element:
(1)
Attribute name:id
Values:Any XML-valid ID
Description:Unique ID of the bean in the application context.
(2)
Attribute name:symbolic-name
Values:Any valid OSGi symbolic-name
Description:The symbolic name of an already installed bundle
(3)
Attribute name:location
Values:Spring resource syntax
Description:The location to load the bundle from, usually to interact with and call some lifecycle
methods.
(4)
Attribute name:start-level
Values:Integer
Description:The bundle start level.
(5)
Attribute name:action
Values:install, start, update, stop, uninstall
Description: An action executed on the bundle. This uses the same semantics as the methods
from the Bundle interface, with preconditions weakened.
(6)
Attribute name:
Values:install, start, update,stop, uninstall
Description:An action executed on the bundle when the application context is destroyed. This uses
the same semantics as the methods from the Bundle interface, with preconditions weakened.
发表评论
-
SpringDM笔记31-Testing with OSGi and SpringDM
2011-11-22 10:27 12441. 创建一个SpringDM测试类 SpringD ... -
SpringDM笔记30-OSGi中使用SSL/STL
2011-11-21 11:55 1319SSL:Secure Sockets Layer ... -
SpringDM笔记29-Require-Bundle与Import-Package的区别
2011-11-21 10:31 2238具体可参考:http://www.osgi.org/bl ... -
SpringDM笔记28-OSGi Bundle Activities with Spring-DM
2011-11-17 10:19 1159OSGi框架中也支持搞层次的模块交互:bundles.例如 ... -
SpringDM笔记28-Spring And OSGi:Layers of Integration
2011-11-15 11:00 11751. Application Design:Service和B ... -
SpringDM笔记27-Extending The Stand Extender and Configure
2011-09-02 09:38 8691. -
SpringDM笔记25-Using AJAX frameworks with Spring DM:GWT
2011-09-01 08:53 12001. Using Spring DM with AJAX fr ... -
SpringDM笔记24-Using action-based web frameworks with Spring DM:SpringMVC
2011-08-30 09:33 1478■ Action-based web frameworks ... -
SpringDM笔记23-Using the open EntityManager in view pattern实现延迟加载
2011-08-30 09:27 15671. The open EntityManager in vi ... -
SpringDM笔记22-Transactions Support With SpringDM
2011-08-29 21:24 12101. Spring’s transactional suppo ... -
SpringDM笔记21-Using ORM within OSGi with Spring DM
2011-08-25 10:31 2096Version 1.Object/relational ma ... -
SpringDM笔记20-Using JDBC within OSGi with Spring DM
2011-08-25 09:08 1776The public API for interact ... -
SpringDM笔记19-SpringDM如何处理OSGi应用的动态行为
2011-08-24 08:51 1142ServiceTracker 1. Dealing ... -
SpringDM笔记18-Designing OSGi Enterprise Applications
2011-08-22 11:08 11221. Organizing OSGi components ... -
SpringDM笔记17-Handling Collections of OSGi Services
2011-08-20 09:12 15421.Configuring collections:the l ... -
SpringDM笔记16-处理OSGi服务的动态性:事件
2011-08-19 09:51 17791. Service registration and unr ... -
SpringDM笔记15-通过声明特定的属性注册和引用服务
2011-08-18 11:01 14071. Configuration for registerin ... -
SpringDM笔记14-The thread context classloader 及在OSGi中的运用
2011-08-18 10:40 22481. Using the thread context cla ... -
SpringDM笔记13-OSGi服务注册与引用
2011-08-18 09:28 34501. Combining OSGi services and ... -
SpringDM笔记12-Spring DM’s web Extender运行机制
2011-08-17 11:04 2087SpringDM把一个WAR作为一个Bundle, 其实 ...
相关推荐
spring-osgi-1.2.1-with-dependencies.zip spring-osgi-1.2.1-with-dependencies.zip spring-osgi-1.2.1-with-dependencies.zip
spring-osgi-1.2.0-rc1-with-dependencies.zip
spring-osgi-1.2.1-with-dependencies完整包
spring-osgi-1.2.0-with-dependencies.zip spring-osgi-1.2.0-with-dependencies.zip spring-osgi-1.2.0-with-dependencies.zip
spring-framework-2.0-with-dependencies.zi
spring-framework-3.0.5.RELEASE-dependencies spring依赖的jar包
spring-framework-1.0-with-dependencies.zip
spring cloud的pom文件,解决maven无法导入依赖的问题,spring-cloud-dependencies-Finchley.SR2.pom文件
spring-framework-2.5.5-with-dependencies.part03.rar spring-framework-2.5.5-with-dependencies.part03.rar spring-framework-2.5.5-with-dependencies.part03.rar
spring-framework-2.5.5-with-dependencies.part03.rar
spring-framework-2.0-with-dependencies.zip spring-framework-2.0-with-dependencies.zip spring-framework-2.0-with-dependencies.zip spring-framework-2.0-with-dependencies.zip spring-framework-2.0-with-...
spring框架jar包 "This product includes software developed by the Spring Framework Project (http://www.springframework.org).
spring-framework-2.5.6-with-dependencies 有点大,就打了3个包。
spring-framework-1.2.7-with-dependencies.zip 在JBuilder中加入SPring框架 所需要的文件
最全的spring2.5.4版本,包含aop,aspectj,c3p0,cglibj2ee等jar包。版本全称spring-framework-2.5.4-with-dependencies
spring框架的压缩包,spring的整个框架的内容及帮助文档,工具,api等。spring-framework-2.0.6-with-dependencies.zip
spring-framework-3.0.5.RELEASE-dependencies 好不容易找到了,赶紧分享一下 因为不能大于20M,共分了8个包,都是独立的,我列了目录,可以只下载需要的包,这是1号包: 1号包: edu.emory.mathcs.backport edu.oswego.cs....
spring-framework-2.5-rc2-with-dependencies\spring-framework-2.5-rc2\spring-framework-2.5-rc2源代码
spring-framework-2.5.5-with-dependencies.part02.rar spring-framework-2.5.5-with-dependencies.part02.rar spring-framework-2.5.5-with-dependencies.part02.rar
下载解压即可使用,当然需要的一些环境还需要另外下载,比如Zipkin,SkyWalking,nacos等