[jboss-cvs] JBossAS SVN: r68359 - projects/docs/trunk/Server_Configuration_Guide/zh-CN.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Dec 17 22:02:50 EST 2007


Author: xhuang at jboss.com
Date: 2007-12-17 22:02:50 -0500 (Mon, 17 Dec 2007)
New Revision: 68359

Modified:
   projects/docs/trunk/Server_Configuration_Guide/zh-CN/Deploy.po
   projects/docs/trunk/Server_Configuration_Guide/zh-CN/EJB3.po
Log:
update

Modified: projects/docs/trunk/Server_Configuration_Guide/zh-CN/Deploy.po
===================================================================
--- projects/docs/trunk/Server_Configuration_Guide/zh-CN/Deploy.po	2007-12-18 02:34:12 UTC (rev 68358)
+++ projects/docs/trunk/Server_Configuration_Guide/zh-CN/Deploy.po	2007-12-18 03:02:50 UTC (rev 68359)
@@ -1,23 +1,26 @@
+# translation of Deploy.po to
 # Language zh-CN translations for PACKAGE package.
+#
 # Automatically generated, 2007.
-#
+# Xi HUANG <xhuang at redhat.com>, 2007.
 msgid ""
 msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
+"Project-Id-Version: Deploy\n"
 "Report-Msgid-Bugs-To: http://bugs.kde.org\n"
 "POT-Creation-Date: 2007-12-09 23:23+0000\n"
-"PO-Revision-Date: 2007-12-09 23:23+0000\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: none\n"
+"PO-Revision-Date: 2007-12-14 10:23+1000\n"
+"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
+"Language-Team:  <zh at li.org>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
 
 #. Tag: title
 #: Deploy.xml:6
 #, no-c-format
 msgid "Deployment"
-msgstr ""
+msgstr "部署"
 
 #. Tag: para
 #: Deploy.xml:8
@@ -30,13 +33,13 @@
 "directory to pick up new applications or any changes to existing "
 "applications. So, you can \"hot deploy\" application on the fly while JBoss "
 "AS is still running."
-msgstr ""
+msgstr "在 JBoss AS 里部署应用程序非常容易。你只需要把程序复制到 JBOSS_HOME/server/default/deploy 目录就可以了。你可以用不同的服务器配置来替换 default 配置,如 all 或 minimal 配置。我们将在后面讨论这些内容。JBoss AS 会持续地扫描 deploy 目录来启动新的应用程序或应用对现有程序的修改。这意味着,你可以在 JBoss AS 还在运行的时候“热部署”应用程序。"
 
 #. Tag: title
 #: Deploy.xml:11
 #, no-c-format
 msgid "Deployable Application Types"
-msgstr ""
+msgstr "可部署的应用程序类型"
 
 #. Tag: para
 #: Deploy.xml:13
@@ -44,7 +47,7 @@
 msgid ""
 "You can deploy several different types of enterprise applications in JBoss "
 "AS:"
-msgstr ""
+msgstr "你可以在 JBoss AS 里部署不同类型的企业级应用程序:"
 
 #. Tag: para
 #: Deploy.xml:17
@@ -54,7 +57,7 @@
 "application in a JAR file. It contains servlet classes, view pages, "
 "libraries, and deployment descriptors such as web.xml, faces-config.xml, and "
 "jboss-web.xml etc."
-msgstr ""
+msgstr "WAR 应用程序归档(例如:myapp.war)将 Java EE web 应用程序打包在一个 JAR 文件里。它包含 servlet 类、视图页面、库和部署描述符如 web.xml、faces-config.xml 和 jboss-web.xml 等等。"
 
 #. Tag: para
 #: Deploy.xml:19
@@ -64,7 +67,7 @@
 "application in a JAR file. It typically contains a WAR file for the web "
 "module, JAR files for EJB modules, as well as deployment descriptors such as "
 "application.xml and jboss-app.xml etc."
-msgstr ""
+msgstr "EAR 应用程序归档(例如:myapp.ear)把 Java EE 企业级应用程序打包在一个 JAR 文件里。它通常包含一个用作 web 模块的 WAR 文件,以及部署描述符如 application.xml 和 jboss-app.xml 等等。"
 
 #. Tag: para
 #: Deploy.xml:21
@@ -73,7 +76,7 @@
 "The SAR application archive (e.g., myservice.sar) packages a JBoss service "
 "in a JAR file. It is mostly used by JBoss internal services. Please see more "
 "in <xref linkend=\"The_JBoss_JMX_Microkernel\"/>."
-msgstr ""
+msgstr "SAR 应用程序归档(例如:myservice.sar)将 JBoss 服务打包在一个 JAR 文件里。它通常用于 JBoss 内部服务。详情请参考 <xref linkend=\"The_JBoss_JMX_Microkernel\"/>。"
 
 #. Tag: para
 #: Deploy.xml:23
@@ -82,7 +85,7 @@
 "The *-ds.xml file defines connections to external databases. The data source "
 "can then be reused by all applications and services in JBoss AS via the "
 "internal JNDI."
-msgstr ""
+msgstr "*-ds.xml 文件定义与外部数据库的连接。JBoss AS 里的所有应用程序和服务可以通过内部 JNDI 重用数据源。"
 
 #. Tag: para
 #: Deploy.xml:25
@@ -92,7 +95,7 @@
 "appropriate JAR files available in the deploy or lib directories, the MBeans "
 "specified in the XML files will be started. This is the way how you start "
 "many JBoss AS internal services, such as the JMS queues."
-msgstr ""
+msgstr "你可以部署带有 MBean 服务定义的 XML 文件。如果在 deploy 或 lib 目录里有合适的 JAR 文件,在 XML 文件里指定的 MBean 服务将被启动。这就是你启动许多 JBoss AS 内部服务的方法,如 JMS 队列。"
 
 #. Tag: para
 #: Deploy.xml:27
