Java ¶àÏß³Ì ¼òµ¥Àý×Ó
ÒòΪ¹¤×÷ÐèÒª£¬ÐèÒªÔÚͬһʱ¼äÖ´Ðжà´Îij¸ö²Ù×÷£¬¿´¿´ÊÇ·ñ»áÒýÆðÊý¾ÝµÄdeadlockÎļþ¡£
¶àÏ߳̾ßÌåÖ´ÐÐÀà
package com.ericyang.test.cmdline;
import java.util.List;
import java.text.SimpleDateFormat;
import java.text.DateFormat;
import java.util.Date;
class ThreadClass extends xxxTestBase implements Runnable{
private static String[] Import_args;
public ThreadClass(String[] args){
Import_args = args;
}
public void run()
{
SimpleDateFormat bartDateFormat =
new SimpleDateFormat("EEEE-MMMM-dd-yyyy");
DateFormat shortDateFormat =
DateFormat.getDateTimeInstance(
DateFormat.SHORT,
DateFormat.SHORT);
Date date = new Date();
System.out.println(bartDateFormat.format(date));
System.out.println("Thread starting time:"+shortDateFormat.format(date));
try {
runCmd(Import_args);
}catch (Exception ex) {
System.out.println(ex.getMessage());
}
System.out.println("Thread ending time:"+shortDateFormat.format(date));
}
}
/*xxxTestBase ÊÇÎÒµÄÒ»¸öÖ´ÐлùÀ࣬ËüÓк¯Êý runCmd(Import_args);¿ÉÒÔ¾ßÌåÖ´ÐÐһЩÃüÁîÐвÙ×÷*/
/**
* ConcurrentExecClass.java version 1.0 March 5, 2010
*/
package com.ericyang.test.cmdline;
import com.ericyang.test.cmdline.ThreadClass;
/*
* @author Eric Yang
*
*/
public class ConcurrentBfimortProjEnvFltFullTest extends xxxTestBase {
private static final String IMPORT_FILE =
TestConstants.BF_TEST_SRC_DIR
+ "/etc/bf7112_auto_bf_p_I_f_e_01.xml";
private static final String IMPORT_FILE2 =
TestConstants.BF_TEST_SRC_DIR
+ "/etc/bf7112_auto_bf_p_env_05.xml";
private static final String IMPORT_FILE3 =
TestConstants.BF_TEST_SRC_DIR
+ "/etc/bf7112_flt_include4.xml";
private static ExecutionResults execResults = null;
/**
* This method will perform any type of
* set up.
*
* @throws Exception
Ïà¹ØÎĵµ£º
×î½üдÔ˼۵Äϵͳ,дµÃºÃÀÛ°¡,²»¹ý²î²»¶à½Ó½üÍê³ÉÁË.µ«±àÂëµÄÎÊÌâÒ»Ö±¶¼ÊÇËƶ®·Ç¶®µÄ.
Ö»ºÃÒ»µãµãÈ¥ËÑË÷javaºÍhtmlµÄ±àÂëÎÊÌâ.ºÃ·³,µ½×îºó,ÎÊÌâÊǽâ¾öÁË,µ«²»ÊÇ×îÍêÕûµÄ´¦Àí·½·¨.Ï£ÍûÒÔºó¿ÉÒÔ´¦ÀíºÃ.
ÔÚÒ»¸östruts2µÄ·µ»ØÌáʾµÄ×Ö·û´®µ½Ò³ÃæÖÐ.ÎÊÌâ¾ÍÊdzöÔÚÕâ×Ö·û´®ÖÐÓÐÍøÒ³µÄ»»Ð ......
windows xpÏÂÅäÖÃJDK»·¾³±äÁ¿£º
1.°²×°JDK£¬°²×°¹ý³ÌÖпÉÒÔ×Ô¶¨Ò尲װĿ¼µÈÐÅÏ¢£¬ÀýÈçÎÒÃÇÑ¡Ôñ°²×°Ä¿Â¼ÎªD:\java\jdk1.5.0_08£»
¡¡ 2.°²×°Íê³Éºó£¬ÓÒ»÷“ÎҵĵçÄÔ”£¬µã»÷“ÊôÐÔ”£»
3.Ñ¡Ôñ“¸ß¼¶”Ñ¡Ï£¬µã»÷“ ......
È«ÇòʯÓÍÍø£¨www.cippe.net£©´´½¨ÓÚ2004Ä꣬Öص㱨µÀÈ«ÇòʯÓ͹¤ÒµÐ²úÆ·¡¢Ð¼¼Êõ£¬¼á³ÖÆ·ÅÆ»¯¡¢×¨Òµ»¯¡¢¹ú¼Ê»¯µÄÕ½ÂÔ·¢Õ¹·½Ïò£¬´Ù½øÈ«ÇòʯÓ͹¤Òµ¼¼Êõ½»Á÷Óë×°±¸Ã³Ò×£¬ÍƽøÖйúʯÓ͹¤Òµ»¯·¢Õ¹Ëٶȣ¡
ÍøÕ¾º¸ÇµØÖÊ¿±Ì½¡¢ÓÍÆø²Ø¡¢×ê¾®¡¢²â¾®¡¢²ÉÓÍ¡¢×°±¸¡¢º£ÑóʯÓÍ¡¢´¢ÔË¡¢Á¶»¯µÈרҵÁìÓò£¬´´°ìÁËʯÓÍ×ÊѶ¡¢Ð²úƷм¼Êõ¡¢Ê¯Ó ......
µÚÒ»ÕÂ ÒýÑÔ
(By wind5shy£ºhttp://blog.csdn.net/wind5shy)
µÚ¶þÕ ´´½¨ºÍÏú»Ù¶ÔÏó
(By wind5shy£ºhttp://blog.csdn.net/wind5shy)
µÚ1Ìõ£º¿¼ÂÇÓþ²Ì¬¹¤³§·½·¨´úÌæ¹¹Ô캯Êý
ºÃ´¦£º
¾²Ì¬¹¤³§·½·¨ÓÐÃû×Ö£¬±í´ï¸üÇå³þ¡£
²»Ðè´´½¨ÐµĶÔÏó¡£
¿ÉÒÔ·µ»ØÔ·µ»ØÀàÐ͵Ä×ÓÀàÐͶÔÏó¡£Ó¦Óãº1.·µ»ØÀàÐͶ¨ÒåΪ½ ......
Ò».ÔÚj2seÀïÎÒÃÇ¿ÉÒÔʹÓÃMath.random()·½·¨À´²úÉúÒ»¸öËæ»úÊý£¬Õâ¸ö²úÉúµÄËæ»úÊýÊÇ0-1Ö®¼äµÄÒ»¸ödouble£¬ÎÒÃÇ¿ÉÒÔ°ÑËû³ËÒÔÒ»¶¨µÄÊý£¬±ÈÈç˵³ËÒÔ100£¬Ëû¾ÍÊǸö100ÒÔÄÚµÄËæ»ú£¬Õâ¸öÔÚj2meÖÐûÓС£
¶þ.ÔÚjava.utilÕâ¸ö°üÀïÃæÌṩÁËÒ»¸öRandomµÄÀ࣬ÎÒÃÇ¿ÉÒÔн¨Ò»¸öRandomµÄ¶ÔÏóÀ´²úÉúËæ»úÊý£¬Ëû¿ÉÒÔ²úÉúËæ»úÕûÊý¡¢Ëæ»úfloat¡¢ ......