David, Thanks for the remind. As we are working on a feature branch(Javelin) and thought not to heat-up the mailing list while everyone is still busy on getting the 4.0 release out of the door.
We are evaluating the possibility to leverage Spring Framework to standardize Dependency injection/AOP pattern usages in CloudStack. Spring framework is very popular to Java community and under Apache license. By switching the underlying architecture plumbing to a de-facto standardized framework would help attract developers to focus more on CloudStack core business logic with already familiar coding practices. We will not extensively use full featured Spring Framework, may primarily on core DI/AOP features since these are commonly used in CloudStack, we also haven't decided to go with Spring annotation based approach or XML based approach yet. With currently check-ins, they are annotation based which I personally prefer, however, this may change, depends on how to get our old code loaded nicely under Spring. If anyone does have a strong opinion on this, please feel free to share with us. Kelven On 10/19/12 3:47 PM, "David Nalley" <da...@gnsa.us> wrote: >This adds a number of new dependencies. > >This needs to explicitly be discussed before it gets committed. >See below for reference: >http://markmail.org/message/huevw4ur73a64b5c > >On Fri, Oct 19, 2012 at 6:25 PM, <kelv...@apache.org> wrote: >> Updated Branches: >> refs/heads/javelin a75916d45 -> 8ef9e32cf >> >> >> Architecture refactoring - Stateless management server - Spring >>Framework initiatives >> >> >> Project: >>http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo >> Commit: >>http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/8ef9e3 >>2c >> Tree: >>http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/8ef9e32c >> Diff: >>http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/8ef9e32c >> >> Branch: refs/heads/javelin >> Commit: 8ef9e32cfda4b1ce138ac167caa26521bd7a3508 >> Parents: a75916d >> Author: Kelven Yang <kelven.y...@citrix.com> >> Authored: Fri Oct 19 15:24:01 2012 -0700 >> Committer: Kelven Yang <kelven.y...@citrix.com> >> Committed: Fri Oct 19 15:24:15 2012 -0700 >> >> ---------------------------------------------------------------------- >> client/WEB-INF/web.xml | 9 ++- >> pom.xml | 81 >>+++++++++++++++ >> utils/conf/db.properties | 1 + >> utils/src/com/cloud/utils/events/EventBus.java | 4 +- >> utils/src/com/cloud/utils/events/EventBusBase.java | 5 +- >> utils/src/com/cloud/utils/events/Subscriber.java | 4 +- >> 6 files changed, 99 insertions(+), 5 deletions(-) >> ---------------------------------------------------------------------- >> >> >> >>http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8ef9e32c >>/client/WEB-INF/web.xml >> ---------------------------------------------------------------------- >> diff --git a/client/WEB-INF/web.xml b/client/WEB-INF/web.xml >> index 50f2455..c6fd30f 100644 >> --- a/client/WEB-INF/web.xml >> +++ b/client/WEB-INF/web.xml >> @@ -20,7 +20,14 @@ >> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee >>http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" >> version="2.5"> >> >> - >> + <listener> >> + >><listener-class>org.springframework.web.context.ContextLoaderListener</li >>stener-class> >> + </listener> >> + <context-param> >> + <param-name>contextConfigLocation</param-name> >> + <param-value>classpath:applicationContext.xml</param-value> >> + </context-param> >> + >> <servlet> >> <servlet-name>cloudStartupServlet</servlet-name> >> >><servlet-class>com.cloud.servlet.CloudStartupServlet</servlet-class> >> >> >>http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8ef9e32c >>/pom.xml >> ---------------------------------------------------------------------- >> diff --git a/pom.xml b/pom.xml >> index 3c14d4e..5f63ce6 100644 >> --- a/pom.xml >> +++ b/pom.xml >> @@ -79,6 +79,7 @@ >> <cs.servlet.version>2.4</cs.servlet.version> >> <cs.jstl.version>1.2</cs.jstl.version> >> >><cs.selenium.server.version>1.0-20081010.060147</cs.selenium.server.versi >>on> >> + >><org.springframework.version>3.0.5.RELEASE</org.springframework.version> >> <skipTests>true</skipTests> >> >> </properties> >> @@ -169,6 +170,86 @@ >> <version>${cs.junit.version}</version> >> <scope>test</scope> >> </dependency> >> + >> + <dependency> >> + <groupId>org.springframework</groupId> >> + <artifactId>spring-core</artifactId> >> + <version>${org.springframework.version}</version> >> + </dependency> >> + >> + <dependency> >> + <groupId>org.springframework</groupId> >> + <artifactId>spring-expression</artifactId> >> + <version>${org.springframework.version}</version> >> + </dependency> >> + >> + <dependency> >> + <groupId>org.springframework</groupId> >> + <artifactId>spring-beans</artifactId> >> + <version>${org.springframework.version}</version> >> + </dependency> >> + >> + <dependency> >> + <groupId>org.springframework</groupId> >> + <artifactId>spring-aop</artifactId> >> + <version>${org.springframework.version}</version> >> + </dependency> >> + >> + <dependency> >> + <groupId>org.springframework</groupId> >> + <artifactId>spring-context</artifactId> >> + <version>${org.springframework.version}</version> >> + </dependency> >> + >> + <dependency> >> + <groupId>org.springframework</groupId> >> + <artifactId>spring-context-support</artifactId> >> + <version>${org.springframework.version}</version> >> + </dependency> >> + >> + <dependency> >> + <groupId>org.springframework</groupId> >> + <artifactId>spring-tx</artifactId> >> + <version>${org.springframework.version}</version> >> + </dependency> >> + >> + <dependency> >> + <groupId>org.springframework</groupId> >> + <artifactId>spring-jdbc</artifactId> >> + <version>${org.springframework.version}</version> >> + </dependency> >> + >> + <dependency> >> + <groupId>org.springframework</groupId> >> + <artifactId>spring-orm</artifactId> >> + <version>${org.springframework.version}</version> >> + </dependency> >> + >> + <dependency> >> + <groupId>org.springframework</groupId> >> + <artifactId>spring-oxm</artifactId> >> + <version>${org.springframework.version}</version> >> + </dependency> >> + >> + <dependency> >> + <groupId>org.springframework</groupId> >> + <artifactId>spring-web</artifactId> >> + <version>${org.springframework.version}</version> >> + </dependency> >> + >> + <dependency> >> + <groupId>org.springframework</groupId> >> + <artifactId>spring-webmvc</artifactId> >> + <version>${org.springframework.version}</version> >> + </dependency> >> + >> + <dependency> >> + <groupId>org.springframework</groupId> >> + <artifactId>spring-test</artifactId> >> + <version>${org.springframework.version}</version> >> + <scope>test</scope> >> + </dependency> >> + >> </dependencies> >> >> <build> >> >> >>http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8ef9e32c >>/utils/conf/db.properties >> ---------------------------------------------------------------------- >> diff --git a/utils/conf/db.properties b/utils/conf/db.properties >> index 6bdb6d6..8d98119 100644 >> --- a/utils/conf/db.properties >> +++ b/utils/conf/db.properties >> @@ -24,6 +24,7 @@ cluster.servlet.port=9090 >> # CloudStack database settings >> db.cloud.username=cloud >> db.cloud.password=cloud >> +db.root.password= >> db.cloud.host=localhost >> db.cloud.port=3306 >> db.cloud.name=cloud >> >> >>http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8ef9e32c >>/utils/src/com/cloud/utils/events/EventBus.java >> ---------------------------------------------------------------------- >> diff --git a/utils/src/com/cloud/utils/events/EventBus.java >>b/utils/src/com/cloud/utils/events/EventBus.java >> index 4195acd..c1b6f70 100644 >> --- a/utils/src/com/cloud/utils/events/EventBus.java >> +++ b/utils/src/com/cloud/utils/events/EventBus.java >> @@ -17,9 +17,11 @@ >> >> package com.cloud.utils.events; >> >> +import java.io.Serializable; >> + >> public interface EventBus { >> void subscribe(String subject, Subscriber subscriber); >> void unsubscribe(String subject, Subscriber subscriber); >> >> - void publish(String subject, PublishScope scope, Object sender, >>String args); >> + void publish(String subject, PublishScope scope, Object sender, >>Serializable args); >> } >> >> >>http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8ef9e32c >>/utils/src/com/cloud/utils/events/EventBusBase.java >> ---------------------------------------------------------------------- >> diff --git a/utils/src/com/cloud/utils/events/EventBusBase.java >>b/utils/src/com/cloud/utils/events/EventBusBase.java >> index 0c135db..cd10f1d 100644 >> --- a/utils/src/com/cloud/utils/events/EventBusBase.java >> +++ b/utils/src/com/cloud/utils/events/EventBusBase.java >> @@ -17,6 +17,7 @@ >> >> package com.cloud.utils.events; >> >> +import java.io.Serializable; >> import java.util.ArrayList; >> import java.util.HashMap; >> import java.util.List; >> @@ -72,7 +73,7 @@ public class EventBusBase implements EventBus { >> >> @Override >> public void publish(String subject, PublishScope scope, Object >>sender, >> - String args) { >> + Serializable args) { >> >> if(_gate.enter(true)) { >> >> @@ -283,7 +284,7 @@ public class EventBusBase implements EventBus { >> _children.put(key, childNode); >> } >> >> - public void notifySubscribers(String subject, Object >>sender, String args) { >> + public void notifySubscribers(String subject, Object >>sender, Serializable args) { >> for(Subscriber subscriber : _subscribers) { >> subscriber.onPublishEvent(subject, >>sender, args); >> } >> >> >>http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8ef9e32c >>/utils/src/com/cloud/utils/events/Subscriber.java >> ---------------------------------------------------------------------- >> diff --git a/utils/src/com/cloud/utils/events/Subscriber.java >>b/utils/src/com/cloud/utils/events/Subscriber.java >> index 7af283b..c3baa6f 100644 >> --- a/utils/src/com/cloud/utils/events/Subscriber.java >> +++ b/utils/src/com/cloud/utils/events/Subscriber.java >> @@ -17,6 +17,8 @@ >> >> package com.cloud.utils.events; >> >> +import java.io.Serializable; >> + >> public interface Subscriber { >> - void onPublishEvent(String subject, Object sender, String args); >> + void onPublishEvent(String subject, Object sender, Serializable >>args); >> } >>