@@ -100,13 +103,13 @@
 msgid ""
 "You can also deploy JAR files containing EJBs or other service objects "
 "directly in JBoss AS."
-msgstr ""
+msgstr "你也可以在 JBoss AS 里直接部署包含 EJB 或其他服务对象的 JAR 文件。"
 
 #. Tag: title
 #: Deploy.xml:32
 #, no-c-format
 msgid "Exploded Deployment"
-msgstr ""
+msgstr "展开的部署"
 
 #. Tag: para
 #: Deploy.xml:33
@@ -121,12 +124,14 @@
 "deployment descriptors (e.g., the WEB-INF/web.xml in a WAR and the META-INF/"
 "application.xml in an EAR) to update their timestamps."
 msgstr ""
+"WAR、EAR 和 SAR 部署软件包实际上是带有特殊 XML 部署描述符(如 META-INF 和 WEB-INF)的 JAR 文件。JBoss AS 允许你以展开目录而不是 JAR 文件的形式部署这些归档。这让你可以很方便地改动应用程序(如网页)而不需要重新部署整个应用程序。如果你着实需要重新部署而不想重启服务器,你只需要 \"touch\" 部署描述符(例如:WAR 里的 WEB-INF/web.xml、EAR 里的 META-INF/"
+"application.xml)来更新其时间戳就可以了。"
 
 #. Tag: title
 #: Deploy.xml:39
 #, no-c-format
 msgid "Standard Server Configurations"
-msgstr ""
+msgstr "标准的服务器配置"
 
 #. Tag: para
 #: Deploy.xml:41
@@ -139,7 +144,7 @@
 "directory named <literal> JBOSS_HOME/server/[config name]/</literal>. You "
 "can look into each server configuration's directory to see the default "
 "services, applications, and libraries supported in the configuration."
-msgstr ""
+msgstr "JBoss 应用服务器带有 3 个服务器配置。你可以把 -c 选项传递给启动脚本来选择启动哪个配置。例如,命令 run.sh -c all 将用 all 配置启动服务器。每个配置都有一个对应的目录 <literal> JBOSS_HOME/server/[config name]/</literal>。你可以访问这些目录来查看该配置里缺省的服务、应用程序和所支持的库。"
 
 #. Tag: para
 #: Deploy.xml:44
@@ -148,7 +153,7 @@
 "The minimal configuration starts the core server container without any of "
 "the enterprise services. It is a good starting point if you want to build a "
 "customized version of JBoss AS that only contains the services you need."
-msgstr ""
+msgstr "minimal 配置仅启动核心服务器容器,它不带有任何企业级服务。如果你想构建自定义的 JBoss AS 版本,让它仅包含你所需要的服务,minimal 配置是一个很好的起点。"
 
 #. Tag: para
 #: Deploy.xml:45
@@ -157,7 +162,7 @@
 "The default configuration is the mostly common used configuration for "
 "application developers. It supports the standard J2EE 1.4 and most of the "
 "Java EE 5.0 programming APIs (e.g., JSF and EJB3)."
-msgstr ""
+msgstr "default 配置是应用程序开发人员最常用的配置。它支持标准的 J2EE 1.4 以及大部分 Java EE 5.0 的 API(例如:JSF 和 EJB3)。"
 
 #. Tag: para
 #: Deploy.xml:46
@@ -165,7 +170,7 @@
 msgid ""
 "The all configuration is the default configuration with clustering support "
 "and other enterprise extensions."
-msgstr ""
+msgstr "all 配置是带有群集支持和其他企业级扩展的缺省配置。"
 
 #. Tag: para
 #: Deploy.xml:50
@@ -173,4 +178,5 @@
 msgid ""
 "The detailed services and APIs supported in each of those configurations "
 "will be discussed throughout this book."
-msgstr ""
+msgstr "对每个配置里的服务和所支持的 API 的讨论将贯穿本书。"
+

Modified: projects/docs/trunk/Server_Configuration_Guide/zh-CN/EJB3.po
===================================================================
--- projects/docs/trunk/Server_Configuration_Guide/zh-CN/EJB3.po	2007-12-18 02:34:12 UTC (rev 68358)
+++ projects/docs/trunk/Server_Configuration_Guide/zh-CN/EJB3.po	2007-12-18 03:02:50 UTC (rev 68359)
@@ -8,7 +8,7 @@
 "Project-Id-Version: EJB3\n"
 "Report-Msgid-Bugs-To: http://bugs.kde.org\n"
 "POT-Creation-Date: 2007-12-09 23:23+0000\n"
-"PO-Revision-Date: 2007-12-11 13:36+1000\n"
+"PO-Revision-Date: 2007-12-18 13:02+1000\n"
 "Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
 "Language-Team:  <zh at li.org>\n"
 "MIME-Version: 1.0\n"
@@ -285,13 +285,13 @@
 "EJB3 / JSF integration to new heights far beyond what Java EE 5 provides. "
 "Please see more details in the JBoss Seam reference guide bundled with the "
 "platform."
-msgstr ""
+msgstr "Java EE 5 允许你通过注解而不是显性的 JNDI 查找把 EJB3 bean 实例直接注入到 web 应用程序里。JBoss AS 4.2 暂时还不支持这种功能。然而,JBoss 企业级平台通过一个名为 JBoss Seam 的集成框架。JBoss Seam 将 EJB3 和 JSF 的集成带到了远胜于 Java EE 5 所能提供的一个新的高度。详情请参考本平台捆绑的 JBoss Seam 参考指南。"
 
 #. Tag: title
 #: EJB3.xml:52
 #, no-c-format
 msgid "Entity Beans (a.k.a. Java Persistence API)"
-msgstr ""
+msgstr "Entity Beans (a.k.a. Java Persistence API)"
 
 #. Tag: para
 #: EJB3.xml:54
