??xml version="1.0" encoding="utf-8" standalone="yes"?>国产一区 二区,欧美v亚洲v综合v国产v仙踪林,视频国产一区http://www.aygfsteel.com/hyq0077/zh-cnWed, 18 Jun 2025 17:20:54 GMTWed, 18 Jun 2025 17:20:54 GMT60apache、resin泛域名、多域名讄http://www.aygfsteel.com/hyq0077/archive/2007/06/14/124307.htmlhyqhyqThu, 14 Jun 2007 06:06:00 GMThttp://www.aygfsteel.com/hyq0077/archive/2007/06/14/124307.htmlhttp://www.aygfsteel.com/hyq0077/comments/124307.htmlhttp://www.aygfsteel.com/hyq0077/archive/2007/06/14/124307.html#Feedback0http://www.aygfsteel.com/hyq0077/comments/commentRss/124307.htmlhttp://www.aygfsteel.com/hyq0077/services/trackbacks/124307.html版本Qhttpd-2.2.4、resin-3.0.19
泛域名:

Apache:

<VirtualHost *:80>
    DocumentRoot 
/usr/local/pengpeng/xspace/
    ServerName x.
243.com
    ServerAlias  
*.x.243.com
</VirtualHost>


<VirtualHost *:80>
    DocumentRoot 
/usr/local/pengpeng/xhome/
    ServerName home.
243.com
    ServerAlias  
*.home.243.com
</VirtualHost>

Resin:
    <host id="home.243.com" root-directory=".">
       
<host-alias-regexp>^([^/]*).home.243.com</host-alias-regexp>
       
<redeploy-mode>manual</redeploy-mode>
       
<web-app id="/" document-directory="/usr/local/pengpeng/xhome/"/>
    
</host>
    
<host id="x.243.com" root-directory=".">
       
<host-alias-regexp>^([^/]*).x.243.com</host-alias-regexp>
       
<redeploy-mode>manual</redeploy-mode>
       
<web-app id="/" document-directory="/usr/local/pengpeng/xspace/"/>
    
</host>


多域名:
 
apache:
 
<VirtualHost *:80>
    DocumentRoot /usr/local/pengpeng/channel/
    ServerName blog.pengpeng.com
    
    RewriteEngine On

        # 来自"Host:"头的ServerName Q可能大写h
        RewriteMap lowercase int:tolower

        # 查hostname正确与否Q之后才能RewriteRule起作?br>    RewriteCond ${lowercase:%{HTTP_HOST}} ^blog.pengpeng.com(.*)$
    RewriteCond %{REQUEST_URI} !^/(.+\.do)$

    RewriteRule    ^/index.jsp$   /blog/index.jsp     [PT]
    
</VirtualHost *:80>

<VirtualHost *:80>
    DocumentRoot /usr/local/pengpeng/channel/
    ServerName show.pengpeng.com
    
    RewriteEngine On

        # 来自"Host:"头的ServerName Q可能大写h
        RewriteMap lowercase int:tolower

        # 查hostname正确与否Q之后才能RewriteRule起作?br>    RewriteCond ${lowercase:%{HTTP_HOST}} ^show.pengpeng.com(.*)$
    RewriteCond %{REQUEST_URI} !^/(.+\.do)$

    RewriteRule    ^/index.jsp$   /show/index.jsp     [PT]
    
</VirtualHost *:80>

<VirtualHost *:80>
    DocumentRoot /usr/local/pengpeng/channel/
    ServerName photo.pengpeng.com
    
    RewriteEngine On

        # 来自"Host:"头的ServerName Q可能大写h
        RewriteMap lowercase int:tolower

        # 查hostname正确与否Q之后才能RewriteRule起作?br>    RewriteCond ${lowercase:%{HTTP_HOST}} ^photo.pengpeng.com(.*)$
    RewriteCond %{REQUEST_URI} !^/(.+\.do)$

    RewriteRule    ^/index.jsp$   /photo/index.jsp     [PT]
    
</VirtualHost *:80>

Resin:
 
<host id="channel.pengpeng.com" root-directory=".">
      
<host-alias>blog.pengpeng.com</host-alias>
      
<host-alias>show.pengpeng.com</host-alias>
      
<host-alias>photo.pengpeng.com</host-alias>
      
<web-app id="/" document-directory="/usr/local/pengpeng/channel/"/>
    
</host>


参考:http://man.chinaunix.net/newsoft/Apache2.2_chinese_manual/index.html


hyq 2007-06-14 14:06 发表评论
]]>
大型|站部v之徏?/title><link>http://www.aygfsteel.com/hyq0077/archive/2007/06/05/deploy.html</link><dc:creator>hyq</dc:creator><author>hyq</author><pubDate>Tue, 05 Jun 2007 09:32:00 GMT</pubDate><guid>http://www.aygfsteel.com/hyq0077/archive/2007/06/05/deploy.html</guid><wfw:comment>http://www.aygfsteel.com/hyq0077/comments/122187.html</wfw:comment><comments>http://www.aygfsteel.com/hyq0077/archive/2007/06/05/deploy.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/hyq0077/comments/commentRss/122187.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/hyq0077/services/trackbacks/122187.html</trackback:ping><description><![CDATA[1、避免应用服务器的cluster部v<br>2、多应用服务器ƈ行服?br>3、跨应用交互量用JMS<br>4、类schedule部v于同一服务?br>5、设|专门的静态资源服务器Q采用lighttpd作ؓ服务<br>6、用F5作负载均?br>7、采用CDN <img src ="http://www.aygfsteel.com/hyq0077/aggbug/122187.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/hyq0077/" target="_blank">hyq</a> 2007-06-05 17:32 <a href="http://www.aygfsteel.com/hyq0077/archive/2007/06/05/deploy.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JDK6的新Ҏ(转)http://www.aygfsteel.com/hyq0077/articles/121120.htmlhyqhyqThu, 31 May 2007 04:29:00 GMThttp://www.aygfsteel.com/hyq0077/articles/121120.htmlhttp://www.aygfsteel.com/hyq0077/comments/121120.htmlhttp://www.aygfsteel.com/hyq0077/articles/121120.html#Feedback0http://www.aygfsteel.com/hyq0077/comments/commentRss/121120.htmlhttp://www.aygfsteel.com/hyq0077/services/trackbacks/121120.html 
一?/span>Web服务元数?/span>
二?/span>脚本语言支持
三?/span>嵌入式数据库
四?/span>在Java SE6(Mustang)中用Desktop API
五?/span>使用Compiler API
六?/span>轻量UHttp Server
七?/span>用Console开发控制台E序



