[jboss-cvs] JBossAS SVN: r84293 - projects/docs/enterprise/4.3.3/Server_Configuration_Guide/zh-CN.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Feb 17 01:07:47 EST 2009


Author: xhuang at jboss.com
Date: 2009-02-17 01:07:47 -0500 (Tue, 17 Feb 2009)
New Revision: 84293

Modified:
   projects/docs/enterprise/4.3.3/Server_Configuration_Guide/zh-CN/EJB3.po
Log:
update

Modified: projects/docs/enterprise/4.3.3/Server_Configuration_Guide/zh-CN/EJB3.po
===================================================================
--- projects/docs/enterprise/4.3.3/Server_Configuration_Guide/zh-CN/EJB3.po	2009-02-17 06:07:03 UTC (rev 84292)
+++ projects/docs/enterprise/4.3.3/Server_Configuration_Guide/zh-CN/EJB3.po	2009-02-17 06:07:47 UTC (rev 84293)
@@ -1,24 +1,27 @@
+# translation of EJB3.po to
 # Language /tmp/mike/JBEAP420/JBAS translations for JBEAP package.
-# Copyright (C) 2007 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+#
 # Automatically generated, 2007.
-#
+# Xi HUANG <xhuang at redhat.com>, 2009.
 msgid ""
 msgstr ""
-"Project-Id-Version: JBEAP 420\n"
+"Project-Id-Version: EJB3\n"
 "Report-Msgid-Bugs-To: http://bugs.kde.org\n"
 "POT-Creation-Date: 2009-01-20 02:37+0000\n"
-"PO-Revision-Date: 2001-02-09 01:25+0100\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: none\n"
+"PO-Revision-Date: 2009-02-17 16:07+1000\n"
+"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
+"Language-Team:  <en 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
 #: EJB3.xml:6
 #, no-c-format
 msgid "Enterprise Applications with EJB3 Services"
-msgstr ""
+msgstr "带有 EJB3 服务的企业级应用程序"
 
 #. Tag: para
 #: EJB3.xml:10
@@ -35,13 +38,13 @@
 "by its name, and then you can call its methods with all configured container "
 "services applied. You can get access to an EJB3 bean from either inside or "
 "outside of the J2EE container."
-msgstr ""
+msgstr "EJB3 (Enterprise JavaBean 3.0) 为 Java EE 5 应用程序提供核心组件模型。EJB2 Bean 是一个受管组件,它自动利用 J2EE 服务器容器所提供的所有服务,如事务、安全性、持久性、命名服务、依赖性注入等。受管组件允许开发人员专注于商业逻辑,而通过配置把其他事情交由容器管理。作为开发人员,你不需要自己来创建或销毁组件。你只需要根据名字从 Java EE 容器请求 EJB3 Bean,然后你可以调用其方法来访问配置好的容器服务。你可以从 J2EE 容器内部或外部访问 EJB3 bean。"
 
 #. Tag: para
 #: EJB3.xml:12
 #, no-c-format
 msgid "&JBPAPP; &VER; supports EJB3 out of the box."
-msgstr ""
+msgstr "&JBPAPP; &VER; 缺省支持 EJB3。"
 
 #. Tag: para
 #: EJB3.xml:14
@@ -52,7 +55,7 @@
 "standard and hence they are the same for all Java EE 5 compliant application "
 "servers. Interested readers should refer to the EJB3 specification or "
 "numerous EJB3 books to learn more about EJB3 programming."
-msgstr ""
+msgstr "EJB3 组件编程模型的细节超出了本书的范畴。大多数 EJB3 接口和注解都是 Java EE 5 标准的一部分,所有对于所有 Java EE 5 兼容的应用服务器来说它们都是相同的。感兴趣的读者应该参考 EJB3 规格或其他 EJB3 书籍来获得更多关于 EJB3 编程的信息。"
 
 #. Tag: para
 #: EJB3.xml:16
@@ -63,13 +66,13 @@
 "EJB3 components inside the JBoss AS, the optional configurations for the "
 "Hibernate persistence engine for entity beans, as well as custom options in "
 "the JBoss EJB3 deployer."
-msgstr ""
+msgstr "在本章里,我们只涵盖 JBoss AS 专有的 EJB3 配置。例如,我们讨论 JBoss AS 里 EJB3 组件的 JNDI 命名规则,用于 entity bean 的 Hibernate 持久化引擎的可选配置,以及 JBoss EJB3 部署者里的自定义选项。"
 
 #. Tag: title
 #: EJB3.xml:19