@@ -301,7 +301,7 @@
 "transactional methods. To actually access the database, you will need EJB3 "
 "entity beans and the entity manager API. They are collectively called the "
 "Java Persistence API (JPA)."
-msgstr ""
+msgstr "EJB3 session bean 允许你在事务性方法里实现数据访问逻辑。要对数据库进行实际的访问,你将需要 EJB3 entity bean 和 entity manager API。它们被统称为 Java Persistence API (JPA)。"
 
 #. Tag: para
 #: EJB3.xml:56
@@ -312,7 +312,7 @@
 "relational table named customer. The table has three columns: name, age, and "
 "signupdate. Each instance of the bean corresponds to a row of data in the "
 "table."
-msgstr ""
+msgstr "EJB3 Entity Bean 是映射到关系型数据库表的 Plain Old Java Objects (POJOs)。"
 
 #. Tag: programlisting
 #: EJB3.xml:58
@@ -354,6 +354,41 @@
 "}    \n"
 "]]>"
 msgstr ""
+"<![CDATA[\n"
+"@Entity\n"
+"public class Customer {\n"
+"\n"
+"  String name;\n"
+"\n"
+"  public String getName () {\n"
+"    return name;\n"
+"  }\n"
+"  \n"
+"  public void setName (String name) {\n"
+"    this.name = name;\n"
+"  }\n"
+"  \n"
+"  int age;\n"
+"  \n"
+"  public int getAge () {\n"
+"    return age;\n"
+"  }\n"
+"  \n"
+"  public void setAge (int age) {\n"
+"    this.age = age;\n"
+"  }\n"
+"  \n"
+"  Date signupdate;\n"
+"  \n"
+"  public Date getSignupdate () {\n"
+"    return signupdate;\n"
+"  }\n"
+"  \n"
+"  public void setSignupdate (Date signupdate) {\n"
+"    this.signupdate = signupdate;\n"
+"  }\n"
+"}    \n"
+"]]>"
 
 #. Tag: para
 #: EJB3.xml:60
@@ -367,7 +402,7 @@
 "corresponding record in the Account table, multiple corresponding records in "
 "the Order table, and each record in the Employee table has multiple "
 "corresponding records in the Customer table."
-msgstr ""
+msgstr "在简单的数据属性外,entity bean 也可以包含对其他带有关系型映射注解(如 @OneToOne、@OneToMany、@ManyToMany 等)的 entity bean 的引用。这些 entity 对象的关系将自动设为数据库的外键。例如,下面的例子显示了 Customer 表里的每条记录都在 Account 表里有一条对应的记录,而 Employee 表里的每条记录都在 Customer 表里有多条对应的记录。"
 
 #. Tag: programlisting
 #: EJB3.xml:62
@@ -414,6 +449,46 @@
 "\n"
 "]]>"
 msgstr ""
+"<![CDATA[\n"
+"@Entity\n"
+"public class Customer {\n"
+"\n"
+"  ... ...\n"
+"  \n"
+"  Account account;\n"
+"  \n"
+"  @OneToOne\n"
+"  public Account getAccount () {\n"
+"    return account;\n"
+"  }\n"
+"  \n"
+"  public void setAccount (Accout account) {\n"
+"    this.account = account;\n"
+"  }\n"
+"  \n"
+"  Employee salesRep;\n"
+"  \n"
+"  @ManyToOne\n"
+"  public Employee getSalesRep () {\n"
+"    return salesRep;\n"
+"  }\n"
+"  \n"
+"  public void setSalesRep (Employee salesRep) {\n"
+"    this.salesRep = salesRep;\n"
+"  }\n"
+"  \n"
+"  Vector <Order> orders;\n"
+"  \n"
+"  @OneToMany\n"
+"  public Vector <Order> getOrders () {\n"
+"    return orders;\n"
+"  }\n"
+"  \n"
+"  public void setOrders (Vector <Order> orders) {\n"
+"    this.orders = orders;\n"
+"  }\n"
+"\n"
+"]]>"
 
 #. Tag: para
 #: EJB3.xml:64
@@ -423,7 +498,7 @@
 "entity objects. The EntityManager transparently updates the underlying "
 "database tables in the process. You can obtain an EntityManager object in "
 "your EJB3 session bean via the @PersistenceContext annotation."
-msgstr ""
+msgstr "使用 EntityManager API,你可以创建、更新、删除和查询 entity 对象。在这个过程中,EntityManager 透明地更新底层的数据库表。你可以在 EJB3 session bean 里通过 @PersistenceContext 注解获得 EntityManager 对象。"
 
 #. Tag: programlisting
 #: EJB3.xml:66
@@ -450,6 +525,26 @@
 "     \"select c from Customer where c.age > 30\");\n"
 "]]>"
 msgstr ""
+"<![CDATA[\n"
+"@PersistenceContext\n"
+"EntityManager em;\n"
+"\n"
+"Customer customer = new Customer ();\n"
+"// populate data in customer\n"
+"\n"
+"// Save the newly created customer object to DB\n"
+"em.persist (customer);\n"
+"\n"
+"// Increase age by 1 and auto save to database\n"
+"customer.setAge (customer.getAge() + 1);\n"
+"\n"
+"// delete the customer and its related objects from the DB\n"
+"em.remove (customer);\n"
+"\n"
+"// Get all customer records with age > 30 from the DB\n"
+"List <Customer> customers = em.query (\n"
+"     \"select c from Customer where c.age > 30\");\n"
+"]]>"
 
 #. Tag: para
 #: EJB3.xml:68
@@ -459,12 +554,14 @@
 "Interested readers should refer to the JPA documentation or Hibernate "
 "EntityManager documentation."
 msgstr ""
+"EntityManager API 的使用详情超出了本书的范畴。有兴趣的读者可以参考 JPA 文档或 Hibernate "
+"EntityManager 文档。"
 
 #. Tag: title
 #: EJB3.xml:71
 #, no-c-format
 msgid "The persistence.xml file"
