锘??xml version="1.0" encoding="utf-8" standalone="yes"?>宅男噜噜噜66一区二区66,成人一区二区三区,久久免费一区http://www.aygfsteel.com/jesson2005/articles/98541.html寮犻噾楣?/dc:creator>寮犻噾楣?/author>Wed, 07 Feb 2007 03:23:00 GMThttp://www.aygfsteel.com/jesson2005/articles/98541.htmlhttp://www.aygfsteel.com/jesson2005/comments/98541.htmlhttp://www.aygfsteel.com/jesson2005/articles/98541.html#Feedback0http://www.aygfsteel.com/jesson2005/comments/commentRss/98541.htmlhttp://www.aygfsteel.com/jesson2005/services/trackbacks/98541.html----------->Spring閰嶇疆鏂囦歡鐨勫弬鑰?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "

<beans>
聽聽聽 <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
聽聽<property name="driverClassName">
聽聽聽<value>${jdbc.driverClassName}</value>
聽聽</property>
聽聽<property name="url">
聽聽聽<value>${jdbc.url}</value>
聽聽</property>
聽聽<property name="username">
聽聽聽<value>${jdbc.username}</value>
聽聽</property>
聽聽<property name="password">
聽聽聽<value>${jdbc.password}</value>
聽聽</property>
聽</bean>
聽聽聽 <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
聽聽<property name="locations">
聽聽聽<list>
聽聽聽聽<value>classpath:/config/jdbc.properties</value>
聽聽聽聽<value>classpath:/config/customer.properties</value>
聽聽聽</list>
聽聽</property>
聽</bean>

聽<bean id="ftpHandle" class="com.stt.dosp.datacollect.remote.FtpHandle"
聽聽abstract="false" singleton="true" lazy-init="default"
聽聽autowire="default" dependency-check="default">
聽聽<property name="server">
聽聽聽<value type="java.lang.String">${ftp.ip}</value>
聽聽</property>
聽聽<property name="user">
聽聽聽<value type="java.lang.String">${ftp.user}</value>
聽聽</property>
聽聽<property name="password">
聽聽聽<value type="java.lang.String">${ftp.password}</value>
聽聽</property>
聽聽<property name="remotePath">
聽聽聽<value type="java.lang.String">${ftp.remotePath}</value>
聽聽</property>
聽聽<property name="localPath">
聽聽聽<value type="java.lang.String">${ftp.localPath}</value>
聽聽</property>
聽聽<property name="temp">
聽聽聽<value type="java.lang.String">${ftp.temp}</value>
聽聽</property>
聽</bean>

聽<bean id="fileHandle"
聽聽class="com.stt.dosp.datacollect.local.FileHandle" abstract="false"
聽聽singleton="true" lazy-init="default" autowire="default"
聽聽dependency-check="default">
聽聽<property name="ftpHandle">
聽聽聽<ref bean="ftpHandle" />
聽聽</property>
聽聽<property name="batchSize">
聽聽聽<value type="java.lang.Long">${local.batch}</value>
聽聽</property>
聽聽<property name="backupDir">
聽聽聽<value type="java.lang.String">${local.backup}</value>
聽聽</property>
聽聽<property name="doubleNameFix">
聽聽聽<value type="java.lang.String">
聽聽聽聽${local.double.name.fix}
聽聽聽</value>
聽聽</property>
聽聽<property name="insertSQL">
聽聽聽<value type="java.lang.String">${db.insert}</value>
聽聽</property>
聽</bean>

聽<bean id="connectFtpServerTask"
聽聽class="com.stt.dosp.datacollect.schedule.ConnectFtpServerTask"
聽聽abstract="false" singleton="true" lazy-init="default"
聽聽autowire="default" dependency-check="default">
聽聽<property name="ftpHandle">
聽聽聽<ref bean="ftpHandle" />
聽聽</property>
聽</bean>
聽聽聽
聽聽聽 <bean id="collectLocalTask"
聽聽class="com.stt.dosp.datacollect.schedule.CollectLocalTask"
聽聽abstract="false" singleton="true" lazy-init="default"
聽聽autowire="default" dependency-check="default">
聽聽<property name="fileHandle">
聽聽聽<ref bean="fileHandle" />
聽聽</property>
聽</bean>

聽<bean id="ftpConnectCheck" class="org.springframework.scheduling.timer.ScheduledTimerTask">
聽聽<property name="timerTask">
聽聽聽<ref bean="connectFtpServerTask" />
聽聽</property>
聽聽<property name="period">
聽聽聽<value>${ftp.task.period}</value>
聽聽</property>
聽聽<property name="delay">
聽聽聽<value>${ftp.task.delay}</value>
聽聽</property>
聽</bean>

聽<bean id="localFileCheck" class="org.springframework.scheduling.timer.ScheduledTimerTask">
聽聽<property name="timerTask">
聽聽聽<ref bean="collectLocalTask" />
聽聽</property>
聽聽<property name="period">
聽聽聽<value>${local.task.period}</value>
聽聽</property>
聽聽<property name="delay">
聽聽聽<value>${local.task.delay}</value>
聽聽</property>
聽</bean>

