Spring configuration clean-up

* Regrouped component definitions into one single file per package in
most cases, with a few exceptions

* Added documentation about how the configuration is stored and which
guidelines should be followed when adding or modifying Spring component
configurations.
This commit is contained in:
Emmanuel BENOîT 2012-02-04 12:56:58 +01:00
parent 597429fadf
commit 35d8891fe3
62 changed files with 211 additions and 451 deletions
legacyworlds-server-main/src/main/resources

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:annotation-config />
</beans>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<!-- ========================================================== -->
<!-- Spring configuration loader for all "real" game components -->
<!-- ========================================================== -->
<import resource="game/resources.xml" />
<import resource="game/updates.xml" />
</beans>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<!-- ================================================= -->
<!-- Spring configuration loader for "meta" components -->
<!-- ================================================= -->
<import resource="meta/accounts.xml" />
<import resource="meta/bt.xml" />
<import resource="meta/eventlog.xml" />
<import resource="meta/i18n.xml" />
<import resource="meta/mailer.xml" />
<import resource="meta/naming.xml" />
<import resource="meta/sessions.xml" />
<import resource="meta/system.xml" />
</beans>

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
</beans>

View file

@ -2,30 +2,31 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<!-- ================================================== -->
<!-- Legacy Worlds server - Spring configuration loader -->
<!-- ================================================== -->
<!-- Use annotations to determine component wiring -->
<context:annotation-config />
<!-- Server terminator bean -->
<!-- Transaction manager -->
<import resource="configuration/transactions.xml" />
<!-- Server terminator -->
<bean id="terminator" class="com.deepclone.lw.srv.ServerTerminatorBean" />
<!-- Load transaction manager -->
<import resource="configuration/transaction-bean.xml" />
<!-- "Meta" components -->
<import resource="configuration/meta.xml" />
<!-- Load all system and low-level beans -->
<import resource="configuration/accounts-beans.xml" />
<import resource="configuration/bt-beans.xml" />
<import resource="configuration/eventlog-beans.xml" />
<import resource="configuration/i18n-beans.xml" />
<import resource="configuration/mailer-beans.xml" />
<import resource="configuration/naming-beans.xml" />
<import resource="configuration/system-beans.xml" />
<import resource="configuration/user-beans.xml" />
<!-- Session types and command handlers -->
<import resource="configuration/session-types.xml" />
<!-- Load both the "final" component configuration file and the "simple"
implementation from B6M1. -->
<!-- Load both the "final" game file and the "simple" implementation from
B6M1. -->
<import resource="configuration/game.xml" />
<import resource="configuration/simple-beans.xml" />
<import resource="configuration/simple.xml" />
</beans>