-msgstr ""
+msgstr "persistence.xml 文件"
 
 #. Tag: para
 #: EJB3.xml:73
@@ -475,7 +572,7 @@
 "configure the underlying object-relational-mapping engine and cache for "
 "better performance and trouble shooting? The persistence.xml file gives you "
 "complete flexibility to configure the EntityManager."
-msgstr ""
+msgstr "EntityManager API 很不错,但服务器怎么知道使用哪个数据库来包存、更新和查询 entity 对象?我们怎样配置底层的对象-关系型-映射引擎和缓存以获得更好的性能和利于故障排除?你可以通过 persistence.xml 文件很灵活地配置 EntityManager。"
 
 #. Tag: para
 #: EJB3.xml:75
@@ -492,6 +589,9 @@
 "JBoss AS. Please refer to <xref linkend=\"alternative_DBs\"/> on how to "
 "setup alternative databases for JBoss AS."
 msgstr ""
+"persistence.xml 是 JPA 里的一个标准配置文件。它必须位于包含 entity bean 的 JAR 文件里的 META-INF 目录里。persistence.xml 文件必须定义一个在当前类加载器里具有唯一名称的 persistence-unit。provider 属性指定了 JPA EntityManager 的底层实现。在 JBoss "
+"AS 里,缺省的且仅支持和推荐的 JPA 提供者是 Hibernate。jta-data-source 指向这个 persistence "
+"unit 映射的数据库的 JNDI 名称。这里的 java:/DefaultDS 指向 JBoss AS 内嵌的 HSQL DB。关于如何在 JBoss AS 里设立其他的数据库,请参考 <xref linkend=\"alternative_DBs\"/>。"
 
 #. Tag: programlisting
 #: EJB3.xml:77
@@ -509,12 +609,23 @@
 "</persistence>          \n"
 "]]>"
 msgstr ""
+"<![CDATA[\n"
+"<persistence>\n"
+"   <persistence-unit name=\"myapp\">\n"
+"      <provider>org.hibernate.ejb.HibernatePersistence</provider>\n"
+"      <jta-data-source>java:/DefaultDS</jta-data-source>\n"
+"      <properties>\n"
+"         ... ...\n"
+"      </properties>\n"
+"   </persistence-unit>\n"
+"</persistence>          \n"
+"]]>"
 
 #. Tag: title
 #: EJB3.xml:80
 #, no-c-format
 msgid "Inject EntityManager by persistence-unit name"
-msgstr ""
+msgstr "以 persistence-unit 名注入 EntityManager"
 
 #. Tag: para
 #: EJB3.xml:81
@@ -525,7 +636,7 @@
 "@PersistenceContext annotation which unit you want to inject. For instance, "
 "@PersistenceContext(name=\"myapp\") injects the EntityManager from the "
 "persistence-unit named \"myapp\"."
-msgstr ""
+msgstr "既然在同一应用程序里可能定义了多个 persistence-unit 实例,你通常需要显性地用 @PersistenceContext 注解来指定要注入的 unit。例如,@PersistenceContext(name=\"myapp\") 把名为 \"myapp\" 的 persistence-unit 注入 EntityManager。"
 
 #. Tag: para
 #: EJB3.xml:82
@@ -535,7 +646,7 @@
 "and have only one persistence-unit defined in the whole application, you can "
 "omit the \"name\" on @PersistenceContext. See later in this chapter for EAR "
 "packaging and deployment."
-msgstr ""
+msgstr "然而,如果你把 EAR 程序部署在作用域为本应用程序的类加载器里且在整个应用程序里只定义了一个 persistence-unit,你可以忽略 @PersistenceContext 里的 \"name\"。请参考本章后面的 EAR 打包和部署的内容。"
 
 #. Tag: para
 #: EJB3.xml:85
@@ -549,7 +660,7 @@
 "SQL dialect of the persistence engine to HSQL, and to create tables from the "
 "entity beans when the application starts and drop those tables when the "
 "application stops."
-msgstr ""
+msgstr "persistence.xml 里的属性元素可以包含用于底层持久化提供者的任何配置属性。既然 JBoss AS 把Hibernate 作为其 EJB3 持久化的提供者,你可以在此传入任何 Hibernate 选项。在这里,我们将给出一个例子来把持久化引擎的 SQL 方言设置为 HSQL,然后根据 entity bean 在应用程序启动时创建表而在应用程序终止时删除表。"
 
 #. Tag: programlisting
 #: EJB3.xml:87
@@ -569,12 +680,25 @@
 "</persistence>          \n"
 "]]>"
 msgstr ""
+"<![CDATA[\n"
+"<persistence>\n"
+"   <persistence-unit name=\"myapp\">\n"
+"      <provider>org.hibernate.ejb.HibernatePersistence</provider>\n"
+"      <jta-data-source>java:/DefaultDS</jta-data-source>\n"
+"      <properties>\n"
+"         property name=\"hibernate.dialect\" \n"
+"                  value=\"org.hibernate.dialect.HSQLDialect\"/>\n"
+"         <property name=\"hibernate.hbm2ddl.auto\" value=\"create-drop\"/>\n"
+"      </properties>\n"
+"   </persistence-unit>\n"
+"</persistence>          \n"
+"]]>"
 
 #. Tag: title
 #: EJB3.xml:92
 #, no-c-format
 msgid "Use Alternative Databases"
-msgstr ""
+msgstr "使用其他数据库"
 
 #. Tag: para
 #: EJB3.xml:94
@@ -588,6 +712,8 @@
 "files for various databases are available in JBOSS_DIST/docs/examples/jca "
 "directory in the server."
 msgstr ""