聽<bean id="timerBean" class="org.springframework.scheduling.timer.TimerFactoryBean">
聽聽<property name="scheduledTimerTasks">
聽聽聽<list>聽聽聽聽
聽聽聽聽<ref bean="ftpConnectCheck" />
聽聽聽聽<ref bean="localFileCheck" />
聽聽聽</list>
聽聽</property>
聽</bean>

聽</beans>




--------->鍚姩綾誨弬鑰?
/**
聽* 鍚姩綾?br />聽* @author zhangjp
聽* @version 1.0
聽*/
public class StartMain {

聽/**
聽 * @param args
聽 */
聽聽public static void main(String[] args) {
聽聽 /*
聽 鍙渶瑕佸垵濮嬪寲涓涓猼askBean灝卞彲浠ュ姞杞絊cheduledTimerTask浠誨姟闃熷垪
聽聽 "<list>聽聽聽聽
聽聽聽聽聽 聽<ref bean="ftpConnectCheck" />
聽聽聽聽聽聽聽 <ref bean="localFileCheck" />
聽聽聽 聽聽</list>"
聽聽聽 閲岀殑鎵鏈変換鍔?br />聽 */
聽聽聽SpringBeanFactory.getBean("connectFtpServerTask");聽聽
聽聽聽do{
聽聽聽聽聽聽 聽聽try {
聽聽聽聽聽聽聽聽聽聽聽聽聽 聽聽Thread.sleep(1000);聽
聽 聽//鍥犱負main綾繪槸涓涓繘紼?鎵浠ヨ浣縨ain涓嶉鍑?鍔犱竴涓樆濉?br />聽聽 //(浣跨敤Thread.sleep(1000);聽鎴栬匱imer timer = new聽Timer();閮藉彲浠?
聽聽聽聽聽聽聽聽聽聽聽} catch (InterruptedException e) {
聽聽聽聽聽聽聽聽聽聽聽聽聽聽 聽// TODO Auto-generated catch block
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 e.printStackTrace();
聽聽聽聽聽聽聽聽聽 聽}
聽聽聽}while(true);

聽}

}


---------->榪愯鍚姩綾?鍙互緙栧啓鍚勪釜騫沖彴鐨剆hell鑴氭湰,濡?".bat" ".sh"鏂囦歡)
.bat鑴氭湰鍙傝?windows):----->
@Echo Off
title dosp_collect

If %1.==CPGEN. GoTo :CPGEN

Rem ============= CLASSPATH ===================
Echo Generating classpath ...
Set CLASSPATH=
For %%X in (dospcollect-lib/*.jar) Do Call %0 CPGEN dospcollect-lib\%%X
For %%X in (common-lib/*.jar) Do Call %0 CPGEN common-lib\%%X

Rem ============= START DOSP COLLECT SERVER ===================
Echo Starting Dosp Collect Server ...
java聽 -Xms128m -Xmx256m聽 -classpath %CLASSPATH% com.stt.dosp.datacollect.startup.StartMain
GoTo :END

Rem ============= CLASSPATH HELP ===================
Rem This target is used to concatenate the classpath parts
:CPGEN
Set CLASSPATH=%CLASSPATH%;%2

Rem ============= END ===================
Rem Target needed to jump to the end of the file
:END


.sh鑴氭湰鍙傝?linux/unix)----->
#!/bin/bash

# don't run聽 DOSP COLLECT Server as root
if [ $UID -eq 0 ] ; then
聽echo
聽echo "For security reasons you should not run this script as root!"
聽echo
聽exit 1
fi聽

# go to current directory
cd `dirname $0`/..

# defining some variables
COMMON_LIB="common-lib"
DOSP_LIB="dospcollect-lib"

# generating the proper classpath
echo "Generating classpath ..."
CLASSPATH=""
for N in $COMMON_LIB/*.jar; do CLASSPATH="$CLASSPATH$N:"; done聽
for N in $DOSP_LIB/*.jar; do CLASSPATH="$CLASSPATH$N:"; done聽

# startup聽 DOSP COLLECT Server
echo "Starting聽 Dosp-Collect Server ..."
java聽 -Xms128m -Xmx256m -classpath $CLASSPATH com.stt.dosp.datacollect.startup.StartMain



]]>
主站蜘蛛池模板: 齐齐哈尔市| 基隆市| 高台县| 吉水县| 彭泽县| 丰台区| 扬州市| 唐海县| 盐津县| 三台县| 盐城市| 泰来县| 铜川市| 来安县| 古蔺县| 大丰市| 郁南县| 晋州市| 铜山县| 册亨县| 乌鲁木齐市| 上高县| 沅江市| 沾益县| 改则县| 礼泉县| 库尔勒市| 张家口市| 铜陵市| 舒兰市| 博湖县| 亚东县| 龙门县| 萍乡市| 五大连池市| 河间市| 治县。| 库伦旗| 灌阳县| 肃北| 灵川县|