#
SVN Service Wrapper for Windows
This is my Win32 Service wrapper for SVN. Source is included, and its in the public domain. No need to copyright this stuff.
Usage instructions:
SVNService -? to display this list
SVNService -install <svnserve parameters> to install the service
SVNService -setup <svnserve parameters> to change command line parameters for svnserve
SVNService -remove to remove the service
SVNService -debug to run as a console app for debugging
Example:
SVNService -install -d -r c:\svnrepo
SVNService -setup -d -r c:\otherplace\svnrepo
IMPORTANT:
Make sure you place SVNService.exe in the same directory as svnserve.exe
Special thanks go to Craig Link at Microsoft for creating the initial service.c.
-Magnus Norddahl
dwr.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
"http://www.getahead.ltd.uk/dwr/dwr10.dtd">
<dwr>
<allow>
<create creator="spring" javascript="UserDAO">
<param name="beanName" value="userDao"/>
<include method="addUser"/>
<include method="removeUser"/>
<include method="findUserByName"/>
</create>
<convert converter="bean" match="martin.dwr.demo.model.User">
<param name="include" value="id,name,password,age"/>
</convert>
</allow>
</dwr>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>config-admin</param-name>
<param-value>WEB-INF/classes/dwr.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
</web-app>
applicationContext.xml
<bean id="userDao" class="martin.dwr.demo.dao.hibernate.HibernateUserDAO">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
浏览:
http://localhost:8080/demo/dwr/index.html 查看调试信息
AnnotationSessionFactoryBean 继承LocalSessionFactoryBean
今天用到,查了一下refrence,顺便把它贴出来:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>classpath:jdbc.properties</value>
</property>
</bean>
<bean id="c3p0DataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass">
<value>${db.driverClass}</value>
</property>
<property name="jdbcUrl">
<value>${db.url}</value>
</property>
<property name="properties">
<props>
<prop key="c3p0.acquire_increment">5</prop>
<prop key="c3p0.idle_test_period">100</prop>
<prop key="c3p0.max_size">100</prop>
<prop key="c3p0.max_statements">0</prop>
<prop key="c3p0.min_size">10</prop>
<prop key="user">${db.user}</prop>
<prop key="password">${db.pass}</prop>
</props>
</property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
</props>
</property>
<property name="dataSource" ref="c3p0DataSource"/>
<property name="annotatedClasses" value="martin.dwr.demo.model.User"/>
</bean>
<bean id="userDao" class="martin.dwr.demo.dao.hibernate.HibernateUserDAO">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
</beans>