一?a name=t1>Web服务元数?/a>    top

.Net的Web Services元数?br>早在.Net  Framework 1.0?微Yq元数据功?.net的attributeҎ?来标注要暴露成Web Service的方?下面是用C#演示的利?net的元数据功能暴露Web ServiceҎ的代码片?
public class TestWS{
    [WebMethod]
    public String sayHi(){
          return "Hi!";
    }   
    public int add(int d1,int d2){
          return d1+d2;
    }
}
上面的[WebMethod]是加在方法sayHi上面的元数据,用来告诉Web Services引擎(一般是ASP.NET Runtime), 我这个方法需要暴露ؓ一个Web Service,你需要帮我生成相应的WSDL描述及相x持文?而另一个方法add没有加这个元数据,所以Web Services引擎׃会ؓ该方法生成WSDL及相x持文?/p>

Java的Web Services元数?br>Java 里的Web服务元数据跟微Y的方案基本没有语义上的区?自从JDK5d了元数据功能(Annotation)之后,SUN几乎重构了整个J2EE?p? ׃变化很大,q脆名字也重构为Java EE, Java EE(当前版本?.0)元数据U_很多规范当中,q其中就包括Web Services的相兌? 加入元数据之后的Web Services服务器端~程模型p上面看到的C#片断差不多了, q显然比以前的JAX-RPC~程模型?当然, Axis的编E模型也很简?.q里要谈的Web服务元数?JSR 181)只是Java Web 服务规范中的一?它跟Common Annotations, JAXB2, StAX, SAAJ和JAX-WS{共同构成Java EE 5的Web Services技术堆?

JSR-181的元数据清单
下面介绍JSR-181里面各个元数据的相关参数及用?br>Annotation Retention Target Description
 WebService  Runtime Type
 标注要暴露ؓWeb Services的类或接?
 WebParam  Runtime Parameter 自定义服务方法参数到WSDL的映?
 WebResult  Runtime Method 自定义服务方法返回值到WSDL的映?
 WebMethod  Runtime Method 自定义单个服务方法到WSDL的映?
 Oneway  Runtime Method 必须与@WebMethodq用,表明被标注方法只有输入没有输?q就要求被标注方法不能有q回?也不能声明checked exception
 
 HandlerChain  Runtime Type,Method,Field Web服务与外部Handler chain兌h
 SOAPBinding  Runtime Type,Method 自定义SOAPBinding

JSR-181元数据用示?/p>

package WebServices;

import java.io.File;
import java.io.IOException;
import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.ws.Endpoint;

/**
 * @author chinajash
 */
@WebService(targetNamespace="public class WSProvider {
    @WebResult(name="Greetings")//自定义该Ҏq回值在WSDL中相关的描述   
    @WebMethod
    public String sayHi(@WebParam(name="MyName") String name){
        return "Hi,"+name;
//@WebParam是自定义参数name在WSDL中相关的描述
    }   
    @Oneway //表明该服务方法是单向?既没有返回?也不应该声明查异?br>    @WebMethod(action="printSystemTime",operationName="printSystemTime")//自定义该Ҏ在WSDL中相关的描述
    public void printTime(){
        System.out.println(System.currentTimeMillis());
    }
    public static void main(String[] args) {
        Thread wsPublisher = new Thread(new WSPublisher());
        wsPublisher.start();
    }   
    private static class WSPublisher implements Runnable{
        public void run() {
            //发布WSProvider?a href="http://localhost:8888/chinajash/WSProvider">http://localhost:8888/chinajash/WSProviderq个地址,之前必须调用wsgen命o
            //生成服务cWSProvider的支持类,命o如下:
            //wsgen -cp . WebServices.WSProvider
            Endpoint.publish("http://localhost:8888/chinajash/WSProvider",new WSProvider());
        }       
    }
}

如果想看到Web Services Engine生成的WSDL文g是否遵守上面的元数据, 我们没有必要上面的WSProvider部v到支持JSR-181的应用服务器或Servlet形式的Web Services Engine,现在JDK6已经提供了一个很单的机制可以用来试和发布Web Services,下面讲讲如何在JDK6环境下发布Web Services和查看生成的WSDL
1.?lt;JDK_HOME>/bin加入path环境变量
2.在命令行下切换当前目录到WSProvider的class文g所在的目录,q行下面命o
wsgen -cp . WebServices.WSProvider
在这个例子中会生成以?个类的源代码文g及class文g
SayHi
SayHiResponse
PrintTime
3.执行如下代码发布WSProvider?a href="http://localhost:8888/chinajash/WSProvider">http://localhost:8888/chinajash/WSProvider,在这里可以执行WSProvidercȝmainҎ可?br>Endpoint.publish("http://localhost:8888/chinajash/WSProvider",new WSProvider());
4.在浏览器输入http://localhost:8888/chinajash/WSProvider?wsdl可以看到生成的WSDL文gQؓ了节省篇q?q里׃把生成的WSDL文g贴上了,大家可以自己动手试试.


--------------------------------------------------------------------------------------------------------

二?a name=t2>脚本语言支持    top