+"要使用其他数据库而不是内置的 HSQL DB 来支持 entity bean,你首先需要定义数据源并在 JNDI 进行注册。详情请参考 <xref linkend=\"Connectors_on_JBoss-"
+"Configuring_JDBC_DataSources\"/>。你可以在服务器里的 JBOSS_DIST/docs/examples/jca 目录下找到用于不同数据库的 *-ds.xml 样例。"
 
 #. Tag: para
 #: EJB3.xml:96
@@ -596,7 +722,7 @@
 "Then, in the persistence.xml, you need to change the jta-data-source "
 "attribute to point to the new data source in JNDI (e.g., java:/MysqlDS if "
 "you are using the default mysql-ds.xml to setup a MySQL external database)."
-msgstr ""
+msgstr "然后,在 persistence.xml 里,你需要修改 jta-data-source 属性,使其指向 JNDI 里的新数据库源(例如你要使用缺省的 mysql-ds.xml 来设立 MySQL 外部数据库,这个属性应该为 java:/MysqlDS)。"
 
 #. Tag: para
 #: EJB3.xml:98
@@ -609,49 +735,49 @@
 "hibernate.dialect property explicitly in persistence.xml. Here are the "
 "Hibernate dialect for database servers officially supported on the JBoss "
 "platform."
-msgstr ""
+msgstr "在大多数情况下,Hibernate 会试图自动地检测所连接的数据库并选择合适的 SQL 方言。然而,我们发现这样的检测并非总是正确,尤其是对于不常用的数据库而言。我们建议你在 persistence.xml 里显性地设置 hibernate.dialect 属性。下面是 JBoss 平台正式支持的数据库服务器的 Hibernate 方言。"
 
 #. Tag: para
 #: EJB3.xml:101
 #, no-c-format
 msgid "Oracle 9i and 10g: org.hibernate.dialect.Oracle9Dialect"
-msgstr ""
+msgstr "Oracle 9i and 10g: org.hibernate.dialect.Oracle9Dialect"
 
 #. Tag: para
 #: EJB3.xml:102
 #, no-c-format
 msgid "Microsoft SQL Server 2005: org.hibernate.dialect.SQLServerDialect"
-msgstr ""
+msgstr "Microsoft SQL Server 2005: org.hibernate.dialect.SQLServerDialect"
 
 #. Tag: para
 #: EJB3.xml:103
 #, no-c-format
 msgid "PostgresSQL 8.1: org.hibernate.dialect.PostgreSQLDialect"
-msgstr ""
+msgstr "PostgresSQL 8.1: org.hibernate.dialect.PostgreSQLDialect"
 
 #. Tag: para
 #: EJB3.xml:104
 #, no-c-format
 msgid "MySQL 5.0: org.hibernate.dialect.MySQL5Dialect"
-msgstr ""
+msgstr "MySQL 5.0: org.hibernate.dialect.MySQL5Dialect"
 
 #. Tag: para
 #: EJB3.xml:105
 #, no-c-format
 msgid "DB2 8.0: org.hibernate.dialect.DB2Dialect"
-msgstr ""
+msgstr "DB2 8.0: org.hibernate.dialect.DB2Dialect"
 
 #. Tag: para
 #: EJB3.xml:106
 #, no-c-format
 msgid "Sybase ASE 12.5: org.hibernate.dialect.SybaseDialect"
-msgstr ""
+msgstr "Sybase ASE 12.5: org.hibernate.dialect.SybaseDialect"
 
 #. Tag: title
 #: EJB3.xml:112
 #, no-c-format
 msgid "Default Hibernate options"
-msgstr ""
+msgstr "缺省的 Hibernate 选项"
 
 #. Tag: para
 #: EJB3.xml:114
@@ -666,6 +792,9 @@
 "are commented out. They give you an idea of available properties in your "
 "<varname>persistence.xml</varname> file."
 msgstr ""
+"Hibernate 有很多配置属性。对于你没有在 persistence.xml 里特别指明的属性,JBoss AS 将提供一系列的缺省值。<varname>JBOSS_DIST/server/default/deploy/ejb3.deployer/MEAT-INF/"
+"persistence.properties</varname> 文件指定了缺省的 Hibernate 属性。下面是 JBoss AS 4.2 里捆绑的 <varname>persistence."
+"properties</varname> 文件。注意那些被注释的选项,它们代表 <varname>persistence.xml</varname> 里可用的属性值。"
 
 #. Tag: programlisting
 #: EJB3.xml:116
@@ -696,12 +825,36 @@
 "hibernate.bytecode.provider=javassist\n"
 "]]>"
 msgstr ""
+"<![CDATA[\n"
+"hibernate.transaction.manager_lookup_class=org.hibernate.transaction."
+"JBossTransactionManagerLookup\n"
+"#hibernate.connection.release_mode=after_statement\n"
+"#hibernate.transaction.flush_before_completion=false\n"
+"#hibernate.transaction.auto_close_session=false\n"
+"#hibernate.query.factory_class=org.hibernate.hql.ast."
+"ASTQueryTranslatorFactory\n"
+"#hibernate.hbm2ddl.auto=create-drop\n"
+"#hibernate.hbm2ddl.auto=create\n"
+"hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider\n"
+"# Clustered cache with TreeCache\n"
+"#hibernate.cache.provider_class=org.jboss.ejb3.entity.TreeCacheProviderHook\n"
+"#hibernate.treecache.mbean.object_name=jboss.cache:"
+"service=EJB3EntityTreeCache\n"
+"#hibernate.dialect=org.hibernate.dialect.HSQLDialect\n"
+"hibernate.jndi.java.naming.factory.initial=org.jnp.interfaces."
+"NamingContextFactory\n"
+"hibernate.jndi.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp."
+"interfaces\n"
+"hibernate.bytecode.use_reflection_optimizer=false\n"
+"# I don't think this is honored, but EJB3Deployer uses it\n"
+"hibernate.bytecode.provider=javassist\n"
+"]]>"
 
 #. Tag: title
 #: EJB3.xml:133
 #, no-c-format
 msgid "Message Driven Beans"
