`
文章列表

stax官方文档

 
                                              stax官方文档
接上文,为了测试已经搭好的架子,创建了一个注册实体的Bundle(wanged_security_entity),这个里面包含了两个实体类(Role、User)和它们的Hibernate映射文件(Role.hbm.xml、User.hbm.xml),以及一个实现了EntityRegister接口的类(SecurityEntityRegisterImpl)以提供注册实体的服务。这里仅将SecurityEntityRegisterImpl的代码列出如下: java 代码 package wanged.security.entity; import java.util. ...
先来说说整合Hibernate的关键之处。其实用OSGi整合Hibernate很简单,但要通过Bundle方式做到可以扩展新的持久化层面的东西(比如添加新的表和操作)就比较费事了。因为Hibernate在初始化时根据注册的实体类创建SessionFactory,这样当有新的实体类添加进来时就要创建新的SessionFactory,这样系统中出现两个甚至多个SessionFatory会导致一系列的问题。显然整合Hibernate关键就是解决实体类注册与SessionFactory创建的问题。 我的具体思路如下。 首先将Hibernate单独多为一个Bundle ...
本文讨论四种解决方案:1.模型对象(Domain Objects)插件模型对象(Domain Objects)集中到独立的插件(Bundle)内,Hibernate插件依赖这些模型对象插件。这是最简单的,也是比较糟糕的方式,比较小的基于OSGi的项目可以这也作做。2.改进的模型对象(Domain Objects)插件把模型对象插件当作Hibernate插件的Fragments3. Eclipse-BuddyPolicy与Eclipse-RegisterBuddy方式Equinox(Eclipse提供的OSGi实现)平台特有的方式,允许插件(Bundle)声明自己的伙伴,让“伙伴插件”来动态加载本 ...
I am using only the 3rd party bundles from the revision 6343, spring-osgi-core, spring-osgi-extender, io and mock are from revision 6170. (I've got compilation errors on the new version)... anyway:The thing is that I've got a lot of class not found errors when I try to use hibernate3 and spring-hiber ...
[Eclipse] Access restriction: Class is not accessible due to restriction on required library By Kamal Mettananda Published: 09 September 2008 "Access restriction: Class is not accessible due to restriction on required library"; error message may be shown while develop ...
This example creates a simple bundle that listens for OSGi service events. This example does not do much at first, because it only prints out the details of registering and unregistering services. In the next example we will create a bundle that implements a service, which will cause this bundle to a ...
总结了一下:1、把第三方包的class文件改造为一个bundle,export所有的package2、使用了eclipse的equinox实现启动所有bundle3、在eclipse环境下启动都正常,但是放在命令行(windows/linux都一样)启动,都失败,即出现:Exception in thread 'Thread-1' java.lang.NoClassDefFoundError: javax/naming/NamingException  at java.lang.Class.forName0(Native Method)  at java.lang.Class.forName(C ...
osgi中的事件通知机制,采用了Publish-Subscribe 的模式,首先所有的event Handler都需要在osgi框架中将自己进行注册成服务接口为org.osgi.service.event.EventHandler的服务,在注册的同时,需要将自己希望处理的处理的事件的topic和对事件进行过滤的filter作为所注册服务的属性,完成这个操作后,event admin Service就能在进行事件通知时,查找到合适EventHandler来处理所发生的事件。    在进行事件的发布时,Event Publisher从osgi框架中获取到event admin Service,需要借 ...
在多线程大师Doug Lea的贡献下,在JDK1.5中加入了许多对并发特性的支持,例如:线程池。 一、简介线程池类为 java.util.concurrent.ThreadPoolExecutor,常用构造方法为: ThreadPoolExecutor(int corePoolSize, int maximumPoolSize,long keepAliveTime, TimeUnit uni ...
<script type="text/javascript">            //全局变量            var i=0;            //添加行            function addMyRow(){                var mytable = document.getElementById("mybody");                var mytr = mytable.insertRow();                mytr.setAttribute("id&qu ...
专杀工具合集 2008/05/01 18:45   前不久又中毒了,杀毒软件打不开,大多数安全网站也开不了,明明知道是什么毒,却总是除不掉,进程和注册表也不太懂,重装费时费力,所以把一些常见的专杀工具总结于此,造福人民。                              360专杀工具集 360顽固木马专杀大全http://dl.360safe.com/360compkill.zip 机器狗木马专杀http://dl.360safe.com/killer_rodog.exe 磁碟机病毒专杀http://dl.360safe.com/killer_cd ...
HQL查询: Criteria查询对查询条件进行了面向对象封装,符合编程人员的思维方式,不过HQL(Hibernate Query Lanaguage)查询提供了更加丰富的和灵活的查询特性,因此Hibernate将HQL查询方式立为官方推荐的标准查询方式,HQL查询在涵盖Criteria查询的所有功能的前提下,提供了类似标准SQL语句的查询方式,同时也提供了更加面向对象的封装。完整的HQL语句形势如下: Select/update/delete…… from …… where …… group by …… having …… order by …… asc/desc 其中的update/dele ...
CXF有多种数据绑定方式,如:Aegis  Databinding,JAXB,MTOM Attachments . 其中JAXB(JavaTM Architecture for XML Binding)是其默认的数据绑定方式。JAXB是一套自动映射XML和Java实例的开发接口和工具。 如果web Service
OSGI StartLevel explained and using 启动级别机制和使用 bundle startlevel 实际的应用环境中,我们的 bundle 互相有一定的依赖关系,所以在启动的顺序上要有所区别,好比盖楼,要从打地基开始。实际上,OSGi 框架最初的 start level 是 0,启动顺序如下:将启动级别加一,如果发现有匹配的 bundle(即 bundle 的启动级别和目前的启动级别相等),则启动这个 bundle;继续第一步,直到发现已经启动了所有的 bundle,且活动启动级别和最后的启动的 bundle 启动级别相同。 停止顺序,也是首先将系统的 start l ...
Global site tag (gtag.js) - Google Analytics