-#, fuzzy, no-c-format
+#, no-c-format
 msgid "Session Beans"
-msgstr "JBoss XMBeans"
+msgstr "Session Bean"
 
 #. Tag: para
 #: EJB3.xml:21
@@ -78,7 +81,7 @@
 "Session beans are widely used to provide transactional services for local "
 "and remote clients. To write a session bean, you need an interface and an "
 "implementation class."
-msgstr ""
+msgstr "Session bean 被广泛使用来为本地和远程客户提供事务性服务。要编写 session bean,你需要一个接口及其实现类。"
 
 #. Tag: programlisting
 #: EJB3.xml:23
@@ -100,6 +103,21 @@
 "}    \n"
 "]]>"
 msgstr ""
+"<![CDATA[\n"
+"@Local\n"
+"public interface MyBeanInt {\n"
+"  public String doSomething (String para1, int para2);\n"
+"}\n"
+"\n"
+"@Stateless\n"
+"public class MyBean implements MyBeanInt {\n"
+"\n"
+"  public String doSomething (String para1, int para2) {\n"
+"    ... implement the logic ...\n"
+"  } \n"
+"  \n"
+"}    \n"
+"]]>"
 
 #. Tag: para
 #: EJB3.xml:25
@@ -115,7 +133,7 @@
 "e., clients outside of the current JVM for the server), the session bean can "
 "be local or remote. All these are configurable via standard annotations on "
 "the beans."
-msgstr ""
+msgstr "当你调用一个 session bean 方法时,方法的执行自动由服务器里的事务管理者和安全性管理者来管理。你可以用方法上的注解指定每个方法的事务性或安全性属性。Session bean 实例可以被许多客户所重用。根据服务器是否维护 bean 在两个客户端之间的内部状态,Session bean 可以分为无状态的(stateless)或有状态的(stateful)。根据 bean 是否能为远程客户(如当前服务器里 JVM 之外的客户)所用,session bean 可以分为本地的(local)或远程的(remote)。所有这些都可以通过 bean 上的标准注解来进行配置。"
 
 #. Tag: para
 #: EJB3.xml:27
@@ -126,7 +144,7 @@
 "asks the server for a reference of an existing instance managed by the "
 "server. That is done via JNDI. In JBoss AS, the default local JNDI name for "
 "a session bean is dependent on the deployment packaging of the bean class."
-msgstr ""
+msgstr "在你定义了 session bean 以后,客户怎样才能访问它呢?如我们所讨论的,客户端不需要创建或销毁 EJB3 组件,它只要向服务器请求一个受管的现有实例的引用就可以了。这是通过 JNDI 来完成的。在 JBoss AS 里,session bean 的缺省本地 JNDI 名称取决于该 bean 类的部署包。"
 
 #. Tag: para
 #: EJB3.xml:30
@@ -139,6 +157,9 @@
 "JNDI in JBoss AS means that the JNDI name is relative to <varname>java:comp/"
 "env/</varname>."
 msgstr ""
+"如果该 bean 部署在 <varname>jboss-as/"
+"production/deploy</varname> 下的一个标准的 JAR 文件里,它可以通过本地 JNDI 名 <varname>MyBean/local</varname> 来访问,这里的 <varname>MyBean</varname> 是我们在前面描述的实现类的名字。JBoss AS 里的“本地”JNDI 表示这个 JNDI 名字是相对于 <varname>java:comp/"
+"env/</varname> 的。"
 
 #. Tag: para
 #: EJB3.xml:31
@@ -148,7 +169,7 @@
 "JNDI name for the bean is <varname>myapp/MyBean/local</varname>, where "
 "<varname>myapp</varname> is the root name of the EAR archive file (e.g., "
 "<varname>myapp.ear</varname>, see later for the EAR packaging of EJB3 beans)."
-msgstr ""
+msgstr "如果包含这个 bean 的 JAR 文件打包在一个 EAR 里,本地的 JNDI 名字就是 <varname>myapp/MyBean/local</varname>,这里的 <varname>myapp</varname> 是 EAR 归档文件的根名称(如 <varname>myapp.ear</varname>,请参考后面把 EJB3 bean 打包为 EAR 的内容)。"
 
 #. Tag: para
 #: EJB3.xml:34
@@ -160,7 +181,7 @@
 "is the code snippet to get a reference of the MyBean bean in a web "
 "application (e.g., in a servlet or a JSF backing bean) packaged in "
 "<varname>myapp.ear</varname>, and then invoke a managed method."