-msgstr ""
+msgstr "Message Driven Bean"
 
 #. Tag: para
 #: EJB3.xml:135
@@ -716,7 +869,7 @@
 "class specifies the JMS queue it listens to in the @MessageDriven "
 "annotation. The queue is registered under the local JNDI java:comp/env/ name "
 "space."
-msgstr ""
+msgstr "Messaging driven bean 是通过 JMS 消息而不是 \"stub\" 代理方法接受服务器请求的专用 EJB3 bean。所以,message driven bean 的一个关键配置参数是指定其侦听的 JMS 消息队列。当队列里有转入消息时,服务器调用 bean 的 <varname>onMessage()</varname> 方法,然后处理该消息。bean 类用 @MessageDriven 注解指定它侦听的 JMS 队列。这个队列在本地 JNDI java:comp/env/ 命名空间里注册。"
 
 #. Tag: programlisting
 #: EJB3.xml:137
@@ -740,6 +893,23 @@
 "}\n"
 "]]>"
 msgstr ""
+"<![CDATA[\n"
+"@MessageDriven(activationConfig =\n"
+"{\n"
+"  @ActivationConfigProperty(propertyName=\"destinationType\",\n"
+"    propertyValue=\"javax.jms.Queue\"),\n"
+"  @ActivationConfigProperty(propertyName=\"destination\",\n"
+"    propertyValue=\"queue/MyQueue\")\n"
+"})\n"
+"public class MyJmsBean implements MessageListener {\n"
+"\n"
+"  public void onMessage (Message msg) {\n"
+"    // ... do something with the msg ...\n"
+"  }\n"
+"\n"
+"  // ... ...\n"
+"}\n"
+"]]>"
 
 #. Tag: para
 #: EJB3.xml:139
@@ -748,7 +918,7 @@
 "When a message driven bean is deployed, its incoming message queue is "
 "automatically created if it does not exist already. To send a message to the "
 "bean, you can use the standard JMS API."
-msgstr ""
+msgstr "当 message driven bean 被部署时,如果它的转入消息队列不存在则会被自动创建。要向这个 bean 发送一个消息,你可以使用标准的 JMS API。"
 
 #. Tag: programlisting
 #: EJB3.xml:141
@@ -774,6 +944,25 @@
 "sender.send(msg);\n"
 "]]>"
 msgstr ""
+"<![CDATA[\n"
+"try {\n"
+"    InitialContext ctx = new InitialContext();\n"
+"    queue = (Queue) ctx.lookup(\"queue/MyQueue\");\n"
+"    QueueConnectionFactory factory =\n"
+"        (QueueConnectionFactory) ctx.lookup(\"ConnectionFactory\");\n"
+"    cnn = factory.createQueueConnection();\n"
+"    sess = cnn.createQueueSession(false,\n"
+"            QueueSession.AUTO_ACKNOWLEDGE);\n"
+"\n"
+"} catch (Exception e) {\n"
+"    e.printStackTrace ();\n"
+"}\n"
+"  \n"
+"TextMessage msg = sess.createTextMessage(...);\n"
+"\n"
+"sender = sess.createSender(queue);\n"
+"sender.send(msg);\n"
+"]]>"
 
 #. Tag: para
 #: EJB3.xml:143
@@ -781,13 +970,13 @@
 msgid ""
 "Please refer to the JMS specification or books to learn how to program in "
 "the JMS API."
-msgstr ""
+msgstr "请参考 JMS 规格或相关书籍来学习如何使用 JMS API 编程。"
 
 #. Tag: title
 #: EJB3.xml:169
 #, no-c-format
 msgid "Package and Deploy EJB3 Services"
-msgstr ""
+msgstr "打包和部署 EJB3 服务"
 
 #. Tag: para
 #: EJB3.xml:171
@@ -799,13 +988,13 @@
 "deploy EJB3 beans as standalone services in JBoss AS or as part of an "
 "enterprise application (i.e., in an EAR archive). In this section, we "
 "discuss those two deployment options."
-msgstr ""
+msgstr "EJB3 bean 类以普通 JAR 文件形式进行打包。标准的配置文件,如用于 session bean 的 ejb-jar.xml 和用于 entity bean 的 persistence.xml,都位于 JAR 文件里的 META-INF 目录里。在 JBoss AS 里你可以把 EJB3 bean 部署为独立服务或企业级应用程序(亦即 EAR 归档)的一部分。在本节,我们将讨论这两种部署方式。"
 
 #. Tag: title
 #: EJB3.xml:174
 #, no-c-format
 msgid "Deploy the EJB3 JAR"
-msgstr ""
+msgstr "部署 EJB3 JAR"
 
 #. Tag: para
 #: EJB3.xml:176
@@ -821,6 +1010,8 @@
 "META-INF/persistence.properties file we discussed earlier to configure the "
 "default behavior of EJB3 entity manager is located in the EJB3 deployer."
 msgstr ""
+"当你把 JAR 文件放入 <varname>JBOSS_DIST/server/default/deploy/</"
+"varname> 目录时,服务器将自动检测并进行处理。在 JAR 文件里定义的所有 EJB3 bean 将对于其他他通过 JNDI 名称(如 <varname>MyBean/local</varname>,<varname>MyBean</varname> 是 session bean 的实现类)在服务器内部或外部部署的应用程序可用。部署是通过 JBOSS_DIST/server/default/ejb3.deployer/ 里的 JBoss deployer 部署者进行的。我们先前讨论的配置 EJB3 entity manager 的缺省行为的 META-INF/persistence.properties 文件位于 EJB3 deployer 目录里。"
 
 #. Tag: para
 #: EJB3.xml:178
