隨筆 - 41  文章 - 29  trackbacks - 0
          <2008年11月>
          2627282930311
          2345678
          9101112131415
          16171819202122
          23242526272829
          30123456

          常用鏈接

          留言簿(5)

          隨筆分類(lèi)(28)

          隨筆檔案(23)

          收藏夾(6)

          Inside JVM

          Java

          java performance

          Solr

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

               摘要: 本文討論了實(shí)際工作中單元測(cè)試實(shí)踐和測(cè)試驅(qū)動(dòng)開(kāi)發(fā)的感受和困惑,并試圖通過(guò)研究業(yè)界實(shí)踐來(lái)回答如下問(wèn)題:為什么要進(jìn)行單元測(cè)試,對(duì)誰(shuí)進(jìn)行單元測(cè)試,怎么進(jìn)行單元測(cè)試。  閱讀全文
          posted @ 2010-07-13 17:34 Justin Chen 閱讀(2901) | 評(píng)論 (2)編輯 收藏
               摘要: This message is a summary based on a very good article (http://www.ibm.com/developerworks/java/library/j-ts1.html?S_TACT=105AGX02&S_CMP=EDU) and focusing on common mistakes when implementing transactions in the Java platform. The original article is aimed to discuss Transaction Strategy. Here, we just want to discuss the common mistakes on transaction management.   閱讀全文
          posted @ 2009-04-15 15:12 Justin Chen 閱讀(2881) | 評(píng)論 (0)編輯 收藏
               摘要: 從今天開(kāi)始,本人將逐章翻譯《剖析SQL Server執(zhí)行計(jì)劃(Dissecting SQL Server Execution Plans)》一書(shū)。該書(shū)是系列叢書(shū)《高性能SQL代碼的藝術(shù)》的第一本,來(lái)源于http://www.infoq.com/news/2009/03/SQL- Performance。該書(shū)由SQL Server專家Grant Frltchey編寫(xiě),并頗獲好評(píng)。  閱讀全文
          posted @ 2009-04-14 22:43 Justin Chen 閱讀(2299) | 評(píng)論 (0)編輯 收藏
               摘要: An Introduction to memcached - Improve Your Web Site Performance By Cache  閱讀全文
          posted @ 2009-04-12 21:29 Justin Chen 閱讀(2106) | 評(píng)論 (0)編輯 收藏
               摘要: This article is a short summary on the interview with Werner Vogels, who is the CTO of Amazon.com.   閱讀全文
          posted @ 2009-04-11 21:27 Justin Chen 閱讀(858) | 評(píng)論 (0)編輯 收藏
               摘要: This document is a summary or outline of Sun's document: Tuning Garbage collection with the 1.4.2 Hotspot JVM located here: http://java.sun.com/docs/hotspot/gc1.4.2/  閱讀全文
          posted @ 2009-04-01 17:19 Justin Chen 閱讀(1070) | 評(píng)論 (0)編輯 收藏
               摘要: Mock test is a very good way to test unit of codes. However, Mock test need lots effort on creating mock object, creating input and output parameter, and creating AugumentMatcher, and also comparing the expected result and actual results (assertions). Using Unitils can Simplify most of the manual work required by Mock Test.   閱讀全文
          posted @ 2009-03-30 22:30 Justin Chen 閱讀(2019) | 評(píng)論 (1)編輯 收藏
               摘要: Java Memory Management is one of the most important Java Core Techniques. It is worth for every developer to spend some time to learn how it works. It is also a very interesting topic. I try to provide an overview on Java Memory Management, so, some detailed are omitted in the slides, please see detailed by the Reference Links in the last page.   閱讀全文
          posted @ 2009-03-26 09:47 Justin Chen 閱讀(4709) | 評(píng)論 (11)編輯 收藏
               摘要: JDBC has been used as the major Java Database Access technique for long time. However, JDBC access always need try-catch block and repeated JDBC codes, such as connection, statement and resultset. And recently, JDK 6.0 already released a simplified JDBC access approach. This article will introduce a similar and very simple design to reduce most of JDBC codes. You don't have to repeat the traditional JDBC codes template agan and again.
            閱讀全文
          posted @ 2009-03-20 10:07 Justin Chen 閱讀(2017) | 評(píng)論 (2)編輯 收藏
               摘要: This article is trying to summarize what' the JVM GC log and how can we use it to analyse memory issues.   閱讀全文
          posted @ 2009-03-19 22:27 Justin Chen 閱讀(8512) | 評(píng)論 (2)編輯 收藏
               摘要: This article introduces three tools: P6Spy, IronTrackSQL and SQL Profiler (NOT SQL Server Profiler). Using these tools are very easy to log all SQL statements and show the detailed statistics results.  閱讀全文
          posted @ 2009-03-14 21:06 Justin Chen 閱讀(3555) | 評(píng)論 (0)編輯 收藏
               摘要: An introduction on JTracert - Runtime Sequence Diagram Generator Tool   閱讀全文
          posted @ 2009-03-11 22:42 Justin Chen 閱讀(1764) | 評(píng)論 (0)編輯 收藏
               摘要: In summary, we always met the performance result stability issue during performance testing. This article tries to explain why an java application will perform differently at different time, there are too many factors impacting this, and how can we get a more trustable results. This article is a first try to explain this topic, i hope more and more discussion will make us clearer.   閱讀全文
          posted @ 2009-03-09 23:25 Justin Chen 閱讀(1540) | 評(píng)論 (1)編輯 收藏
               摘要: Open Source Reporting Tools in Java  閱讀全文
          posted @ 2009-03-01 22:28 Justin Chen 閱讀(687) | 評(píng)論 (0)編輯 收藏
               摘要: Profiling Java Performance With Perf4j  閱讀全文
          posted @ 2009-02-22 22:00 Justin Chen 閱讀(2069) | 評(píng)論 (0)編輯 收藏
               摘要: This article will have a simple introduction on new tool – Eclipse Memory Analyzer (previously called SAP memory analyzer) and how to use this tool to find some interesting memory issues.  閱讀全文
          posted @ 2009-02-22 21:29 Justin Chen 閱讀(5773) | 評(píng)論 (0)編輯 收藏
               摘要: This message introduced the major JVM-Level problems on Java Development, such as Out of Memeory, Thread Lock etc.  閱讀全文
          posted @ 2009-01-08 22:15 Justin Chen 閱讀(3294) | 評(píng)論 (3)編輯 收藏
               摘要: Recently, there are lots of discussion regarding to QA bottleneck in our release plan, or lack of communication between Dev and QA, i’d like to share my little experiences from my previous experiences. This article describes three major mindset changes and some practical skills to help the team achieve these principles   閱讀全文
          posted @ 2008-12-10 13:39 Justin Chen 閱讀(1426) | 評(píng)論 (1)編輯 收藏
               摘要: An introduction to Java Bean Validation Framework and How to use Spring Bean Validation Framework without Spring MVC.   閱讀全文
          posted @ 2008-12-01 11:48 Justin Chen 閱讀(4804) | 評(píng)論 (1)編輯 收藏
               摘要: This article is to explain how solr cache works  閱讀全文
          posted @ 2008-11-11 15:05 Justin Chen 閱讀(1721) | 評(píng)論 (0)編輯 收藏

          The previous message only explains how to create service, this message will describe how to create client and invoke server side. Actually, JSR-311 only defined the server API, so, each vendor will have different ideas on client. But one common way is to use Apache Http Common Client lib. Please see following examples.

          1. GET a customer

          // Sent HTTP GET request to query customer info

          System.out.println(
          "Sent HTTP GET request to query customer info");

          URL url 
          = new URL("http://localhost:8080/vendor_search/services/customerservice/customers/123");

          InputStream in 
          = url.openStream();

          System.out.println(getStringFromInputStream(in)); 
          //NOTE, return an input stream, you need convert xml to Java Object by yourself
          2. Use PUT to update a customer


          System.out.println("Sent HTTP PUT request to update customer info");

          Client client 
          = new Client();

          String inputFile 
          = client.getClass().getResource("update_customer.txt").getFile();

          File input 
          = new File(inputFile);

          PutMethod put 
          = new PutMethod("http://localhost:8080/vendor_search/services/customerservice/customers");

          RequestEntity entity 
          = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");

          put.setRequestEntity(entity);

          HttpClient httpclient 
          = new HttpClient();



          try {

          int result = httpclient.executeMethod(put);

          System.out.println(
          "Response status code: " + result);

          System.out.println(
          "Response body: ");

          System.out.println(put.getResponseBodyAsString());

          finally {

          // Release current connection to the connection pool once you are

          // done

          put.releaseConnection();

          }
          3. Use POST to add a customer

          System.out.println(
          "Sent HTTP POST request to add customer");

          inputFile 
          = client.getClass().getResource("add_customer.txt").getFile();

          input 
          = new File(inputFile);

          PostMethod post 
          = new PostMethod("http://localhost:8080/vendor_search/services/customerservice/customers");

          post.addRequestHeader(
          "Accept" , "text/xml");

          entity 
          = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");

          post.setRequestEntity(entity);

          httpclient 
          = new HttpClient();



          try {

          int result = httpclient.executeMethod(post);

          System.out.println(
          "Response status code: " + result);

          System.out.println(
          "Response body: ");

          System.out.println(post.getResponseBodyAsString());

          finally {

          // Release current connection to the connection pool once you are

          // done

          post.releaseConnection();

          }

          So, for this way provided by Apach Common Http Client, the user still need think about the convention from XML to POJO. It is not so convenience. We will provide a utility class to simply this process.

          posted @ 2008-11-05 22:48 Justin Chen 閱讀(1848) | 評(píng)論 (0)編輯 收藏
               摘要: The first article of a series of implementing Restful web service with CXF. This one focus on a very simple service and how to config it in Tomcat container.   閱讀全文
          posted @ 2008-11-05 18:24 Justin Chen 閱讀(3511) | 評(píng)論 (1)編輯 收藏
               摘要: This message gives us a brief introduction on Restful web service (All of these information comes from internet and i just re-organized them) and some thoughts on how can we apply this new architecture pattern into our common service services.  閱讀全文
          posted @ 2008-11-05 10:43 Justin Chen 閱讀(2103) | 評(píng)論 (3)編輯 收藏
          主站蜘蛛池模板: 喀喇沁旗| 来凤县| 汝阳县| 辽源市| 万安县| 波密县| 宣化县| 苗栗县| 阳新县| 馆陶县| 得荣县| 军事| 偏关县| 鄄城县| 浦北县| 嘉义县| 襄汾县| 突泉县| 香河县| 五寨县| 海原县| 嘉义县| 南澳县| 噶尔县| 政和县| 沛县| 外汇| 金溪县| 共和县| 淳化县| 乐平市| 孝义市| 泸西县| 淮安市| 隆昌县| 萍乡市| 华容县| 石河子市| 广宁县| 云阳县| 吉隆县|