-msgstr ""
+msgstr "当然,如果这个 bean 接口通过 <varname>@Remote</varname> 注解且它由部署的服务器外部来访问,你应该把 <varname>local</varname> 修改为 <varname>remote</varname>。下面的代码片段在 <varname>myapp.ear</varname> 里的 web 应用程序(如 servelet 或 JSF bacing bean)里获得 MyBean bean 的一个引用,并调用一个受管方法。"
 
 #. Tag: programlisting
 #: EJB3.xml:36
@@ -181,6 +202,20 @@
 "... ...\n"
 "]]>"
 msgstr ""
+"<![CDATA[\n"
+"try {\n"
+"  InitialContext ctx = new InitialContext();\n"
+"  MyBeanInt bean = (MyBeanInt) ctx.lookup(\"myapp/MyBean/local\");\n"
+"} catch (Exception e) {\n"
+"  e.printStackTrace ();\n"
+"}\n"
+"\n"
+"... ...\n"
+"\n"
+"String result = bean.doSomething(\"have fun\", 1);\n"
+"\n"
+"... ...\n"
+"]]>"
 
 #. Tag: para
 #: EJB3.xml:38
@@ -189,7 +224,7 @@
 "What the client gets from the JNDI is essentially a \"stub\" or \"proxy\" of "
 "the bean instance. When the client invokes a method, the proxy figures out "
 "how to route the request to the server and marshal together the response."
-msgstr ""
+msgstr "客户端从 JNDI 里获得的只是 bean 实例的一个\"stub\" 或“代理(proxy)”。当客户端调用方法时,代理将把请求转发到服务器并对响应进行整理。"
 
 #. Tag: para
 #: EJB3.xml:40
@@ -201,7 +236,7 @@
 "\"local\" under the <varname>java:comp/env/</varname> space. For instance, "
 "the following bean class definition results in the bean instances available "
 "under JNDI name <varname>java:comp/env/MyService/MyOwnName</varname>."
-msgstr ""
+msgstr "如果你不喜欢缺省的 JNDI 名称,你可以通过实例类上的 <varname>@LocalBinding</varname> 注解指定自己的 JNDI 绑定。JNDI 绑定总是基于 <varname>java:comp/env/</varname> 空间下的“本地的”。例如,下面的 bean 类的定义使其实例绑定到 JNDI 名称 <varname>java:comp/env/MyService/MyOwnName</varname>。"
 
 #. Tag: programlisting
 #: EJB3.xml:42
@@ -219,12 +254,23 @@
 "}    \n"
 "]]>"
 msgstr ""
+"<![CDATA[\n"
+"@Stateless\n"
+"@LocalBinding (jndiBinding=\"MyService/MyOwnName\")\n"
+"public class MyBean implements MyBeanInt {\n"
+"\n"
+"  public String doSomething (String para1, int para2) {\n"
+"    ... implement the logic ...\n"
+"  } \n"
+"  \n"
+"}    \n"
+"]]>"
 
 #. Tag: title
 #: EJB3.xml:45
 #, no-c-format
 msgid "Injecting EJB3 Beans into the Web Tier"
-msgstr ""
+msgstr "把 EJB3 Bean 注入到 Web 层"
 
 #. Tag: para
 #: EJB3.xml:46
@@ -236,13 +282,13 @@
 "framework called JBoss Seam. JBoss Seam brings 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 还不支持这种行为。但是,&JBPAPP; 提供了一个集成框架 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 Bean(也称为 Java Persistence API)"
 
 #. Tag: para
 #: EJB3.xml:54
@@ -252,7 +298,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
@@ -263,7 +309,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 是映射到关系型数据库表的普通 Java 对象(POJO,Plain Old Java Object)。例如,下面的 entity bean 类映射到名为 customer 的关系型表。这个表有 3 个字段:name、age 和 signupdate。每个 bean 实例都对应表里的一行数据。"
 
 #. Tag: programlisting
 #: EJB3.xml:58
@@ -305,6 +351,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
@@ -319,6 +400,8 @@
 "the Order table, and each record in the Employee table has multiple "
 "corresponding records in the Customer table."
 msgstr ""
+"除了简单的数据属性,entity bean 也可以包含其他带有关系型映射注解 @OneToOne、"
+"@OneToMany、@ManyToMany 等的 entity bean 的引用。这些实体对象的关系将自动设置为数据库里的外键。例如,下面的例子显示了 Customer 表里的每条记录都在 Account 表里有一条对应的记录,并在 Order 表里对应多条记录,而 Employee 表里的每条记录都对应 Customer 表里的多条记录。"
 
 #. Tag: programlisting
 #: EJB3.xml:62