@@ -834,7 +1025,7 @@
 "file, you can tell the EJB3 deployer to ignore JARs you know do not contain "
 "EJB3 beans. The non-EJB3 JAR files shipped with the JBoss AS are already "
 "listed in the jboss.ejb3:service=JarsIgnoredForScanning MBean service:"
-msgstr ""
+msgstr "EJB3 deployer 自动地扫描 classpath 里 JAR 文件的 EJB3 注解。当它发现具有 EJB3 注解的类时,它会将这些类部署为 EJB3 服务。然而,如果应用程序很大并部署了很多 JAR 文件,扫描 classpath 里的所有 JAR 文件将非常耗时。在 JBOSS_DIST/server/default/ejb3.deployer/META-INF/jboss-service.xml 文件里,你可以设置 EJB3 deployer 忽略不包含 EJB3 bean 的 JAR 文件。JBoss AS 附带的非 EJB3 的 JAR 文件已经在 jboss.ejb3:service=JarsIgnoredForScanning MBean 服务里列出:"
 
 #. Tag: programlisting
 #: EJB3.xml:181
@@ -860,6 +1051,25 @@
 "  ... ...\n"
 "]]>"
 msgstr ""
+"<![CDATA[\n"
+"  ... ...\n"
+"  <mbean code=\"org.jboss.ejb3.JarsIgnoredForScanning\" \n"
+"         name=\"jboss.ejb3:service=JarsIgnoredForScanning\">\n"
+"      <attribute name=\"IgnoredJars\">\n"
+"         snmp-adaptor.jar,\n"
+"         otherimages.jar,\n"
+"         applet.jar,\n"
+"         jcommon.jar,\n"
+"         console-mgr-classes.jar,\n"
+"         jfreechart.jar,\n"
+"         juddi-service.jar,\n"
+"         wsdl4j.jar,\n"
+"         ... ...\n"
+"         servlets-webdav.jar\n"
+"      </attribute>\n"
+"   </mbean>\n"
+"  ... ...\n"
+"]]>"
 
 #. Tag: para
 #: EJB3.xml:183
@@ -868,13 +1078,13 @@
 "You can add any non-EJB3 JARs from your application to this list so that the "
 "server do not have to waste time scanning them. This could significantly "
 "improve the application startup time in some cases."
-msgstr ""
+msgstr "你可以从应用程序里添加任何非 EJB3 的 JAR 文件到这个列表里,这样服务器就不会浪费时间来对其进行扫描。在某些情况下这可以大大地缩短应用程序的启动时间。"
 
 #. Tag: title
 #: EJB3.xml:188
 #, no-c-format
 msgid "Deploy EAR with EJB3 JAR"
-msgstr ""
+msgstr "部署带有 EJB3 JAR 的 EAR"
 
 #. Tag: para
 #: EJB3.xml:190
@@ -887,7 +1097,7 @@
 "other support library JARs required by the application. An EAR file also "
 "have deployment descriptors such as application.xml and jboss-app.xml. Below "
 "is the basic structure of a typical EAR application."
-msgstr ""
+msgstr "大多数 Java EE 应用程序都以 EAR 归档的形式部署。EAR 归档是一个 JAR 文件,它通常包含用于 web 页面的 WAR 归档、servlets 及其他和 web 相关的组件、一个或多个为 WAR 组件提供服务(如数据访问和事务)的 EJB3 JAR、以及应用程序所需的其他支撑库 JAR 文件。EAR 文件也包含部署描述符,如 application.xml 和 jboss-app.xml。下面是一个典型的 EAR 应用程序的基本结构。"
 
 #. Tag: programlisting
 #: EJB3.xml:192
@@ -913,6 +1123,25 @@
 "   |+ Library JARs for the EAR\n"
 "]]>"
 msgstr ""
+"<![CDATA[\n"
+"myapp.ear\n"
+"|+ META-INF\n"
+"   |+ applications.xml and jboss-app.xml\n"
+"|+ myapp.war\n"
+"   |+ web pages and JSP /JSF pages\n"
+"   |+ WEB-INF\n"
+"      |+ web.xml, jboss-web.xml, faces-config.xml etc.\n"
+"      |+ lib\n"
+"         |+ tag library JARs\n"
+"      |+ classes\n"
+"         |+ servlets and other classes used by web pages\n"
+"|+ myapp.jar\n"
+"   |+ EJB3 bean classes\n"
+"   |+ META-INF\n"
+"      |+ ejb-jar.xml and persistence.xml\n"
+"|+ lib\n"
+"   |+ Library JARs for the EAR\n"
+"]]>"
 
 #. Tag: para
 #: EJB3.xml:194
@@ -922,7 +1151,7 @@
 "not need to declare EJB references in the web.xml file in order for the "
 "components in the WAR file to access EJB3 services. You can obtain the "
 "references directly via JNDI as we discussed earlier in the chapter."
-msgstr ""
+msgstr "请注意在 JBoss AS 里,不象许多其他应用服务器,对于 WAR 文件里的组件访问 EJB3 服务,你不需要在 web.xml 里声明 EJB 引用。如本章前面所讨论的,你可以通过 JNDI 直接获得这些引用。"
 
 #. Tag: para
 #: EJB3.xml:196
@@ -935,7 +1164,7 @@
 "classpath for JAR files used in this application. The JAR file location "
 "defaults to lib in JBoss AS -- but it might be different in other "
 "application servers."
-msgstr ""
+msgstr "下面是一个典型的 application.xml 文件。它声明了 EAR 里的 WAR 和 EJB3 JAR 归档且定义应用程序的 web 上下文根目录。当然,在同一 EAR 应用程序里可以有多个 EJB3 模块。application.xml 文件也可以为应用程序里使用的 JAR 文件定义共享 classpath。在 JBoss AS 里,JAR 文件的位置缺省为 lib 目录 - 但在其他应用服务器里可能有所不同。"
 
 #. Tag: programlisting
 #: EJB3.xml:198
