<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 7, comments - 1, trackbacks - 0, articles - 0

    2006年9月1日

    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>
    ?<xa-datasource>
    ??<jndi-name>MySqlXADS</jndi-name>
    ??<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
    ??<xa-datasource-property name="Url">jdbc:mysql://127.0.0.1:3306/temp</xa-datasource-property>
    ??<xa-datasource-property name="User">root</xa-datasource-property>
    ??<xa-datasource-property name="Password">....</xa-datasource-property>
    ??<user-name>root</user-name>
    ??<password>.....</password>
    ??<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
    ??<metadata>
    ???<type-mapping>mySQL</type-mapping>
    ??</metadata>
    ?</xa-datasource>
    </datasources>

    3. server/default/conf/standardjbosscmp-jdbc.xml
    <defaults>
    ????? <datasource>java:/MySqlXADS</datasource>
    ????? <datasource-mapping>mySQL</datasource-mapping>
    ....
    ....??
    </defaults>

    4. server/default/conf/jboss-service.xml
    <mbean code="org.jboss.tm.XidFactory"
    ????? name="jboss:service=XidFactory">
    ?//uncommented the line below...
    ????? <attribute name="Pad">true</attribute>
    ?? </mbean>

    posted @ 2006-09-01 08:55 Jedi 閱讀(1116) | 評論 (0)編輯 收藏

    2006年8月15日

    1. 某個service的參數有復雜對象時,如果要用默認的beanmapping,記得這個對象要有的默認構造器(空參數構造器),不然Axis在處理的時候會所有的字段都是同一個值..至于原因我沒搞清楚-,-~~
    2. 不要用List,盡量用數組!
    ValueBean[]?getValues()?
    ????
    {?
    ????????ArrayList?result?
    =?new?ArrayList();?
    ????????
    return?(ValueBean[])?result.toArray();?
    ????}
    上面的代碼還是會出問題,要用iterator一個一個map過去
    public?class?ValueHelper?
    ????
    {?
    ????????
    public?static?ValueBean[]?toArray(List?values)?
    ????????
    {
    ????????????ValueBean[]?result?
    =?new?ValueBean[values.size()];?
    ????????????Iterator?i?
    =?values.iterator();?
    ????????????
    int?i?=?0;?
    ????????????
    while?(i.hasNext())?
    ????????????
    {?
    ????????????????ValueBean?value?
    =?(ValueBean)?i.next();?
    ????????????????result[i
    ++]?=?value;?
    ????????????}
    ?
    ????????????
    return?result;?
    ????????}
    ?
    ????}
    ?
    ????ValueBean[]?getValues()?
    {?
    ????????ArrayList?result?
    =?new?ArrayList();??
    ????????
    return?ValueHelper.toArray(result);?
    ????}
    3. 要生成符合ws-i的web service最好用document/literal
    <service name="MyWebRes" provider="java:RPC" style="document "use="literal">

    posted @ 2006-08-15 09:22 Jedi 閱讀(273) | 評論 (0)編輯 收藏

    http://www.fiddlertool.com/fiddler/?
    .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

    posted @ 2006-08-15 09:15 Jedi 閱讀(243) | 評論 (0)編輯 收藏

    2006年7月11日

    var ?proxy = ? null ;
    ? function??getTest()??//?test?by?the?way?amazon?uses
    {
    ????
    if?(!proxy)?{
    ????????
    var?listener?=?{?
    ????????
    //?gets?called?once?the?proxy?has?been?instantiated
    ????????????onLoad:?function?(aProxy)?
    ????????????
    {
    ????????????????proxy?
    =?aProxy;
    ????????????????proxy.setListener(listener);
    ????????????????requestTest();
    ????????????}
    ,
    ????????
    //?gets?called?if?an?error?occurs
    ????????????onError:?function?(aError)?
    ????????????
    {
    ????????????????alert(aError);
    ????????????}
    ,
    ????????
    //?callback?function?is?hardcoded?to?{methodname}Callback?in?1.4beta
    ????????????getInstanceByIDCallback?:?function?(aresult)?
    ????????????
    {
    ????????????????alert(
    "enter?callback");??????????????
    ????????????????
    //alert("a="+aresult.a+",?b="+aresult.b);
    ????????????}

    ????????}
    ;
    ????????createProxy(listener);
    ????}

    ????
    else?{
    ????????requestTest(
    );
    ????}

    }

    function?createProxy(aCreationListener)?
    {
    ????
    try?{
    ????????
    var?factory?=?new?WebServiceProxyFactory();
    ????????factory.createProxyAsync("...wsdl location...."
    ,?"binding name",?"",?true,?aCreationListener);
    ????}

    ????
    catch?(ex)?{
    ????????alert(
    "test?"+?ex);
    ????}

    }


    function??requestTest()?
    {
    ????
    if?(proxy)?{
    ????????netscape.security.PrivilegeManager.enablePrivilege(
    "UniversalBrowserRead");
    ????????
    ????????
    /*
    ????????//?if?complex?object?is?the?parameter
    ????????var?KeywordSearchRequest?=?new?Object();????????
    ????????KeywordSearchRequest.page="1";
    ????????KeywordSearchRequest.mode="books";
    ????????KeywordSearchRequest.tag="webservices-20";
    ????????KeywordSearchRequest.type="lite";
    ????????KeywordSearchRequest.devtag="D2Z2KU2NWTOHI";
    ????????KeywordSearchRequest.format="xml";
    ????????KeywordSearchRequest.version="1.0";
    ????????
    */

    ????????proxy.getInstanceByID(
    "id.....");
    ????????alert(
    "call?complete!");
    ????}

    ????
    else?{
    ????????alert(
    "Error:?Proxy?set?up?not?complete!");
    ????}

    }

    用起來還是很簡單,唯一要注意的是用Axis生成Web Service的時候記得在global configuration里面改一下
    <parameter name="sendMultiRefs" value="false"/>

    ie下的話也有一個webservice.htc,沒仔細研究過..

    posted @ 2006-07-11 12:13 Jedi 閱讀(840) | 評論 (0)編輯 收藏

    2006年7月9日

    public ? class ?Singleton?{

    ????
    private ? volatile ? static ?Singleton?uniqueInstance;
    ????
    private ?Singleton(){
    ????????
    ????}
    ????
    ????
    public ? static ?Singleton?getInstance(){
    ????????
    if (uniqueInstance == null ){
    ????????????
    synchronized (Singleton. class ){
    ????????????????
    if (uniqueInstance == null ){
    ????????????????????uniqueInstance?
    = ? new ?Singleton();
    ????????????????}
    ????????????}
    ????????}????????
    ????????
    return ?uniqueInstance;?
    ????}

    }

    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

    posted @ 2006-07-09 12:42 Jedi 閱讀(299) | 評論 (0)編輯 收藏

    2006年6月24日

    http://www.newsmth.net/bbscon.php?bid=756&id=53934

    以我的機器為例
    我得jdk裝在了
    C:\Program Files\Java\jdk1.5.0_06
    安裝這個jdk的時候,它要求我安裝jre,我也選擇裝了,裝在了
    C:\Program Files\Java\jre1.5.0_06

    然后? C:\Program Files\Java\jdk1.5.0_06\ 目錄下有個jre目錄
    就是存在? C:\Program Files\Java\jdk1.5.0_06\jre? 這么一個jre

    C:\Program Files\Java\jre1.5.0_06? 我們叫它 jre a
    C:\Program Files\Java\jdk1.5.0_06\jre? 我們叫它 jre b

    平常所說的jre是指? 這里的jre a,它是為了讓你的機器可以運行 java程序的
    只能運行,不能開發,因為沒有javac
    這個jre可以單獨安裝,版本一樣的話都一樣(根據licene,好象目前不允許剪裁)

    jre b 是隨jdk的,不能不裝,因為? jdk>jre? jdk也需要jre啊
    就是裝jdk就會出現這個jre b

    一點高級的,jrea 和 jreb有什么不同

    jreb 是為jdk服務的,它有jrea的全部功能,同時為了jdk服務,它的類庫,比方說rt.jar
    ,多一些調試信息,因為開發java程序,會調試啊,用jrea沒辦法調試,比方說不能斷點到
    ?基礎類庫里面
    看jrea和b的rt.jar 大小不一樣,jreb的大一些,帶有調試信息(主要是class里的
    LineNumberTable) ,所以運行時,jreb的速度或者載入速度難免慢一些,或者說,用jdk運
    行java程序比jre運行慢一些,雖然你感覺不到,至少class尺寸上不一樣

    ?

    posted @ 2006-06-24 03:26 Jedi 閱讀(319) | 評論 (1)編輯 收藏

    2006年6月13日

    Problem:???Started with a simple SimUDuck App..
    ???Joe's company?makes a duck pond simulation game, SimUDuck, The game can show a large variety of duck species swimming and making quacking sounds.

    Initial Design:
    diagram.JPG
    But now some new functionality should be added, for example: we need some of the ducks to FLY.

    First Design:
    ???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:?Using inheritance and polymorphism
    ???Always override the fly() mehtod in the subclass where needed.

    test.JPG
    ???

    ???Drawbacks:?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!
    ???test1.JPG
    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!
    ?????????????????????????????? which means Encapsulate the parts that vary!
    2. Design Principles: Program to an interface, not an implementation! (interface here means supertype! including interface
    ???????????????????????????????and abstract class!.. making use of the polymorphism functionality).
    3. Design?Principles:??Favor composition over interface!?

    Strategy Pattern: Using Composition!
    test2.JPG

    Code implement:
    FlyBehavior.java
    public?interface?FlyBehavior{
    ???
    public?void?fly();
    }

    FlyWithWings.java
    public?class?FlyWithWings?implements?FlyBehavior{
    ???
    public?void?fly(){
    ??????System.out.println(
    "I'm?flying!!");
    ???}

    }

    FlyNoWay.java
    public?class?FlyNoWay?implements?FlyBehavior{
    ???
    public?void?fly(){
    ??????System.out.println(
    "I?can't?fly");
    ???}

    }

    Duck.java
    public?abstract?class?Duck{
    ???FlyBehavior?flyBehavior;
    ???
    public?Duck(){??????
    ???}

    ???
    ???
    public?abstract?void?display();
    ???
    ???
    public?void?performFly(){
    ??????flyBehavior.fly();
    ???}

    ???
    ???
    public?void?swim(){
    ??????System.out.println(
    "All?ducks?float,?even?decoys!");
    ???}

    }

    MallardDuck.java
    public?class?MallardDuck{
    ???
    public?MallardDuck(){
    ??????flyBehavior
    =new?FlyWithWings();??????
    ???}

    ???
    ???
    public?void?display(){
    ??????System.out.println(
    "I'm?a?real?mallard?duck");
    ???}

    }

    The Definition?of Strategy Pattern:?The?Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them intercahgeable. Strategy lets the algorithm vary indepanedtl from client?that use it
    ?
    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.?Be care?of?Over-Design: implement your code first, then refractoring!

    posted @ 2006-06-13 12:42 Jedi 閱讀(1314) | 評論 (0)編輯 收藏

    主站蜘蛛池模板: 日本zzzzwww大片免费| 91老湿机福利免费体验| 国产网站免费观看| 中文日韩亚洲欧美制服| www.999精品视频观看免费| 亚洲国产理论片在线播放| 99久久精品日本一区二区免费 | 人妻18毛片a级毛片免费看| 国产伦精品一区二区三区免费迷 | 在线观看无码的免费网站| 亚洲欧洲日韩国产一区二区三区| 在线观看特色大片免费视频 | 日韩免费高清一级毛片在线| 亚洲中文字幕乱码熟女在线| 啦啦啦手机完整免费高清观看| 午夜亚洲WWW湿好爽| 亚洲国产综合人成综合网站| 国产99精品一区二区三区免费| 国产精品亚洲片在线观看不卡| 免费av一区二区三区| 亚洲男女性高爱潮网站| 成人au免费视频影院| 特级毛片aaaa级毛片免费| 亚洲另类激情综合偷自拍图| 久久国产乱子伦精品免费不卡| 亚洲欧洲日韩综合| 毛片a级毛片免费观看品善网| 午夜亚洲乱码伦小说区69堂| 亚洲精品国产精品乱码不卡| 成人网站免费看黄A站视频| 亚洲另类视频在线观看| 日韩伦理片电影在线免费观看| 黄色a三级免费看| 久久精品亚洲日本佐佐木明希| 久草免费在线观看视频| 国产精品亚洲一区二区在线观看| a级亚洲片精品久久久久久久| 亚洲精品视频在线观看免费| 久久亚洲精品无码gv| 久久久久久久久亚洲| 四虎www免费人成|