JDK6增加了对脚本语言的支?JSR 223)Q原理上是将脚本语言~译成bytecodeQ这栯本语a也能享用Javaq_的诸多优势,包括可移植性,安全{,另外Q由于现在是~译成bytecode后再执行Q所以比原来边解释边执行效率要高很多。加入对脚本语言的支持后Q对Java语言也提供了以下好处?br>1、许多脚本语a都有动态特性,比如Q你不需要用一个变量之前先声明它,你可以用一个变量存攑֮全不同类型的对象Q你不需要做强制cd转换Q因{换都是自动的。现在Java语言也可以通过对脚本语a的支持间接获得这U灵zL?br>2?可以用脚本语a快速开发品原型,因ؓ现在可以Edit-RunQ而无需Edit-Compile-RunQ当Ӟ因ؓJava有非常好的IDE支持Q我 们完全可以在IDE里面~辑源文Ӟ然后点击q行(隐含~译)Q以此达到快速开发原型的目的Q所以这点好处基本上可以忽略?br>3、通过引入脚本语言可以L实现Java应用E序的扩展和自定义,我们可以把原来分布在在Java应用E序中的配置逻辑Q数学表辑ּ和业务规则提取出来,转用JavaScript来处理?/p>

Sun的JDK6实现包含了一个基于Mozilla Rhino?脚本语言引擎Q支持JavaScriptQ这q不是说明JDK6只支持JavaScriptQQ何第三方都可以自己实C个JSR-223兼容的脚本引?使得JDK6支持别的脚本语言Q比如,你想让JDK6支持RubyQ那你可以自己按照JSR 223的规范实C个Ruby的脚本引擎类Q具体一点,你需要实现javax.script.ScriptEngine(单v见,可以l承javax.script.AbstractScriptEngine)和javax.script.ScriptEngineFactory两个接口。当Ӟ在你实现自己的脚本语a引擎之前Q先到scripting.dev.java.net project q里看看是不是有人已l帮你做了工作,q样你就可以直接拿来用就行?/p>

Scripting API

Scripting API是用于在Java里面~写脚本语言E序的APIQ?在Javax.script中可以找到Scripting APIQ我们就是用q个API来编写JavaScriptE序Q这个包里面有一个ScriptEngineManagerc,它是使用Scripting API的入口,ScriptEngineManager可以通过jar服务发现(service discovery)机制L合适的脚本引擎c?ScriptEngine)Q用Scripting API的最单方式只需下面三步
1、创Z个ScriptEngineManager对象
2、通过ScriptEngineManager获得ScriptEngine对象
3、用ScriptEngine的evalҎ执行脚本

下面是一个Hello WorldE序

/** * @author chinajash */public class HelloScript {public static void main(String[] args) throws Exception {        ScriptEngineManager factory = new ScriptEngineManager();//step 1        ScriptEngine engine = factory.getEngineByName("JavaScript");//Step 2            engine.eval("print('Hello, Scripting')");//Step 3    }    }q行上面E序Q控制台会输出Hello, Scripting上面q个单的ScriptingE序演示了如何在Java里面q行脚本语言Q除此之外,我们q可以利用Scripting API实现以下功能1、暴露Java对象本语a的全局变量2、在Java中调用脚本语a的方?、脚本语a可以实现Java的接?、脚本语a可以像Java一样用JDKq_下的cM面的cLCZ以上4U功能package Scripting;import java.io.File;import javax.script.Invocable;import javax.script.ScriptEngine;import javax.script.ScriptEngineManager;import javax.script.ScriptException;/** * @author chinajash */public class ScriptingAPITester {    public static void main(String[] args) throws Exception {        ScriptEngineManager manager = new ScriptEngineManager();        ScriptEngine engine = manager.getEngineByName("JavaScript");        testScriptVariables(engine);//演示如何暴露Java对象本语a的全局变量         testInvokeScriptMethod(engine);//演示如何在Java中调用脚本语a的方?nbsp;        testScriptInterface(engine);//演示脚本语言如何实现Java的接?nbsp;        testUsingJDKClasses(engine);//演示脚本语言如何使用JDKq_下的c?nbsp;   }        public static void testScriptVariables(ScriptEngine engine) throws ScriptException{        File file = new File("test.txt");        engine.put("f", file);        engine.eval("println('Total Space:'+f.getTotalSpace())");            }        public static void testInvokeScriptMethod(ScriptEngine engine) throws Exception{        String script = "function hello(name) { return 'Hello,' + name;}";        engine.eval(script);        Invocable inv = (Invocable) engine;        String res = (String)inv.invokeFunction("hello", "Scripting" );        System.out.println("res:"+res);    }        public static void testScriptInterface(ScriptEngine engine) throws ScriptException{        String script = "var obj = new Object(); obj.run = function() { println('run method called'); }";        engine.eval(script);        Object obj = engine.get("obj");        Invocable inv = (Invocable) engine;        Runnable r = inv.getInterface(obj,Runnable.class);        Thread th = new Thread(r);        th.start();    }        public static void testUsingJDKClasses(ScriptEngine engine) throws Exception{        //Packages是脚本语a里的一个全局变量,专用于访问JDK的package        String js = "function doSwing(t){var f=new Packages.javax.swing.JFrame(t);f.setSize(400,300);f.setVisible(true);}";        engine.eval(js);        Invocable inv = (Invocable) engine;        inv.invokeFunction("doSwing", "Scripting Swing" );    }}Scripting Tool


SUN提供的JDK6中有一个命令行工具??jrunscriptQ你可以?lt;JDK6_Home>/bin下面扑ֈq个工具Qjrunscript是一个脚本语a的解释程序,它独立于脚本语言Q但默认是用JavaScriptQ我们可以用jrunscript来测试自己写的脚本语a是否正确Q下面是一个在命o行运行jrunscript的简单例?br>jrunscript
js>println("Hello,JrunScript");
Hello,JrunScript
js>9*8
72.0
js>

--------------------------------------------------------------------------------------------------------

三?a name=t3>嵌入式数据库Derby    top


Derbyq不是一个新的数据库产品,它是由IBM捐献lApache的DB目的一个纯Java数据?JDK6.0里面带的q个Derby的版本是10.2.1.7,支持存储q程和触发器;有两U运行模?一U是作ؓ嵌入式数据库,另一U是作ؓ|络数据?前者的数据库服务器和客L都在同一个JVM里面q行,后者允许数据库服务器端和客L不在同一个JVM里面,而且允许q两者在不同的物理机器上.值得注意的是JDK6里面的这个Derby支持JDK6的新ҎJDBC 4.0规范(JSR 221),现在我们如果要练习JDBC的用?没有必要单独装一个数据库产品?直接用Derbyp.安装完JDK6.0?Derby会被安装?lt;JDK6_HOME>/db下面,?lt;JDK6_HOME>/db/demo/programs下面q有一些示例程?演示了如何启?q接Derby数据库以及JDBC API的?下面分两U情冉|CZ下如何用代码操作Derby数据?一U是嵌入式数据库,一U是|络数据?

一.嵌入式数据库

 /**
 * @author chinajash
 */
public class EmbeddedDerbyTester {
    public static void main(String[] args) {
        String driver = "org.apache.derby.jdbc.EmbeddedDriver";//在derby.jar里面
        String dbName="EmbeddedDB";
        String dbURL = "jdbc:derby:"+dbName+";create=true";//create=true表示当数据库不存在时创建它
        try {           
            Class.forName(driver);
            Connection conn = DriverManager.getConnection(dbURL);//启动嵌入式数据库
            Statement st = conn.createStatement();
            st.execute("create table foo (FOOID INT NOT NULL,FOONAME VARCHAR(30) NOT NULL)");//创徏foo?br>            st.executeUpdate("insert into foo(FOOID,FOONAME) values (1,'chinajash')");//插入一条数?br>            ResultSet rs = st.executeQuery("select * from foo");//d刚插入的数据
            while(rs.next()){
                int id = rs.getInt(1);
                String name = rs.getString(2);
                System.out.println("id="+id+";name="+name);
            }
        } catch(Exception e){
            e.printStackTrace();
        }
    }
}

q行上面E序?会在当前目录生成名ؓEmbeddedDB的文件夹,既是EmbeddedDB数据库的数据文g存放的地?控制台将输出

id=1;name=chinajash

?|络数据?/p>

/**
 * @author chinajash
 */
public class NetworkServerDerbyTester {
    public static void main(String[] args) {
        String driver = "org.apache.derby.jdbc.ClientDriver";//在derbyclient.jar里面
        String dbName="NetworkDB";
        String connectionURL = "jdbc:derby://localhost:1527/" + dbName + ";create=true";
        try {
            /*
             创徏Derby|络服务?默认端口?527,也可以通过q行
             <Derby_Home>\frameworks\NetworkServer\bin\startNetworkServer.bat
             来创建ƈ启动Derby|络服务?如果是Unix,用startNetworkServer.ksh
            */
            NetworkServerControl derbyServer = new NetworkServerControl();//NetworkServerControlcdderbynet.jar里面
            PrintWriter pw = new PrintWriter(System.out);//用系l输Z为Derby数据库的输出
            derbyServer.start(pw);//启动Derby服务?br>            Class.forName(driver);
            DriverManager.getConnection(connectionURL);
            //do something
            derbyServer.shutdown();//关闭Derby服务?br>        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}

 q行上面E序?会在当前目录生成名ؓNetworkDB的文件夹

关于Derby的详l情?请参?a >http://db.apache.org/derby


----------------------------------------------------------------------------------------------------

四?a name=t4>在Java SE6(Mustang)中用Desktop API    top

伴随着默认的图形用L?GUI)的外观,打印和性能QJavaq_在羃^台差异和整合本地E序与JavaE序的道路上已经C很长一D\?

Javaq_标准?Java SE)W?版,代号为Mustang(野马)Ql用新增的系l托盘功能,对JTable更好的打印支持和现在的Desktop API

(java.awt.Desktop)来填补这个空隙。本文描qC新的Desktop APIQ它们允许JavaE序来和Lq_与特定文件类型相兌的默认应用程序进

行交互。ؓ了更有效地描q这些APIQ本文也展示了一个简单的应用E序DesktopDemo?br>Desktop 概述
q个新功能是由java.awt.DesktopcL供的。这个API取自桌面l合lg(JDIC)目。这个项目的目标?#8220;使以Java技术ؓ基础的应用程序成?/p>

桌面的一U公?#8221;Q实现无~整合。特别的Q新的Desktop API允许Java应用E序实现以下功能Q?br>1.通过一个指定的l一资源定位W?URI)启动Lpȝ的默认浏览器
2.启动Lpȝ的默认邮件客L
3.启动应用E序来打开Q编辑或打印和这些应用程序相兌的文?/p>

Desktop API使用L操作pȝ的文件关联来启动和特定文件类型相兌的应用程序。例如,如果OpenDocument text(.odt)文g扩展名与

OpenOffice Writer应用E序相关联,你的Java应用E序p够根据这个关联启动OpenOffice Writer来打开Q编辑或者甚臌?odt文g。依

靠你的主机系l,不同的应用程序可能会和不同的动作相关联?/p>

q行DesktopDemo应用E序
DesktopDemo是用Mustang的Desktop API的一个简单应用程序。这个程序有一个展CZ完整API的主H口Q允怽做三件事Q?br>1.通过一个指定的URI启动默认的浏览器
2.通过一个邮件接收者启动默认的邮g客户?br>3.启动相关联的应用E序来打开Q编辑或打印一个文?/p>

?昄了用L?UI)

你可以通过下蝲源程序和JAR文g来运行这个应用程序,把控制台转到工程的dist目录Q在Mustang JDK环境下用以下的命令来q行Q?br>   java -jar DesktopDemo.jar

判定对Desktop API的支?br>在启动浏览器Q邮件客L或者Q何应用程序之前,DesktopDemo必须判定你的q_是否支持Desktop API。首先,DesktopDemo会禁用所有的?/p>

本域和按钮。它会在判定你的q_支持它们以后再激zd们?br>在展CZ用户界面以后Q应用程序的构造函数很快地用如下所C的代码用了这个应用程序的lg?br>    public DesktopDemo() {
        // Initiate all GUI components.
        initComponents();
        // Disable buttons that launch browser and email client.
        // Disable buttons that open, edit, and print files.
        disableActions();
        ...
    }

    /**
     * Disable all graphical components until we know
     * whether their functionality is supported.
     */
    private void disableActions() {
        txtBrowserURI.setEnabled(false);
        btnLaunchBrowser.setEnabled(false);
       
        txtMailTo.setEnabled(false);
        btnLaunchEmail.setEnabled(false);
       
        rbEdit.setEnabled(false);
        rbOpen.setEnabled(false);
        rbPrint.setEnabled(false);

        txtFile.setEnabled(false);
        btnLaunchApplication.setEnabled(false);       
    }
   
    ...

    public javax.swing.JTextField txtBrowserURI;
    public javax.swing.JButton btnLaunchBrowser;
    public javax.swing.JTextField txtMailTo;
    public javax.swing.JButton btnLaunchEmail;
    public javax.swing.JRadioButton rbEdit;
    public javax.swing.JRadioButton rbOpen;
    public javax.swing.JRadioButton rbPrint;
    public javax.swing.JTextField txtFile;
    public javax.swing.JButton btnLaunchApplication;

用Desktop.isDesktopSupported()Ҏ判定Desktop API是否可用。在Solaris操作pȝ和Linuxq_上,q个API依赖于Gnome库。如果这些库?/p>

可用Q这个方法会q回false。在判定了系l支持Desktop APIQ也是isDesktopSupported()Ҏq回trueӞ应用E序׃使用一个静?/p>

(static)ҎgetDesktop()重新获得一个Desktop实例?br>    Desktop desktop = null;
    // Before more Desktop API is used, first check
    // whether the API is supported by this particular
    // virtual machine (VM) on this particular host.
    if (Desktop.isDesktopSupported()) {
        desktop = Desktop.getDesktop();
        ...

如果你的应用E序没有在调用getDesktop()Ҏ之前用isDesktopSupported()Ҏ查系l对API的支持,那就必须准备捕捉

UnsupportedOperationException异常Q该异常会在你的应用E序h一个Desktop实例而^C支持的时候抛出。另外,如果你的应用E序?/p>

一个没有键盘,鼠标或者监听器的环?一?#8220;无领D?#8221;的环?中运行,getdesktop()Ҏ会抛Z个java.awt.HeadlessException异常?/p>

一旦重新获得,Desktop实例允许你的应用E序览Q发邮gQ打开、编辑甚x印文件或者URIQ只要重新获得的Desktop实例支持q些动作?/p>

每个q种动作被称Z个actionQ而每一个Desktop.Action枚D实例代表一个actionQ?br>BROWSEQ代表一个通过L览器执行的览动作
MAILQ代表一个通过默认邮g客户端执行的发邮件动?br>OPENQ代表一个通过相关联的应用E序打开一U特定文件类型的打开动作
EDITQ代表一个通过相关联的应用E序~辑一U特定文件类型的~辑动作
PRINTQ代表一个通过相关联的应用E序打印一U特定文件类型的打印动作

在调用这些动作之前,应用E序应该判定Desktop实例是否支持它们。这和判定Desktop实例是否可用是不同的。Desktop.isDesktopSupported

()Ҏ告诉我们能否创徏一个实例。一旦获得了一个Desktop对象Q你可以查询q个实例来找出支持哪些特定的动作。如果Desktop对象不支?/p>

特定的动作,或者Desktop API本n不被支持QDesktopDemo会简单地用受媄响的那些囑Şlg。如?所展示的,在禁用状态下q些lg不能

被用来调用Desktop功能?/p>


使用一个新的Desktop实例Q下面的代码查了每个Desktop.Action的支持情况ƈ且激zM适当的图形组Ӟ
    public DesktopDemo() {
        ...
        // Before more Desktop API is used, first check
        // whether the API is supported by this particular
        // VM on this particular host.
        if (Desktop.isDesktopSupported()) {
            desktop = Desktop.getDesktop();
            // Now enable buttons for actions that are supported.
            enableSupportedActions();
        }       
        ...
    }

    /**
     * Enable actions that are supported on this host.
     * The actions are the following: open browser,
     * open email client, and open, edit, and print
     * files using their associated application.
     */
    private void enableSupportedActions() {
        if (desktop.isSupported(Desktop.Action.BROWSE)) {
            txtBrowserURI.setEnabled(true);
            btnLaunchBrowser.setEnabled(true);
        }
       
        if (desktop.isSupported(Desktop.Action.MAIL)) {
            txtMailTo.setEnabled(true);
            btnLaunchEmail.setEnabled(true);
        }

        if (desktop.isSupported(Desktop.Action.OPEN)) {
            rbOpen.setEnabled(true);
        }
        if (desktop.isSupported(Desktop.Action.EDIT)) {
            rbEdit.setEnabled(true);
        }
        if (desktop.isSupported(Desktop.Action.PRINT)) {
            rbPrint.setEnabled(true);
        }
       
        if (rbEdit.isEnabled() || rbOpen.isEnabled() || rbPrint.isEnabled()) {
            txtFile.setEnabled(true);
            btnLaunchApplication.setEnabled(true);
        }
    }

一旦应用程序判定了可支持的动作Q它会激z适当的图形组件。如果所有组仉被激z,用户界面应该如图3所C:


打开览?br>调用下面的实例方法会打开L的默认浏览器Q?br>    public void browse(URI uri) throws IOException
因ؓDesktopDemo的用L面组件只有在Desktop.Action被支持的情况下才会被Ȁz,所以这个简单的CZE序不需要在调用browse()Ҏ之前

再次查支持情c然而,在实际应用程序中Q在每个调用之前查支持情况可能会使程序更加健壮:
    if (desktop.isSupported(Desktop.Action.BROWSE)) {
        // launch browser
        ...
    }

DesktopDemo为每个按钮添加了java.awt.event.ActionListener。当被激zLQLaunch Browser按钮会通过它的ActionListener调用如下Ҏ

Q?br>    private void onLaunchBrowser(java.awt.event.ActionEvent evt) {
        URI uri = null;
        try {
            uri = new URI(txtBrowserURI.getText());
            desktop.browse(uri);
        }
        catch(IOException ioe) {
            ioe.printStackTrace();
        }
        catch(URISyntaxException use) {
            use.printStackTrace();

        }
        ...
    }

browse()Ҏ会抛出多U异常,包括当URI为空时抛出的NullPointerExceptionQ当BROWSE动作不被支持时抛出的

UnsupportedOperationExceptionQ当默认览器或者应用程序无法找到或者启动时抛出的IOExceptionQ以及当安全理器拒l调用时抛出?/p>

SecurityException?/p>

如果q展利Q监听器会从?中所C的相关联的文本域中重新获得文本Q创Z个URIQ然后调用browse()Ҏ。上面的代码启动了你pȝ?/p>

默认的浏览器来加载URIQ如?所C?/p>


发送邮?br>如果动作被支持的话,应用E序能够启动L的默认邮件客LQ通过调用Desktop的实例方法:
    public void mail(URI uri) throws IOException

DesktopDemo有一个Launch Mail按钮的ActionListener。在q种情况下,监听器调用如下方法:
    private void onLaunchMail(java.awt.event.ActionEvent evt) {
        String mailTo = txtMailTo.getText();
        URI uriMailTo = null;
        try {
            if (mailTo.length() > 0) {
                uriMailTo = new URI("mailto", mailTo, null);
                desktop.mail(uriMailTo);
            } else {
                desktop.mail();
            }
        }
        catch(IOException ioe) {
            ioe.printStackTrace();
        }
        catch(URISyntaxException use) {
            use.printStackTrace();
        }
        ...
    }

onLaunchMail()Ҏ重新获得和文本域相关的邮件接收者,如果接收者存在就使用mailto模式参数创徏URIQ然后调用mail()Ҏ。mail()Ҏ

已经被重载,因此你可以通过使用或者不使用代表mailto接收者的URI来调用它(见图6)?/p>

你可以不仅仅使用一个简单邮件接收者来创徏URI。mailto模式也支持CCQBCCQSUBJECT和BODY字段。例如,下面的文本可以被用来创徏一?/p>

mailto URI?br>    mailto:duke@sun.com?SUBJECT=Happy New Year!&BODY=Happy New Year, Duke!
?昄了结果:


当然Q你也可以不使用参数调用mail()Ҏ。在q种情况下,你的邮g客户端将会启动一个新的没有指定接收者、主题或者主体的邮gH口?/p>

打开Q编辑和打印一个文?br>Java应用E序可以分别使用Desktop对象的open()、edit()、print()Ҏ通过和文件相兌的应用程序打开、编辑和打印文g?见图8)而且Q?/p>

DesktopDemo只有在Desktop实例支持的情况下允许q些动作Q因此在q个应用E序的设定中Q没有必要再查这些支持情c?/p>


每个DesktopDemo的单选按钮也都有它们自己的ActionListener。在q种情况下,每个监听器设|一个实例变量的值来代表最q选择的按钮相?/p>

联的Desktop.ActionQ?br>    Desktop.Action action;

    private void onPrintAction(java.awt.event.ActionEvent evt) {
        action = Desktop.Action.PRINT;
    }                             

    private void onEditAction(java.awt.event.ActionEvent evt) {
        action = Desktop.Action.EDIT;
    }                            

    private void onOpenAction(java.awt.event.ActionEvent evt) {
        action = Desktop.Action.OPEN;
    }

当你按下Launch Default Application按钮Ӟ它触发它自己的监听器Q调用如下方法:
    private void onLaunchDefaultApplication(java.awt.event.ActionEvent evt) {
        String fileName = txtFile.getText();
        File file = new File(fileName);

        try {
            switch(action) {
                case OPEN:
                    desktop.open(file);
                    break;
                case EDIT:
                    desktop.edit(file);
                    break;
                case PRINT:
                    desktop.print(file);
                    break;
            }
        }
        catch (IOException ioe) {
            ioe.printStackTrace();
        }
        ...
    }

q个Ҏ判定哪个Desktop.Action被选择q且调用适当的Desktop的实例方法,open()Qedit()或者print()。每个方法要求一个File参数用来

执行被请求的动作?/p>

有趣的是Q在相同的文件类型上的不同动作可能会被注册ؓ不同的应用程序。例如,Firefox览器可能会执行OPEN操作QEmacs执行EDIT操作

Q另一U不同的应用E序执行PRINT操作。你的主机桌面的兌用来军_应该调用哪个应用E序。这U操作桌面文件关联的能力对目前存在的

Mustang中的Desktop API来说q不可能Q这栯些关联就只能通过与^台相关的工具来创建或改变了?/p>

摘要
桌面整合是一个重要的Mustang主题。Mustang支持q个主题的一U方法是通过java.awt.Desktop API。这个API允许Java应用E序启动L的默

认的览器和邮g客户端。另外,Java应用E序能够启动和文件相关的应用E序来打开、编辑和打印文g。尽Java应用E序不能操作、创?/p>

或者改变文件关联,Desktop API允许Java应用E序启动默认的相兌的应用程序。这文章提供了一个示范这些API的示例程序,你可以从?/p>

点上下蝲q个E序?/p>

注意QQ何Java SEq_规范的增加或改进由JSR 270专家l回֒正式批准?/p>

原文地址Q?a >http://java.sun.com/developer/technicalArticles/J2SE/Desktop/mustang/desktop_api/

-----------------------------------------------------------------------------------------

五?a name=t5>使用Compiler API    top

现在我们可以用JDK6 的Compiler API(JSR 199)d态编译Java源文ӞCompiler APIl合反射功能可以实现动态的产生Java代码q编译执行这些代码,有点动态语a的特征。这个特性对于某些需要用到动态编译的应用E序相当有用Q?比如JSP Web ServerQ当我们手动修改JSP后,是不希望需要重启Web Server才可以看到效果的Q这时候我们就可以用Compiler API来实现动态编译JSP文gQ当Ӟ现在的JSP Web Server也是支持JSP热部|的Q现在的JSP Web Server通过在运行期间通过Runtime.exec或ProcessBuilder来调用javac来编译代码,q种方式需要我们生另一个进E去做编译工作,不够优雅而且Ҏ使代码依赖与特定的操作系l;Compiler API通过一套易用的标准的API提供了更加丰富的方式d动态编?而且是跨q_的?下面代码演示了Compiler API的?/p>

public class CompilerAPITester {
    private static String JAVA_SOURCE_FILE = "DynamicObject.java";
    private static String JAVA_CLASS_FILE = "DynamicObject.class";
    private static String JAVA_CLASS_NAME = "DynamicObject";
    public static void main(String[] args) {
        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
        StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);
        generateJavaClass();
        try {
            //生的cL件拷贝到E序的ClassPath下面,下面q一行代码是特定于WindowsQIntelliJ IDEA 6.0目,不具有移植?br>            Runtime.getRuntime().exec("cmd /c copy "+JAVA_CLASS_FILE+" classes\\production\\JDK6Features");
            Iterable<? extends JavaFileObject> sourcefiles = fileManager.getJavaFileObjects(JAVA_SOURCE_FILE);
            compiler.getTask(null, fileManager, null, null, null, sourcefiles).call();
            fileManager.close();
            Class.forName(JAVA_CLASS_NAME).newInstance();//创徏动态编译得到的DynamicObjectcȝ实例
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    public static void generateJavaClass(){
        try {
            FileWriter fw = new FileWriter(JAVA_SOURCE_FILE);
            BufferedWriter bw = new BufferedWriter(fw);
            bw.write("public class "+JAVA_CLASS_NAME+"{");
            bw.newLine();
            bw.write("public "+JAVA_CLASS_NAME+"(){System.out.println(\"In the constructor of DynamicObject\");}}");
            bw.flush();
            bw.close();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }
}

E序q行后,会生DynamicObject.java和DynamicObject.class两个文gQƈ在控制台输出

In the constructor of DynamicObject

--------------------------------------------------------------------------------

六?a name=t6>轻量UHttp Server     top

JDK6提供了一个简单的Http Server API,据此我们可以构徏自己的嵌入式Http Server,它支持Http和Https协议,提供了HTTP1.1的部分实玎ͼ没有被实现的那部分可以通过扩展已有的Http Server API来实?E序员必自己实现HttpHandler接口,HttpServer会调用HttpHandler实现cȝ回调Ҏ来处理客Lh,在这?我们把一个Httph和它的响应称Z个交?包装成HttpExchangec?HttpServer负责HttpExchange传给HttpHandler实现cȝ回调Ҏ.下面代码演示了怎样创徏自己的Http Server

/**
 * Created by IntelliJ IDEA.
 * User: Chinajash
 * Date: Dec 30, 2006
 */
public class HTTPServerAPITester {
    public static void main(String[] args) {
        try {
            HttpServer hs = HttpServer.create(new InetSocketAddress(8888),0);//讄HttpServer的端口ؓ8888
            hs.createContext("/chinajash", new MyHandler());//用MyHandlercd处理?chinajash的请?br>            hs.setExecutor(null); // creates a default executor
            hs.start();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

class MyHandler implements HttpHandler {
   public void handle(HttpExchange t) throws IOException {
       InputStream is = t.getRequestBody();
       String response = "<h3>Happy New Year 2007!--Chinajash</h3>";
       t.sendResponseHeaders(200, response.length());
       OutputStream os = t.getResponseBody();
       os.write(response.getBytes());
       os.close();
   }
}

q行E序?在浏览器内输?a href="http://localhost:8888/chinajash">http://localhost:8888/chinajash,览器输?/p>

Happy New Year 2007!--Chinajash

-------------------------------------------------------------------------------------------

七?a name=t7>用Console开发控制台E序    top

JDK6中提供了java.io.ConsolecM用来讉KZ字符的控制台讑֤. 你的E序如果要与Windows下的cmd或者Linux下的Terminal交互,可以用ConsolecM? 但我们不L能得到可用的Console, 一个JVM是否有可用的Console依赖于底层^台和JVM如何被调? 如果JVM是在交互式命令行(比如Windows的cmd)中启动的,q且输入输出没有重定向到另外的地?那么可以得C个可用的Console实例. 下面代码演示了Consolecȝ用法:

/**
 * @author chinajash
 */
public class ConsoleTest {
   
    public static void main(String[] args) {
        Console console = System.console();//获得Console实例
        if(console!=null){//判断console是否可用
            String user = new String(console.readLine("Enter user:")); //d整行字符
            String pwd = new String(console.readPassword("Enter passowrd:")); //d密码,密码输入时不会显C?br>            console.printf("User is:"+user+"\n");
            console.printf("Password is:"+pwd+"\n");
        }else{
            System.out.println("Console is unavailable");
        }
    }
}

如果在NetBean5.5里面q行上面E序,会输?/p>

Console is unavailable

表示Console不可获得,那是因ؓJVM不是在命令行中被调用的或者输入输重定向了. 但是如果我们在命令行中运行上面程?java ConsoleTest),E序能够获得Console实例,q执行如?

Enter user:chinajash
Enter passowrd:
User is:chinajash
Password is:chinajash

在这里可以看到输入密码时,控制台时不显C些密码字W的,但是E序可以得到输入的密码字W串,q与Linux下面输入密码的情冉|一L


 



hyq 2007-05-31 12:29 发表评论
]]>
What's New in Java SE 6Q{Q?/title><link>http://www.aygfsteel.com/hyq0077/articles/jdk6.html</link><dc:creator>hyq</dc:creator><author>hyq</author><pubDate>Thu, 31 May 2007 03:47:00 GMT</pubDate><guid>http://www.aygfsteel.com/hyq0077/articles/jdk6.html</guid><wfw:comment>http://www.aygfsteel.com/hyq0077/comments/121113.html</wfw:comment><comments>http://www.aygfsteel.com/hyq0077/articles/jdk6.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/hyq0077/comments/commentRss/121113.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/hyq0077/services/trackbacks/121113.html</trackback:ping><description><![CDATA[<a >http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/beta2.html</a><br> <ol><strong> <li>Web Services</strong><br>All developers get first-class support for writing XML web service client applications. No messing with the plumbing: You can expose your APIs as .NET interoperable web services with a <a ><u><font color=#0000ff>simple annotation</font></u></a>. Not your style? Want to handle the XML directly? Knock yourself out: Java SE 6 adds new parsing and XML to Java object-mapping APIs, previously only available in <a ><u><font color=#0000ff>Java EE</font></u></a> platform implementations or the <a ><u><font color=#0000ff>Java Web Services Pack</font></u></a>.<br><br><strong> <li>Scripting</strong><br>You can now mix in <a ><u><font color=#0000ff>JavaScript</font></u></a> technology source code, useful for prototyping. Also useful when you have teams with a variety of skill sets. More advanced developers can plug in their own scripting engines and mix their favorite scripting language in with Java code as they see fit.<br> <p><big>P</big>erhaps <big>Y</big>ou <big>T</big>houg<big>h</big>t y<big>o</big>u could<big>n</big>'t program with a scripting language and Java togethe<big>r</big>. Which will yo<big>u</big> <big>b</big>e tr<big>y</big>ing ? </p> <li><strong>Database</strong><br>For a great out-of-the-box development experience with database applications, the Java SE 6 development kit – though not the Java Runtime Environment (JRE) – co-bundles the all-Java JDBC database, <a ><u><font color=#0000ff>Java DB</font></u></a> based on <a target=_blank><u><font color=#0000ff>Apache Derby</font></u></a>. No more need to find and configure your own JDBC database when developing a database application! Developers will also get the updated JDBC 4.0, a well-used API with many <a target=_blank><u><font color=#0000ff>important improvements</font></u></a>, such as special support for XML as an SQL datatype and better integration of Binary Large OBjects (BLOBs) and Character Large OBjects (CLOBs) into the APIs. <br><br><strong> <li>More Desktop APIs</strong><br>Much has been said about this <a target=_blank><u><font color=#0000ff>spoonful of sugar</font></u></a> (to go with the Desktop team's <a target=_blank><u><font color=#0000ff>cake</font></u></a>), so we will only skim a little. GUI developers get a large number of new tricks to play like the ever popular yet newly incorporated SwingWorker utility to help you with threading in GUI apps, <code>JTable</code> sorting and filtering, and a new facility for quick splash screens to quiet impatient users. <br><br><strong> <li>Monitoring and Management</strong><br>The really big deal here is that you don't need do anything special to the startup to be able to attach on demand with any of the <a target=_blank><u><font color=#0000ff>monitoring and management tools</font></u></a> in the Java SE platform. Java SE 6 adds yet more diagnostic information, and we co-bundled the infamous memory-heap analysis tool <a ><u><font color=#0000ff>Jhat</font></u></a> for forensic explorations of those core dumps.<br><br><!-- BEGIN ENHANCED QUOTE COMPONENT--> <table class=grey3 cellSpacing=0 cellPadding=4 width=180 align=right border=0> <tbody> <tr> <td class=white> <div id="wmqeeuq" class=sp2> </div> </td> <td width="100%"> <div id="wmqeeuq" class=pad8>"For those of you deafened by your screaming inner geek, roll up your sleeves and give it a try." <br><span id="wmqeeuq" class=sp8> </span> <table class=white cellSpacing=0 cellPadding=0 width="100%" border=0> <tbody> <tr> <td><img height=4 alt=" " src="http://java.sun.com/im/a.gif" width=1 border=0></td> </tr> </tbody> </table> <div id="wmqeeuq" class=sp8> </div> <span id="wmqeeuq" class=smaller><strong>Danny Coward</strong><br>Java SE Platform Lead</span></div> </td> </tr> </tbody> </table> <span id="wmqeeuq" class=sp10> </span><br><!-- END ENHANCED QUOTE COMPONENT --><strong> <li>Compiler Access</strong><br>Really aimed at people who create tools for Java development and for frameworks like JavaServer Pages (JSP) or Personal Home Page construction kit (PHP) engines that need to generate a bunch of classes on demand, the compiler API opens up programmatic access to <code>javac</code> for in-process compilation of dynamically generated Java code. The compiler API is not directly intended for the everyday developer, but for those of you deafened by your screaming inner geek, <a ><u><font color=#0000ff>roll up your sleeves</font></u></a> and give it a try. And the rest of us will happily benefit from the <a target=_blank><u><font color=#0000ff>tools</font></u></a> and the improved Java frameworks that use this. <br><br><strong> <li>Pluggable Annotations</strong><br>It is becoming a running joke in Java technology circles, at least some that contain us, that for every <a ><u><font color=#0000ff>wished-for feature</font></u></a> missing in Java technology, there's a budding <a target=_blank><u><font color=#0000ff>annotation</font></u></a> that will solve the problem. Joke no more, because Java tool and framework vendors can put a different smile on your face, defining their own annotations and have core support for plugging in and executing the processors that do the heavy lifting that can make custom annotations so cool. <br><br><strong> <li>Desktop Deployment</strong><br>Those of you deploying applications to the desktop will soon discover that it's a tale of a large number of <a ><u><font color=#0000ff>smaller changes</font></u></a> that add up to a big difference to existing applications: better platform look-and-feel in Swing technology, LCD text rendering, and snappier GUI performance overall. Java applications can integrate better with the native platform with things like new access to the platform's System Tray and Start menu. At long last, Java SE 6 unifies the Java Plug-in technology and Java WebStart engines, which just makes sense. Installation of the Java WebStart application got a much needed <a target=_blank><u><font color=#0000ff>makeover</font></u></a>. <br><br><strong> <li>Security</strong><br>You can have all the security features you like in the platform ?and this release adds a few more, like the <a ><u><font color=#0000ff>XML-Digital Signature (XML-DSIG) APIs</font></u></a> for creating and manipulating digital signatures ?but if you don't have well supported security administrators, your security may be at risk. So Java SE 6 has simplified the job of its security administrators by providing various new ways to access platform-native security services, such as native Public Key Infrastructure (PKI) and cryptographic services on Microsoft Windows for secure authentication and communication, Java Generic Security Services (Java GSS) and Kerberos services for authentication, and access to LDAP servers for authenticating users. <br><br><strong> <li>The -lities: Quality, Compatibility, Stability</strong><br>You probably knew that Sun has done regular feature releases of the Java SE platform over the last 10 years. So we certainly feel like we've built up some expertise in this area, such as the ever growing 80,000 test cases and several million lines of code testing <a ><u><font color=#0000ff>conformance</font></u></a> (being just one aspect of our testing activity). You probably noticed that, unlike the last release, people have been downloading binary <a target=_blank><u><font color=#0000ff>snapshots</font></u></a> for the last 20 (not just 6) months. And what's more, they've been filing bugs. So, before we even got to <a ><u><font color=#0000ff>beta</font></u></a>, we'd fixed a number of quality and regression issues. Doesn't that add up to a better product? Oh, and by the way, <a ><u><font color=#0000ff>performance</font></u></a> is looking better than J2SE 5.0. </li> </ol> <p>        1、Web Services. 优先支持~写 XML web service 客户端程序。你可以用过单的annotaion你的API发布?NET交互的web services. Mustang d了新的解析和 XML ?Java object-mapping APIs? 之前只在Java EEq_实现或者Java Web Services Pack中提?<br>  2、Scripting. 现在你可以在Java源代码中混入JavaScript了,q对开发原型很有有用,你也可以插入自己的脚本引擎?nbsp; </p> <p>  3、Database. Mustang 联合绑?Java DB (Apache Derby). JDBC 4.0 增加了许多特性例如支持XML作ؓSQL数据cdQ更好的集成Binary Large OBjects (BLOBs) ?Character Large OBjects (CLOBs) . </p> <p>  4、More Desktop APIs. GUI 开发者可以有更多的技巧来使用 SwingWorker utility Q以帮助GUI应用中的多线E? JTable 分类和过滤,以及dsplash闪屏?</p> <p>  5、Monitoring and Management. Mustang d更多的诊断信息,l定了不是很知名?memory-heap 分析工具Jhat 来查看内核导出?</p> <p>  6、Compiler Access.  compiler API提供~程讉KjavacQ可以实现进E内~译Q动态生Java代码?nbsp; </p> <p>  7、Pluggable Annotation. Java tool和framework 提供商可以定义自q annotations Qƈ且内核支持自定义annotation的插件和执行处理?nbsp; </p> <p>  8、Desktop Deployment. Swing拥有更好?look-and-feel , LCD 文本呈现, 整体GUI性能的提升。Java应用E序可以和本地^台更好的集成Q例如访问^台的pȝ托盘和开始菜单。MustangJava插g技术和Java Web Start引擎l一了v来?</p> <p>  9、Security. XML-数字{֐(XML-DSIG) APIs 用于创徏和操U|字签?; 新的Ҏ来访问本地^台的安全服务Q例如本地Microsoft Windows for secure authentication and communicationnative 的Public Key Infrastructure (PKI) ?cryptographic servicesQ?Java Generic Security Services (Java GSS) ?Kerberos services for authentication, 以及讉K LDAP servers 来认证用? </p> <p>  10、The -ilities: 质量Q兼Ҏ,E_性?80,000 test cases 和数百万行测试代?只是试zd中的一个方?. Mustang 的快照发布已l被下蝲15个月了,每一步中的Bug都被修复了,表现比J2SE 5q要好?/p> <img src ="http://www.aygfsteel.com/hyq0077/aggbug/121113.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/hyq0077/" target="_blank">hyq</a> 2007-05-31 11:47 <a href="http://www.aygfsteel.com/hyq0077/articles/jdk6.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank">ն</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">޻</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">¬</a>| <a href="http://" target="_blank">Ǭ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">κ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">山</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ư</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">пǰ</a>| <a href="http://" target="_blank">˳</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank">ϰ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ƥɽ</a>| <a href="http://" target="_blank">Զ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ԭ</a>| <a href="http://" target="_blank">˫</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">˳</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">˳</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>