@@ -961,6 +1190,25 @@
 "</application>\n"
 "]]>"
 msgstr ""
+"<![CDATA[\n"
+"<application>\n"
+"  <display-name>My Application</display-name>\n"
+"\n"
+"  <module>\n"
+"    <web>\n"
+"      <web-uri>myapp.war</web-uri>\n"
+"      <context-root>/myapp</context-root>\n"
+"    </web>\n"
+"  </module>\n"
+"\n"
+"  <module>\n"
+"    <ejb>myapp.jar</ejb>\n"
+"  </module>\n"
+"  \n"
+"  <library-directory>lib</library-directory>\n"
+"\n"
+"</application>\n"
+"]]>"
 
 #. Tag: para
 #: EJB3.xml:200
@@ -973,7 +1221,7 @@
 "Hibernate objects), provide security domain and JMX MBeans that can be used "
 "with this application, etc. You can lear more about the possible attributes "
 "in jboss-app.xml in its DTD: http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd."
-msgstr ""
+msgstr "jboss-app.xml 文件为 EAR 应用程序提供 JBoss 特定的部署配置。例如,它可以指定 EAR 里模块的部署顺序,在 EAR 里部署 JBoss 特定的模块,如 SARs(用于 MBeans 的 Service ARchive)和 HARs(用于 Hibernate 对象的 Hibernate ARchive)、提供安全域和可以用于这个应用程序的 JMX MBean 等等。你可以从 jboss-app.xml 的 DTD: http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd 里学习到它的属性设置的更多信息。"
 
 #. Tag: para
 #: EJB3.xml:202
@@ -988,7 +1236,7 @@
 "persistence unit name to the @PersistenceContext annotation. The following "
 "jboss-app.xml specifies a scoped classloader myapp:archive=myapp.ear for the "
 "EAR application."
-msgstr ""
+msgstr "jboss-app.xml 的一个常用例子就是配置 EAR 文件是否应该部署在作用域为自身的类加载器里以避免和其他应用程序的命名冲突。如果你的 EAR 应用程序部署在作用域为自身的类加载器里且在其 EJB3 JAR 文件里只定义了一个 persistence-unit,你将能够用 @PersistenceContext EntotyManager em 把 EntityManager 注入到 session bean,而不用把 persistence unit 的名字传递到 @PersistenceContext 注解。下面的 jboss-app.xml 为 EAR 应用程序指定了一个作用域为自身的类加载器 myapp:archive=myapp.ear。"
 
 #. Tag: programlisting
 #: EJB3.xml:204
@@ -1002,6 +1250,13 @@
 "</jboss-app>\n"
 "]]>"
 msgstr ""
+"<![CDATA[\n"
+"<jboss-app>\n"
+"      <loader-repository>\n"
+"      myapp:archive=myapp.ear\n"
+"      </loader-repository>\n"
+"</jboss-app>\n"
+"]]>"
 
 #. Tag: para
 #: EJB3.xml:206
@@ -1010,6 +1265,8 @@
 "The EAR deployment is configured by the JBOSS_DIST/server/default/deploy/ear-"
 "deploy.xml file. This file contains three attributes as follows."
 msgstr ""
+"EAR 的部署通过 JBOSS_DIST/server/default/deploy/ear-"
+"deploy.xml 文件进行配置。这个文件包含系列 3 个属性。"
 
 #. Tag: programlisting
 #: EJB3.xml:208
@@ -1045,6 +1302,35 @@
 "</server>\n"
 "]]>"
 msgstr ""
+"<![CDATA[\n"
+"<server>\n"
+"   <mbean code=\"org.jboss.deployment.EARDeployer\"\n"
+"          name=\"jboss.j2ee:service=EARDeployer\">\n"
+"      <!-- \n"
+"          A flag indicating if ear deployments should \n"
+"           have their own scoped class loader to isolate \n"
+"           their classes from other deployments.\n"
+"      -->\n"
+"      <attribute name=\"Isolated\">false</attribute>\n"
+"      \n"
+"      <!-- \n"
+"          A flag indicating if the ear components should \n"
+"          have in VM call optimization disabled.\n"
+"      -->\n"
+"      <attribute name=\"CallByValue\">false</attribute>\n"
+"      \n"
+"      <!-- \n"
+"          A flag the enables the default behavior of \n"
+"          the ee5 library-directory. If true, the lib \n"
+"          contents of an ear are assumed to be the default \n"
+"          value for library-directory in the absence of \n"
+"          an explicit library-directory. If false, there \n"
+"          must be an explicit library-directory.\n"
+"      -->\n"
+"      <attribute name=\"EnablelibDirectoryByDefault\">true</attribute>\n"
+"   </mbean>\n"
+"</server>\n"
+"]]>"
 
 #. Tag: para
 #: EJB3.xml:210
@@ -1062,5 +1348,5 @@
 "JVM. The EnablelibDirectoryByDefault attribute specifies whether the lib "
 "directory in the EAR archive should be the default location for shared "
 "library JARs."
-msgstr ""
+msgstr "如果你把 Isolated 参数设置为 true,所有 EAR 的部署将缺省具有作用域为自身的类加载器。你不需要再在 jboss-app.xml 里定义类加载器。CallByValue 属性指定我们是否应该把所有 EJB 调用都当作远程调用。因为远程调用里涉及的对象必须序列化和解序列化,所以和本地的引用(call-by-reference)调用相比,远程调用会出现很多性能方面的问题。对于我们的大部分应用程序,WAR 和 EJB3 JAR 都部署在相同的服务器上,因此这个值缺省为 false,服务器使用本地引用调用来调用相同 JVM 里的 EJB 方法。EnablelibDirectoryByDefault 属性指定 EAR 归档里的 lib 目录是否为共享 JAR 库文件的缺省位置。"
 




More information about the jboss-cvs-commits mailing list