SR-JRC | a java richclient framework |
| configure application and services As already mentioned at "first steps", the <?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-2.5.xsd"> ... <beans> data-access-context.xml , which defines serveral classes for database access and the like. Additionally there exists security-context.xml , but you could consider it a an empty placeholder. Limiting access is already prepared at several places, but as I don't really have the need to use it, there's no much pressure to dedicate my human resources on that issues. At application start all defined classes from At <bean id="sysInfo" class="de.schwarzrot.system.SysInfo" /> <bean . The mandatory parameters are "id" and "class". Some classes don't have a default-constructor, which means, they need some parameters. Parameters could be specified like this: <bean id="dataSourceManager" class="de.schwarzrot.data.access.jdbc.DataSourceManager"> <constructor-arg> <ref bean="dsConfig" /> </constructor-arg> </bean> <ref After creating an instance, it might be necessary to set some properties. Therefor a tag <bean id="prefsEntityManager" class="de.schwarzrot.data.access.pref.PreferencesEntityManager"> <property name="entityUtils" ref="entityUtils" /> <property name="entityIntrospector> <ref="preferencesEntityIntrospector" /> </property> <property name="applicationName" value="${de/schwarzrot/app/config/SystemDefault/applicationName}" /> <property name="schemaName" value="${de/schwarzrot/app/config/SystemDefault/dsSchema}" /> </bean> Properties can also be set using list values: <bean id="converterFactory" class="de.schwarzrot.data.support.ConverterFactory"> <property name="converters"> <list> <ref bean="cnvDate" /> <ref bean="cnvBoolean" /> <ref bean="cnvInt" /> <ref bean="cnvLong" /> <ref bean="cnvByte" /> <ref bean="cnvShort" /> <ref bean="cnvFloat" /> <ref bean="cnvDouble" /> <ref bean="cnvColor" /> <ref bean="cnvEnum" /> <ref bean="cnvFile" /> <ref bean="cnvString" /> <ref bean="cnvEntity" /> </list> </property> </bean> ... same is true for Maps: <bean id="appServices" class="de.schwarzrot.app.support.ApplicationServiceConfigurer"> <property name="services"> <!-- // IMPORTANT: don't change the keys, // change the bean definition above (if ever) --> <map> <entry key="de.schwarzrot.data.transaction.support.TransactionFactory"> <ref bean="transactionFactory" /> </entry> <entry key="de.schwarzrot.ui.image.ImageFactory" value-ref="imageFactory" /> <entry key="de.schwarzrot.ui.Desktop" value-ref="desktop" /> <entry key="de.schwarzrot.data.support.ConverterFactory" value-ref="converterFactory" /> </map> </property> </bean> The last passage already introduced the class, that is responsable for publishing instances from All instances, that are added to the "services" map property will be registered to the That's the reason too, why you never should change an existing key from the services map. Other classes may rely on that entry! But of cause it is leagal to publish on instance using different keys ... |