微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

OfficeFloor IoC框架

程序名称:OfficeFloor

授权协议: GPLv3

操作系统: 跨平台

开发语言: Java

OfficeFloor 介绍

OfficeFloor 是一个 IoC 2.0 的实现,主要是聚焦于方法的依赖注入而不是对象。OfficeFloor
还拥有一个基于Eclipse的图形化配置插件,如下图所示:

示例代码

// OfficeFloor source to create an inline HTTP Server (useful for testing a single web page).
// Note that applications would be configured using the WoOF graphical configuration.
HttpServerAutoWireOfficeFloorSource server = new HttpServerAutoWireOfficeFloorSource();

// Add a dynamic web page (ExampleBean provides the page logic and is just a POJO)
server.addHttpTemplate("example.html", ExampleBean.class);

// Add configured DataSource for dependency injection
server.addManagedobject(DataSourceManagedobjectSource.class, null, DataSource.class).loadProperties("datasource.properties");

// Assign Team (specific thread pool) responsible for executing the methods with a DataSource dependency
server.assignTeam(leaderFollowerTeamSource.class, DataSource.class).addProperty("size", "10");

// Start the HTTP Server
server.openOfficeFloor();

OfficeFloor 官网

http://www.officefloor.net/

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