@@ -365,6 +448,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
@@ -374,7 +497,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,你可以创建、更新、删除和查询实体对象。EntityManager 透明地更新底层的数据库表。你可以通过 @PersistenceContext 注解在你的 EJB3 session bean 里获得 EntityManager 对象。"
 
 #. Tag: programlisting
 #: EJB3.xml:66
@@ -401,6 +524,26 @@
 "     \"select c from Customer where c.age > 30\");\n"
 "]]>"
 msgstr ""
+"<![CDATA[\n"
+"@PersistenceContext\n"
+"EntityManager em;\n"
+"\n"
+"Customer customer = new Cutomer ();\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
@@ -410,12 +553,14 @@
 "Interested readers should refer to the JPA documentation or Hibernate "
 "EntityManager documentation."
 msgstr ""
+"EntityManager API 的详细用法超出了本书的范畴。感兴趣的读者应该参考 JPA 文档或 Hibernate "
+"EntityManager 文档。"
 
 #. Tag: title
 #: EJB3.xml:71
-#, fuzzy, no-c-format
+#, no-c-format
 msgid "The persistence.xml file"
-msgstr "server.xml 文件"
+msgstr "persistence.xml 文件"
 
 #. Tag: para
 #: EJB3.xml:73
@@ -426,7 +571,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 是很不错,但服务器怎么知道哪个数据库会保存/更新/查询实体对象?我们怎样才能配置底层的对象-关系-映射引擎和缓存来获得更好的性能并解除故障?persistence.xml 文件可让你灵活地配置 EntityManager。"
 
 #. Tag: para
 #: EJB3.xml:75
@@ -443,6 +588,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 数据库。关于如何设立其他的数据库,请参考 <xref linkend=\"alternative_DBs\"/>。"
 
 #. Tag: programlisting
 #: EJB3.xml:77
