锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品激情av电影在线观看,懂色av一区二区三区免费看,色综合欧美在线 http://www.aygfsteel.com/jedikings/zh-cn Mon, 04 Aug 2025 12:53:40 GMT Mon, 04 Aug 2025 12:53:40 GMT 60 JTA in Jboss (DataBase mysql) http://www.aygfsteel.com/jedikings/archive/2006/09/01/66990.htmlJedi Jedi Fri, 01 Sep 2006 00:55:00 GMT http://www.aygfsteel.com/jedikings/archive/2006/09/01/66990.html http://www.aygfsteel.com/jedikings/comments/66990.html http://www.aygfsteel.com/jedikings/archive/2006/09/01/66990.html#Feedback 0 http://www.aygfsteel.com/jedikings/comments/commentRss/66990.html http://www.aygfsteel.com/jedikings/services/trackbacks/66990.html 1. mysql driver -> server\default\lib 2. jdbc connection datasource server/default/deploy/mysql-xa-ds.xml <?xml version="1.0" encoding="UTF-8"?> <datasources> 聽(tīng)<xa-datasource> 聽(tīng)聽(tīng)<jndi-name>MySqlXADS </jndi-name> 聽(tīng)聽(tīng)<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class> 聽(tīng)聽(tīng)<xa-datasource-property name="Url">jdbc:mysql://127.0.0.1:3306/temp </xa-datasource-property> 聽(tīng)聽(tīng)<xa-datasource-property name="User">root </xa-datasource-property> 聽(tīng)聽(tīng)<xa-datasource-property name="Password">....</ xa-datasource-property> 聽(tīng)聽(tīng)<user-name>root </user-name> 聽(tīng)聽(tīng)<password>.....</ password> 聽(tīng)聽(tīng)<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name> 聽(tīng)聽(tīng)<metadata> 聽(tīng)聽(tīng)聽(tīng)<type-mapping>mySQL</type-mapping> 聽(tīng)聽(tīng)</metadata> 聽(tīng)</xa-datasource> </datasources>
3. server/default/conf/standardjbosscmp-jdbc.xml <defaults> 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) <datasource>java:/MySqlXADS</datasource> 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) <datasource-mapping>mySQL</datasource-mapping> .... ....聽(tīng)聽(tīng) </defaults>
4. server/default/conf/jboss-service.xml <mbean code="org.jboss.tm.XidFactory" 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) name="jboss:service=XidFactory"> 聽(tīng)//uncommented the line below... 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) <attribute name="Pad">true</attribute> 聽(tīng)聽(tīng) </mbean>
]]>Axis Tips http://www.aygfsteel.com/jedikings/archive/2006/08/15/58338.htmlJedi Jedi Tue, 15 Aug 2006 01:22:00 GMT http://www.aygfsteel.com/jedikings/archive/2006/08/15/58338.html http://www.aygfsteel.com/jedikings/comments/58338.html http://www.aygfsteel.com/jedikings/archive/2006/08/15/58338.html#Feedback 0 http://www.aygfsteel.com/jedikings/comments/commentRss/58338.html http://www.aygfsteel.com/jedikings/services/trackbacks/58338.html 2. 涓嶈鐢↙ist錛屽敖閲忕敤鏁扮粍!ValueBean[]聽(tīng)getValues()聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng) {聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)ArrayList聽(tīng)result聽(tīng) = 聽(tīng) new 聽(tīng)ArrayList();聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) return 聽(tīng)(ValueBean[])聽(tīng)result.toArray();聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)} 涓婇潰鐨勪唬鐮佽繕鏄細(xì)鍑洪棶棰橈紝瑕佺敤iterator涓涓竴涓猰ap榪囧幓public 聽(tīng) class 聽(tīng)ValueHelper聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng) {聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) public 聽(tīng) static 聽(tīng)ValueBean[]聽(tīng)toArray(List聽(tīng)values)聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) { 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)ValueBean[]聽(tīng)result聽(tīng) = 聽(tīng) new 聽(tīng)ValueBean[values.size()];聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)I(yíng)terator聽(tīng)i聽(tīng) = 聽(tīng)values.iterator();聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) int 聽(tīng)i聽(tīng) = 聽(tīng) 0 ;聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) while 聽(tīng)(i.hasNext())聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) {聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)ValueBean聽(tīng)value聽(tīng) = 聽(tīng)(ValueBean)聽(tīng)i.next();聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)result[i ++ ]聽(tīng) = 聽(tīng)value;聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)} 聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) return 聽(tīng)result;聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)} 聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)} 聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)ValueBean[]聽(tīng)getValues()聽(tīng) {聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)ArrayList聽(tīng)result聽(tīng) = 聽(tīng) new 聽(tīng)ArrayList();聽(tīng)聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) return 聽(tīng)ValueHelper.toArray(result);聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)} 3. 瑕佺敓鎴愮鍚坵s-i鐨剋eb service鏈濂界敤document/literal <service name="MyWebRes" provider="java:RPC" style="document "use="literal"> ]]> A good Http debug Utility - fiddler http://www.aygfsteel.com/jedikings/archive/2006/08/15/58599.htmlJedi Jedi Tue, 15 Aug 2006 01:15:00 GMT http://www.aygfsteel.com/jedikings/archive/2006/08/15/58599.html http://www.aygfsteel.com/jedikings/comments/58599.html http://www.aygfsteel.com/jedikings/archive/2006/08/15/58599.html#Feedback 0 http://www.aygfsteel.com/jedikings/comments/commentRss/58599.html http://www.aygfsteel.com/jedikings/services/trackbacks/58599.html http://www.fiddlertool.com/fiddler/聽(tīng) .net framework 1.1 needed for firefox need some added configurat menu->tools->preference/option->connection settings->bottom-> C:\Documents and Settings\jedikings\My Documents\Fiddler\Scripts\BrowserPAC.js -> reload ]]> Mozilla web service proxy~~ (for all Gecko-based browser) http://www.aygfsteel.com/jedikings/archive/2006/07/11/57630.htmlJedi Jedi Tue, 11 Jul 2006 04:13:00 GMT http://www.aygfsteel.com/jedikings/archive/2006/07/11/57630.html http://www.aygfsteel.com/jedikings/comments/57630.html http://www.aygfsteel.com/jedikings/archive/2006/07/11/57630.html#Feedback 0 http://www.aygfsteel.com/jedikings/comments/commentRss/57630.html http://www.aygfsteel.com/jedikings/services/trackbacks/57630.html
var
聽(tīng)proxy
=
聽(tīng)
null
;
聽(tīng)
function 聽(tīng)聽(tīng)getTest()聽(tīng)聽(tīng) // 聽(tīng)test聽(tīng)by聽(tīng)the聽(tīng)way聽(tīng)amazon聽(tīng)uses { 聽(tīng)聽(tīng)聽(tīng)聽(tīng) if 聽(tīng)( ! proxy)聽(tīng) { 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) var 聽(tīng)listener聽(tīng) = 聽(tīng) {聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) // 聽(tīng)gets聽(tīng)called聽(tīng)once聽(tīng)the聽(tīng)proxy聽(tīng)has聽(tīng)been聽(tīng)instantiated 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)onLoad:聽(tīng) function 聽(tīng)(aProxy)聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) { 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)proxy聽(tīng) = 聽(tīng)aProxy; 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)proxy.setListener(listener); 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)requestTest(); 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)} , 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) // 聽(tīng)gets聽(tīng)called聽(tīng)if聽(tīng)an聽(tīng)error聽(tīng)occurs 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)onError:聽(tīng) function 聽(tīng)(aError)聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) { 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)alert(aError); 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)} , 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) // 聽(tīng)callback聽(tīng)function聽(tīng)is聽(tīng)hardcoded聽(tīng)to聽(tīng){methodname}Callback聽(tīng)in聽(tīng)1.4beta 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)getInstanceByIDCallback聽(tīng):聽(tīng) function 聽(tīng)(aresult)聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) { 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)alert( " enter聽(tīng)callback " );聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) // alert("a="+aresult.a+",聽(tīng)b="+aresult.b); 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)} 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)}; 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)createProxy(listener); 聽(tīng)聽(tīng)聽(tīng)聽(tīng)} 聽(tīng)聽(tīng)聽(tīng)聽(tīng)else 聽(tīng) { 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)requestTest( ); 聽(tīng)聽(tīng)聽(tīng)聽(tīng)} }function 聽(tīng)createProxy(aCreationListener)聽(tīng) { 聽(tīng)聽(tīng)聽(tīng)聽(tīng) try 聽(tīng) { 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) var 聽(tīng)factory聽(tīng) = 聽(tīng) new 聽(tīng)WebServiceProxyFactory(); 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)factory.createProxyAsync("...wsdl location...." ,聽(tīng)"binding name",聽(tīng)"",聽(tīng)true,聽(tīng)aCreationListener); 聽(tīng)聽(tīng)聽(tīng)聽(tīng)} 聽(tīng)聽(tīng)聽(tīng)聽(tīng)catch 聽(tīng)(ex)聽(tīng) { 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)alert( " test聽(tīng) " + 聽(tīng)ex); 聽(tīng)聽(tīng)聽(tīng)聽(tīng)} }function 聽(tīng)聽(tīng)requestTest()聽(tīng) { 聽(tīng)聽(tīng)聽(tīng)聽(tīng) if 聽(tīng)(proxy)聽(tīng) { 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)netscape.security.PrivilegeManager.enablePrivilege( " UniversalBrowserRead " ); 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) /**/ /* 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)//聽(tīng)if聽(tīng)complex聽(tīng)object聽(tīng)is聽(tīng)the聽(tīng)parameter 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)var聽(tīng)KeywordSearchRequest聽(tīng)=聽(tīng)new聽(tīng)Object();聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)KeywordSearchRequest.page="1"; 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)KeywordSearchRequest.mode="books"; 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)KeywordSearchRequest.tag="webservices-20"; 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)KeywordSearchRequest.type="lite"; 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)KeywordSearchRequest.devtag="D2Z2KU2NWTOHI"; 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)KeywordSearchRequest.format="xml"; 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)KeywordSearchRequest.version="1.0"; 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)*/ 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)proxy.getInstanceByID(" id..... " ); 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)alert( " call聽(tīng)complete! " ); 聽(tīng)聽(tīng)聽(tīng)聽(tīng)} 聽(tīng)聽(tīng)聽(tīng)聽(tīng)else 聽(tīng) { 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)alert( " Error:聽(tīng)Proxy聽(tīng)set聽(tīng)up聽(tīng)not聽(tīng)complete! " ); 聽(tīng)聽(tīng)聽(tīng)聽(tīng)} }
鐢ㄨ搗鏉ヨ繕鏄緢綆鍗曪紝鍞竴瑕佹敞鎰忕殑鏄敤Axis鐢熸垚Web Service鐨勬椂鍊欒寰楀湪global configuration閲岄潰鏀逛竴涓?br /><parameter name="sendMultiRefs" value="false"/> ie涓嬬殑璇濅篃鏈変竴涓獁ebservice.htc錛屾病浠旂粏鐮旂┒榪?. ]]> Reading notes -- Singleton pattern http://www.aygfsteel.com/jedikings/archive/2006/07/09/57330.htmlJedi Jedi Sun, 09 Jul 2006 04:42:00 GMT http://www.aygfsteel.com/jedikings/archive/2006/07/09/57330.html http://www.aygfsteel.com/jedikings/comments/57330.html http://www.aygfsteel.com/jedikings/archive/2006/07/09/57330.html#Feedback 0 http://www.aygfsteel.com/jedikings/comments/commentRss/57330.html http://www.aygfsteel.com/jedikings/services/trackbacks/57330.html
public
聽(tīng)
class
聽(tīng)Singleton聽(tīng){ 聽(tīng)聽(tīng)聽(tīng)聽(tīng)
private
聽(tīng)
volatile
聽(tīng)
static
聽(tīng)Singleton聽(tīng)uniqueInstance; 聽(tīng)聽(tīng)聽(tīng)聽(tīng)
private
聽(tīng)Singleton(){ 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)} 聽(tīng)聽(tīng)聽(tīng)聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)
public
聽(tīng)
static
聽(tīng)Singleton聽(tīng)getInstance(){ 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
if
(uniqueInstance
==
null
){ 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
synchronized
(Singleton.
class
){ 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
if
(uniqueInstance
==
null
){ 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)uniqueInstance聽(tīng)
=
聽(tīng)
new
聽(tīng)Singleton(); 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)} 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)} 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)}聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
return
聽(tīng)uniqueInstance;聽(tīng) 聽(tīng)聽(tīng)聽(tīng)聽(tīng)} }
1. private constructor 2. static getInstance 3. syncronized..waste a lot of time 4. double check..modified syncronize, so time-waste might occurs only when first time the instance construct ]]> What's the JRE means (zz) http://www.aygfsteel.com/jedikings/archive/2006/06/24/54810.htmlJedi Jedi Fri, 23 Jun 2006 19:26:00 GMT http://www.aygfsteel.com/jedikings/archive/2006/06/24/54810.html http://www.aygfsteel.com/jedikings/comments/54810.html http://www.aygfsteel.com/jedikings/archive/2006/06/24/54810.html#Feedback 1 http://www.aygfsteel.com/jedikings/comments/commentRss/54810.html http://www.aygfsteel.com/jedikings/services/trackbacks/54810.html
http://www.newsmth.net/bbscon.php?bid=756&id=53934
浠ユ垜鐨勬満鍣ㄤ負(fù)渚?br />鎴戝緱jdk瑁呭湪浜?br />C:\Program Files\Java\jdk1.5.0_06 瀹夎榪欎釜jdk鐨勬椂鍊欙紝瀹冭姹傛垜瀹夎jre錛屾垜涔熼夋嫨瑁呬簡(jiǎn)錛岃鍦ㄤ簡(jiǎn) C:\Program Files\Java\jre1.5.0_06
鐒跺悗聽(tīng) C:\Program Files\Java\jdk1.5.0_06\ 鐩綍涓嬫湁涓猨re鐩綍 灝辨槸瀛樺湪聽(tīng) C:\Program Files\Java\jdk1.5.0_06\jre聽(tīng) 榪欎箞涓涓猨re
C:\Program Files\Java\jre1.5.0_06聽(tīng) 鎴戜滑鍙畠 jre a C:\Program Files\Java\jdk1.5.0_06\jre聽(tīng) 鎴戜滑鍙畠 jre b
騫沖父鎵璇寸殑jre鏄寚聽(tīng) 榪欓噷鐨刯re a錛屽畠鏄負(fù)浜?jiǎn)璁╀綘鐨勬満鍣ㄥ彲浠q愯 java紼嬪簭鐨?br />鍙兘榪愯錛屼笉鑳藉紑鍙戯紝鍥犱負(fù)娌℃湁javac 榪欎釜jre鍙互鍗曠嫭瀹夎錛岀増鏈竴鏍風(fēng)殑璇濋兘涓鏍鳳紙鏍規(guī)嵁licene錛屽ソ璞$洰鍓嶄笉鍏佽鍓錛?/p>
jre b 鏄殢jdk鐨勶紝涓嶈兘涓嶈錛屽洜涓郝?jdk>jre聽(tīng) jdk涔熼渶瑕乯re鍟?br />灝辨槸瑁卝dk灝變細(xì)鍑虹幇榪欎釜jre b
涓鐐歸珮綰х殑錛宩rea 鍜?jreb鏈変粈涔堜笉鍚?br /> jreb 鏄負(fù)jdk鏈嶅姟鐨勶紝瀹冩湁jrea鐨勫叏閮ㄥ姛鑳斤紝鍚屾椂涓轟簡(jiǎn)jdk鏈嶅姟錛屽畠鐨勭被搴擄紝姣旀柟璇磖t.jar 錛屽涓浜涜皟璇曚俊鎭紝鍥犱負(fù)寮鍙慾ava紼嬪簭錛屼細(xì)璋冭瘯鍟婏紝鐢╦rea娌″姙娉曡皟璇曪紝姣旀柟璇翠笉鑳芥柇鐐瑰埌 聽(tīng)鍩虹綾誨簱閲岄潰 鐪媕rea鍜宐鐨剅t.jar 澶у皬涓嶄竴鏍鳳紝jreb鐨勫ぇ涓浜涳紝甯︽湁璋冭瘯淇℃伅錛堜富瑕佹槸class閲岀殑 LineNumberTable) ,鎵浠ヨ繍琛屾椂錛宩reb鐨勯熷害鎴栬呰澆鍏ラ熷害闅懼厤鎱竴浜涳紝鎴栬呰錛岀敤jdk榪?br />琛宩ava紼嬪簭姣攋re榪愯鎱竴浜涳紝铏界劧浣犳劅瑙変笉鍒幫紝鑷沖皯class灝哄涓婁笉涓鏍?/p>
聽(tīng)
]]> Reading note of "Head First Design Patterns": Strategy Pattern http://www.aygfsteel.com/jedikings/archive/2006/06/13/52422.htmlJedi Jedi Tue, 13 Jun 2006 04:42:00 GMT http://www.aygfsteel.com/jedikings/archive/2006/06/13/52422.html http://www.aygfsteel.com/jedikings/comments/52422.html http://www.aygfsteel.com/jedikings/archive/2006/06/13/52422.html#Feedback 0 http://www.aygfsteel.com/jedikings/comments/commentRss/52422.html http://www.aygfsteel.com/jedikings/services/trackbacks/52422.html 聽(tīng)聽(tīng)聽(tīng)Joe's company聽(tīng)makes a duck pond simulation game, SimUDuck, The game can show a large variety of duck species swimming and making quacking sounds. Initial Design: But now some new functionality should be added, for example: we need some of the ducks to FLY. First Design: 聽(tīng)聽(tīng)聽(tīng)We add a method fly() into the Duck class. It seems worked, but something went horribly wrong because not all ducks can fly. so.... Second Design:聽(tīng)Using inheritance and polymorphism 聽(tīng)聽(tīng)聽(tīng)Always override the fly() mehtod in the subclass where needed. 聽(tīng)聽(tīng)聽(tīng)
聽(tīng)聽(tīng)聽(tīng)Drawbacks:聽(tīng)Everytime a new duck is added, you will be forced to look at and possibly override fly() and quack(). so is there a cleaner way of having only some of the duck types fly or quack? Third Design: Using interface! 聽(tīng)聽(tīng)聽(tīng) Drawbacks: It completely destroy code reuse for those behaviors.1. Design Principles: Identify the aspects of your application that vary and separate them form what stays the same! 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) which means Encapsulate the parts that vary!2. Design Principles: Program to an interface, not an implementation! (interface here means supertype! including interface 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)and abstract class!.. making use of the polymorphism functionality).3. Design聽(tīng)Principles: 聽(tīng)聽(tīng)Favor composition over interface! 聽(tīng) Strategy Pattern: Using Composition! Code implement: FlyBehavior.javapublic 聽(tīng) interface 聽(tīng)FlyBehavior { 聽(tīng)聽(tīng)聽(tīng) public 聽(tīng) void 聽(tīng)fly(); } FlyWithWings.javapublic 聽(tīng) class 聽(tīng)FlyWithWings聽(tīng) implements 聽(tīng)FlyBehavior { 聽(tīng)聽(tīng)聽(tīng) public 聽(tīng) void 聽(tīng)fly() { 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)System.out.println( " I'm聽(tīng)flying!! " ); 聽(tīng)聽(tīng)聽(tīng)} } FlyNoWay.javapublic 聽(tīng) class 聽(tīng)FlyNoWay聽(tīng) implements 聽(tīng)FlyBehavior { 聽(tīng)聽(tīng)聽(tīng) public 聽(tīng) void 聽(tīng)fly() { 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)System.out.println( " I聽(tīng)can't聽(tīng)fly " ); 聽(tīng)聽(tīng)聽(tīng)} } Duck.javapublic 聽(tīng) abstract 聽(tīng) class 聽(tīng)Duck { 聽(tīng)聽(tīng)聽(tīng)FlyBehavior聽(tīng)flyBehavior; 聽(tīng)聽(tīng)聽(tīng) public 聽(tīng)Duck() {聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) 聽(tīng)聽(tīng)聽(tīng)} 聽(tīng)聽(tīng)聽(tīng) 聽(tīng)聽(tīng)聽(tīng)public 聽(tīng) abstract 聽(tīng) void 聽(tīng)display(); 聽(tīng)聽(tīng)聽(tīng) 聽(tīng)聽(tīng)聽(tīng) public 聽(tīng) void 聽(tīng)performFly() { 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)flyBehavior.fly(); 聽(tīng)聽(tīng)聽(tīng)} 聽(tīng)聽(tīng)聽(tīng) 聽(tīng)聽(tīng)聽(tīng)public 聽(tīng) void 聽(tīng)swim() { 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)System.out.println( " All聽(tīng)ducks聽(tīng)float,聽(tīng)even聽(tīng)decoys! " ); 聽(tīng)聽(tīng)聽(tīng)} } MallardDuck.javapublic 聽(tīng) class 聽(tīng)MallardDuck { 聽(tīng)聽(tīng)聽(tīng) public 聽(tīng)MallardDuck() { 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)flyBehavior = new 聽(tīng)FlyWithWings();聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) 聽(tīng)聽(tīng)聽(tīng)} 聽(tīng)聽(tīng)聽(tīng) 聽(tīng)聽(tīng)聽(tīng)public 聽(tīng) void 聽(tīng)display() { 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)System.out.println( " I'm聽(tīng)a聽(tīng)real聽(tīng)mallard聽(tīng)duck " ); 聽(tīng)聽(tīng)聽(tīng)} }The Definition聽(tīng)of Strategy Pattern:聽(tīng)The聽(tīng)Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them intercahgeable. Strategy lets the algorithm vary indepanedtl from client聽(tīng)that use it 聽(tīng) Problems: 1. It's weird to have a class that's jast a behavior: classes represent things both have state and methods. a flying behavior might have instance variables representing the attributes for the flying behavior. 2.聽(tīng)Be care聽(tīng)of聽(tīng)Over-Design: implement your code first, then refractoring!
]]>
主站蜘蛛池模板:
庐江县 |
贵定县 |
井陉县 |
镶黄旗 |
广平县 |
隆尧县 |
洛扎县 |
卢湾区 |
驻马店市 |
叶城县 |
永新县 |
松潘县 |
台东市 |
南平市 |
梁平县 |
本溪市 |
杭锦旗 |
淮安市 |
乌拉特前旗 |
平顺县 |
木兰县 |
宁津县 |
吴川市 |
绍兴县 |
沽源县 |
阿坝县 |
长泰县 |
盐池县 |
息烽县 |
温州市 |
湟源县 |
若尔盖县 |
东平县 |
乃东县 |
济阳县 |
宾川县 |
沧州市 |
莱西市 |
平乐县 |
普定县 |
古浪县 |