- 浏览: 546116 次
- 性别:
- 来自: 西安
文章分类
- 全部博客 (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安装配置学习笔记
1. 创建工程
mvn archetype:create -DgroupId=com.manning.sdmia -DartifactId=SpringDM-Web-Sample
文件目录结构:
SpringDM-Web-Sample\
src/
main/
java/
webapp/
WEB-INF/
web.xml
index.html
index.jsp
test/
pom.xml:
...
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.4</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Include-Resource>
src/main/webapp
</Include-Resource>
<Web-ContextPath>
SpringDM-Web-Sample
</Web-ContextPath>
</instructions>
</configuration>
</plugin>
...
2. 工程打包
The bundle will be deployed in two steps: it will be deployed as a bundle in the OSGi container,
then the Spring DM web extender will react to its registration with OSGi by deploying it to the
web container. To be deployed by the web extender, a bundle needs to meet one of two
conditions:
■ Its filename ends with .war.
■ It contains a WEB-INF directory at its root.
3. 部署测试
install file:///D:/sts_workspace/SpringDM-Web-Sample/target/SpringDM-Web-Sample-1.0.0.jar
访问地址路径:
■ http://localhost:8080/SpringDM-Web-Sample/
■ http://localhost:8080/SpringDM-Web-Sample/index.jsp
测试代码:
public class SpringDmWebSampleTest extends AbstractConfigurableBundleCreatorTests {
public void testIntegration() throws Exception{
boolean bundleIsHereAndStarted = false;
for(Bundle bundle : bundleContext.getBundles()){
if("com.manning.sdmia.SpringDM-Web-Sample".equals(bundle.getSymbolicName())
&&bundle.getState() == Bundle.ACTIVE){
bundleIsHereAndStarted = true;
break;
}
}
assertEquals("SpringDM-Web-Bundle is not installed or activated!", bundleIsHereAndStarted);
Thread.sleep(10*1000);
testConnection("http://localhost:8080/SpringDM-Web-Sample/index.html");
testConnection("http://localhost:8080/SpringDM-Web-Sample/index.jsp");
}
private void testConnection(String address) throws Exception {
URL url = new URL(address);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setUseCaches(false);
try {
con.connect();
assertEquals(HttpURLConnection.HTTP_OK, con.getResponseCode());
} finally {
con.disconnect();
}
}
@Override
protected String[] getTestBundlesNames() {
return new String[] {
"org.springframework.osgi, spring-osgi-web,"
+ getSpringDMVersion(),
"org.springframework.osgi, spring-osgi-web-extender,"
+ getSpringDMVersion(),
"javax.servlet, com.springsource.javax.servlet, 2.4.0",
"org.springframework.osgi, catalina.osgi, 5.5.23-SNAPSHOT",
"org.springframework.osgi, catalina.start.osgi, 1.0.0",
"org.springframework.osgi, jsp-api.osgi, 2.0-SNAPSHOT",
"org.springframework.osgi, jasper.osgi, 5.5.23-SNAPSHOT",
"org.springframework.osgi, commons-el.osgi, 1.0-SNAPSHOT",
"org.springframework.osgi, jstl.osgi, 1.1.2-SNAPSHOT",
"com.manning.sdmia, SpringDM-Web-Sample, 1.0.0" };
}
@Override
protected Resource getTestingFrameworkBundlesConfiguration() {
return new InputStreamResource(SpringDmWebSampleTest.class
.getResourceAsStream("boot-bundles.properties"));
}
}
其中文件boot-bundles.properties:
4.启动容器
java -jar org.eclipse.osgi-3.5.1.R35x_v20090827.jar -console
5.案例代码
将附件SpringDM-Web-Sample.rar
评论
发表评论
-
SpringDM笔记31-Testing with OSGi and SpringDM
2011-11-22 10:27 12481. 创建一个SpringDM测试类 SpringD ... -
SpringDM笔记30-OSGi中使用SSL/STL
2011-11-21 11:55 1320SSL:Secure Sockets Layer ... -
SpringDM笔记29-Require-Bundle与Import-Package的区别
2011-11-21 10:31 2245具体可参考:http://www.osgi.org/bl ... -
SpringDM笔记28-OSGi Bundle Activities with Spring-DM
2011-11-17 10:19 1164OSGi框架中也支持搞层次的模块交互:bundles.例如 ... -
SpringDM笔记28-Spring And OSGi:Layers of Integration
2011-11-15 11:00 11791. Application Design:Service和B ... -
SpringDM笔记27-Extending The Stand Extender and Configure
2011-09-02 09:38 8721. -
SpringDM笔记25-Using AJAX frameworks with Spring DM:GWT
2011-09-01 08:53 12041. Using Spring DM with AJAX fr ... -
SpringDM笔记24-Using action-based web frameworks with Spring DM:SpringMVC
2011-08-30 09:33 1481■ Action-based web frameworks ... -
SpringDM笔记23-Using the open EntityManager in view pattern实现延迟加载
2011-08-30 09:27 15701. The open EntityManager in vi ... -
SpringDM笔记22-Transactions Support With SpringDM
2011-08-29 21:24 12151. Spring’s transactional suppo ... -
SpringDM笔记21-Using ORM within OSGi with Spring DM
2011-08-25 10:31 2098Version 1.Object/relational ma ... -
SpringDM笔记20-Using JDBC within OSGi with Spring DM
2011-08-25 09:08 1779The public API for interact ... -
SpringDM笔记19-SpringDM如何处理OSGi应用的动态行为
2011-08-24 08:51 1146ServiceTracker 1. Dealing ... -
SpringDM笔记18-Designing OSGi Enterprise Applications
2011-08-22 11:08 11241. Organizing OSGi components ... -
SpringDM笔记17-Handling Collections of OSGi Services
2011-08-20 09:12 15431.Configuring collections:the l ... -
SpringDM笔记16-处理OSGi服务的动态性:事件
2011-08-19 09:51 17861. Service registration and unr ... -
SpringDM笔记15-通过声明特定的属性注册和引用服务
2011-08-18 11:01 14091. Configuration for registerin ... -
SpringDM笔记14-The thread context classloader 及在OSGi中的运用
2011-08-18 10:40 22511. Using the thread context cla ... -
SpringDM笔记13-OSGi服务注册与引用
2011-08-18 09:28 34511. Combining OSGi services and ... -
SpringDM笔记12-Spring DM’s web Extender运行机制
2011-08-17 11:04 2089SpringDM把一个WAR作为一个Bundle, 其实 ...
相关推荐
NULL 博文链接:https://springsfeng.iteye.com/blog/1149243
NULL 博文链接:https://springsfeng.iteye.com/blog/1148907
adt-bundle-windows-x86-20140624
Android开发环境adt-bundle-windows-x86_64-20140624
adt-bundle-windows-x86-20140624
下面俩个版本都能正常使用: 编译器版本号:adt-bundle-windows-x86_64-20130717 编译器版本号:adt-bundle-windows-x86_64-20130917 汉化方法: 拷贝中文包中的文件到编译器同名目录下
mybatis-spring-1.0.1-bundle.zipmybatis-spring-1.0.1-bundle.zipmybatis-spring-1.0.1-bundle.zip
spring-tool-suite-3.8.4.RELEASE-e4.6.3-win32-x86_64
adt-bundle-windows-x86_64-20190307, 支持android4.4、android5.1 android6.0 android7.1 android8.1 androidP
sqlite-netFx40-setup-bundle-x86-2010-1.0.113.0.exe
adt-bundle-windows-x86_64_20140101.zip下载,百度云盘分享链接下载
VMware-Horizon-Extras-Bundle-5.1.0-13920927
adt-bundle-windows-x86,adt-bundle-windows-x86,adt-bundle-windows-x86 adt-bundle-windows-x86,adt-bundle-windows-x86,adt-bundle-windows-x86 adt-bundle-windows-x86,adt-bundle-windows-x86,adt-bundle-...
mybatis spring 官方下载 mybatis-spring-1.0.1-bundle.zip 和 pdf文档
Android 集成开发环境 adt-bundle-windows-x86_64-20131030(64位, 多SDK版) 自带Eclipse, Android SDK(2.2到4.4的SDK都有),自己下载后重新打的包
gatling-charts-highcharts-bundle-3.3.1-bundle,很好用的测试工具,有一定的学习成本。
hudi-hadoop-mr-bundle-0.11.0.jar 配合文档
sqlite-netFx40-setup-bundle-x64-2010-1.0.113.0
2013版adt-bundle
android开发,adt-bundle-windows-x86_64中eclipse所需的sdk,包括android-16,android-18,android-19,android-20,android-22,android-23,android-25,android-27,android-28,百度网盘下载后,直接解压到adt-...