@@ -460,12 +608,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
@@ -476,7 +635,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 注解你要注入哪个单元。例如,@PersistenceContext(name=\"myapp\") 从名为 \"myapp\" 的 persistence-unit 注入 EntityManager。"
 
 #. Tag: para
 #: EJB3.xml:82
@@ -486,7 +645,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
@@ -500,7 +659,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 里的 properties 元素可以包含底层持久化提供者的任何配置属性。既然 JBoss AS 把 Hibernate 作为 EJB3 持久化提供者,你可以在这里放入任何 Hibernate 选项。详情请参考 Hibernate 和 Hibernate EntityManager 的相关文档。在这里我们将给出一个例子,把持久化引擎的 SQL 方言设置为 HSQL,并在应用程序启动时通过 entity bean 创建表且在应用程序停止时删除这些表。"
 
 #. Tag: programlisting
 #: EJB3.xml:87
@@ -520,12 +679,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
@@ -539,6 +711,8 @@
 "files for various databases are available in jboss-as/docs/examples/jca "
 "directory in the server."
 msgstr ""
+"要使用其他数据库而不是内嵌的 HSQL 数据库,你首先需要定义该数据库的数据源并注册到 JNDI。这是通过 deploy 目录下的 *-ds.xml 文件完成的。详情请参考 <xref linkend=\"Connectors_on_JBoss-"
+"Configuring_JDBC_DataSources\"/>。用于不同数据库的 *-ds.xml 文件的示例可以在服务器的 jboss-as/docs/examples/jca 目录下找到。"
 
 #. Tag: para
 #: EJB3.xml:96
@@ -547,7 +721,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
@@ -560,49 +734,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 和 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
@@ -617,6 +791,9 @@
 "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-as/server/production/deploy/ejb3.deployer/META-INF/"
+"persistence.properties</varname> 文件里指定。下面是 &JBPAPP; 里附带的 <varname>persistence."
+"properties</varname> 文件。请注意被注释的选项,它们让你知道 <varname>persistence.xml</varname>  文件里的可用属性。"
 
 #. Tag: programlisting
 #: EJB3.xml:116
@@ -645,12 +822,34 @@
 "# I don't think this is honored, but EJB3Deployer uses it\n"
 "hibernate.bytecode.provider=javassist"
 msgstr ""
+"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"
 
 #. Tag: title
 #: EJB3.xml:133
-#, fuzzy, no-c-format
+#, no-c-format
 msgid "Message Driven Beans"
-msgstr "Managed Beans 或 MBeans"
+msgstr "Message Driven Bean"
 
 #. Tag: para
 #: EJB3.xml:135
@@ -666,6 +865,8 @@
 "annotation. The queue is registered under the local JNDI java:comp/env/ name "
 "space."
 msgstr ""
+"Messaging driven bean 是特殊的 EJB3 bean,它通过消息而不是 \"stub\" 的代理方法调用接收服务请求。所以,Messaging driven bean 的关键配置参数是指定侦听的 JMS 消息队列。当队列里没有转入消息时,服务器调用 bean 的 <varname>onMessage()"
+"</varname> 方法并传入消息本身进行处理。Bean 类通过 @MessageDriven 注解指定它侦听的 JMS 队列。这个队列在本地的 JNDI java:comp/env/ 命名空间进行注册。"
 
 #. Tag: programlisting
 #: EJB3.xml:137
@@ -689,6 +890,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
@@ -697,7 +915,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
@@ -723,6 +941,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
@@ -730,13 +967,13 @@
 msgid ""
 "Please refer to the JMS specification or books to learn how to program in "
 "the JMS API."
-msgstr ""
+msgstr "要学习如何使用 JMS API 编程,请参考 JMS 规格或相关书籍。"
 
 #. Tag: title
 #: EJB3.xml:169
 #, no-c-format
 msgid "Package and Deploy EJB3 Services"
-msgstr ""
+msgstr "打包和部署 EJB3 服务"
 
 #. Tag: para
 #: EJB3.xml:171
@@ -749,12 +986,14 @@
 "enterprise application (i.e., in an EAR archive). In this section, we "
 "discuss those two deployment options."
 msgstr ""
+"EJB3 bean 类打包在普通的 JAR 文件里。标准的配置文件,如用于 session bean 的 ejb-jar.xml 和用于 entity bean 的 persistence."
+"xml,位于 JAR 里的 META-INF 目录下。你可以把 EJB3 bean 部署为 JBoss AS 的标准服务,也可以作为企业级应用程序(也就是放入 EAR 归档里)部署。在本节里,我们将讨论这两种部署选项。"
 
 #. Tag: title
 #: EJB3.xml:174
 #, no-c-format
 msgid "Deploy the EJB3 JAR"
-msgstr ""
+msgstr "部署 EJB3 JAR"
 
 #. Tag: para
 #: EJB3.xml:176
@@ -771,6 +1010,10 @@
 "earlier to configure the default behavior of EJB3 entity manager is located "
 "in the EJB3 deployer."
 msgstr ""
+"当你把 JAR 文件部署到 <varname>jboss-as/server/production/deploy/"
+"</varname> 目录下时,服务器将自动识别并进行处理。JAR 文件里定义的所有 EJB3 bean 都将通过 JNDI(如 <varname>MyBean/local</varname>,这里的 <varname>MyBean</"
+"varname> 是 session bean 的实现类)对于服务器内部或外部的其他应用程序可用。部署是通过 jboss-as/server/production/"
+"ejb3.deployer/ 下的 JBoss EJB3 部署者完成的。我们先前讨论的、用于配置 EJB3 entity manager 的缺省行为的 META-INF/persistence.properties 文件位于 EJB3 部署者下面。"
 
 #. Tag: para
 #: EJB3.xml:178
@@ -810,6 +1053,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
@@ -824,7 +1086,7 @@
 #: EJB3.xml:188
 #, no-c-format
 msgid "Deploy EAR with EJB3 JAR"
-msgstr ""
+msgstr "部署带有 EJB3 JAR 的 EAR 文件"
 
 #. Tag: para
 #: EJB3.xml:190
@@ -863,6 +1125,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
@@ -911,6 +1192,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
@@ -952,6 +1252,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
@@ -960,6 +1267,8 @@
 "The EAR deployment is configured by the jboss-as/server/production/deploy/"
 "ear-deploy.xml file. This file contains three attributes as follows."
 msgstr ""
+"jboss-as/server/production/deploy/"
+"ear-deploy.xml 文件配置 EAR 的部署。这个文件包含下列三个属性。"
 
 #. Tag: programlisting
 #: EJB3.xml:208
@@ -995,6 +1304,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
@@ -1013,3 +1351,4 @@
 "directory in the EAR archive should be the default location for shared "
 "library JARs."
 msgstr ""
+




More information about the jboss-cvs-commits mailing list