[jboss-cvs] JBossAS SVN: r75092 - projects/docs/enterprise/4.3/Transactions/Programmers_Guide/zh-CN.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jun 26 01:13:00 EDT 2008
Author: xhuang at jboss.com
Date: 2008-06-26 01:13:00 -0400 (Thu, 26 Jun 2008)
New Revision: 75092
Modified:
projects/docs/enterprise/4.3/Transactions/Programmers_Guide/zh-CN/Chapter.po
Log:
update
Modified: projects/docs/enterprise/4.3/Transactions/Programmers_Guide/zh-CN/Chapter.po
===================================================================
--- projects/docs/enterprise/4.3/Transactions/Programmers_Guide/zh-CN/Chapter.po 2008-06-26 05:01:11 UTC (rev 75091)
+++ projects/docs/enterprise/4.3/Transactions/Programmers_Guide/zh-CN/Chapter.po 2008-06-26 05:13:00 UTC (rev 75092)
@@ -8,7 +8,7 @@
"Project-Id-Version: Chapter\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-06-05 22:51+0000\n"
-"PO-Revision-Date: 2008-06-24 15:56+1000\n"
+"PO-Revision-Date: 2008-06-26 15:12+1000\n"
"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
"Language-Team: <en at li.org>\n"
"MIME-Version: 1.0\n"
@@ -134,6 +134,8 @@
"or ASN.1) could be implemented simply by replacing the operations with ones "
"appropriate to the encoding required."
msgstr ""
+"出于几种考虑,<classname>TxCore</classname> 需要记住对象的状态,如恢复(状态表示对象过去的某种状态)和持久性(状态代表应用程序终止时对象的最终状态)。这些要求都具有用相同机制实现的共同功能:<classname>InputObjectState</classname> 和 <classname>OutputObjectState</classname> 类。这些类维护一个内部的数组,其中的标准类型的实例可以持续地用合适的 <command>pack</command> (<command>unpack</"
+"command>) 操作进行处理。如果空间不够的话,缓冲会自动地根据需要调整大小。实例都以标准形式(所谓网络字节顺序)存储在缓冲里,这使得它们可以独立于主机类型。任何其他架构的格式(如 XDR 或 ASN.1)都可以简单地实现,只要用满足编码要求的操作替换相应的操作就可以了。"
#. Tag: title
#: Chapter.xml:43
@@ -152,7 +154,7 @@
"write object states to the local file system or database, and remote "
"implementations, where the interface uses a client stub (proxy) to remote "
"services."
-msgstr ""
+msgstr "Java SecurityManager 强加的限制可能影响持久性的实现。因此,<classname>TxCore</classname> 提供的 object store 使用接口技术来实现。目前的发行版本包含的实现把对象状态写入到本地文件系统或数据库里,而其远程实现则通过接口使用一个客户端 stub(代理)访问远程服务。"
#. Tag: para
#: Chapter.xml:47
@@ -163,13 +165,13 @@
"object store. States are read using the <literal>read_committed</literal> "
"operation and written by the <literal>write_(un)committed</literal> "
"operations."
-msgstr ""
+msgstr "持久性对象在创建时被分配一个唯一的标识符(UID 类的实例),这被用来在 Object Store 内部进行标识。状态的读写分别通过 <literal>read_committed</literal> 和 <literal>write_(un)committed</literal> 操作进行。"
#. Tag: title
#: Chapter.xml:53
#, no-c-format
msgid "Recovery and persistence"
-msgstr ""
+msgstr "恢复和持久化"
#. Tag: para
#: Chapter.xml:54
@@ -179,6 +181,8 @@
"classname>. This class is responsible for object activation and deactivation "
"and object recovery. The simplified signature of the class is:"
msgstr ""
+"类层次结构的根部是 <classname>StateManager</"
+"classname> 类。这个类负责激活和取消激活对象以及恢复对象。它的简化签名是:"
#. Tag: screen
#: Chapter.xml:56
@@ -200,6 +204,21 @@
" protected StateManager (Uid id);\n"
"};"
msgstr ""
+"public abstract class StateManager\n"
+"{\n"
+" public boolean activate ();\n"
+" public boolean deactivate (boolean commit);\n"
+"\n"
+" public Uid get_uid (); // object’s identifier.\n"
+"\n"
+" // methods to be provided by a derived class\n"
+"\n"
+" public boolean restore_state (InputObjectState os);\n"
+" public boolean save_state (OutputObjectState os);\n"
+"\n"
+" protected StateManager ();\n"
+" protected StateManager (Uid id);\n"
+"};"
#. Tag: para
#: Chapter.xml:58
@@ -218,7 +237,7 @@
"objects may possess none of these capabilities, in which case no recovery "
"information is ever kept nor is object activation/deactivation ever "
"automatically attempted."
-msgstr ""
+msgstr "我们假设对象有 3 种可能的状态。它可能是可恢复的(recoverable),此时 <classname>StateManager</classname> 将试图生成并维护合适的对象恢复信息。这样的对象的生存时间不超过创建它的应用程序。对象也可能是可恢复且持久的(recoverable and persistent),此时它的生存时间将超过创建和访问它的应用程序,所以除了维护恢复信息以外,<classname>StateManager</classname> 还将在适当时候通过调用激活(取消激活)操作来试图加载(卸载)任何现有的持久性状态。最后,对象可能不具有这些能力中的任何一种,此时既不会保持恢复信息也不会自动尝试激活/取消激活对象。"
#. Tag: para
#: Chapter.xml:61
@@ -241,6 +260,10 @@
"<classname>Example</classname> that has integer member variables called A, B "
"and C could simply be:"
msgstr ""
+"如果某个对象是可恢复的(recoverable)或可恢复及持久的(recoverable and persistent),那么<classname>StateManager</classname> 将在应用程序执行过程中的不同时间调用 <command>save_state</command>(执行 <command>deactivate</"
+"command> 时)和 <command>restore_state</command>(执行 activate 时)操作。既然 <classname>StateManager</"
+"classname> 不能够检测用户级别的状态变化,程序员必须实现这些操作。(我们正在考虑自动生成缺省的 <command>save_state</command> 和 "
+"<command>restore_state</command> 操作,并在可以提高效率的情况下允许程序员对其进行覆盖。)这使得程序员能够决定对象状态的哪些部分应该持久化。例如,对于一个电子表格来说,如果某些值只是简单的重复计算结果,你没有必要存储所有的条目。具有整型成员变量 A、B 和 C 的 <classname>Example</classname> 类的 <command>save_state</command> 实现可以仅仅是:"
#. Tag: screen
#: Chapter.xml:63
@@ -265,6 +288,24 @@
" return true;\n"
"}"
msgstr ""
+"public boolean save_state(OutputObjectState o)\n"
+"{\n"
+" if (!super.save_state(o))\n"
+" return false;\n"
+" \n"
+" try\n"
+" {\n"
+" o.packInt(A);\n"
+" o.packInt(B);\n"
+" o.packInt(C));\n"
+" }\n"
+" catch (Exception e)\n"
+" {\n"
+" return false;\n"
+" }\n"
+" \n"
+" return true;\n"
+"}"
#. Tag: para
#: Chapter.xml:65
@@ -284,7 +325,7 @@
"classname>) operation at appropriate times. Finally, objects may possess "
"none of these capabilities, in which case no recovery information is ever "
"kept nor is object activation/deactivation ever automatically attempted."
-msgstr ""
+msgstr "我们假设对象有 3 种可能的状态。它可能是可恢复的(recoverable),此时 <classname>StateManager</classname> 将试图生成并维护合适的对象恢复信息。这样的对象的生存时间不超过创建它的应用程序。对象也可能是可恢复且持久的(recoverable and persistent),此时它的生存时间将超过创建和访问它的应用程序,所以除了维护恢复信息以外,<classname>StateManager</classname> 还将在适当时候通过调用激活(取消激活)操作来试图加载(卸载)任何现有的持久性状态。最后,对象可能不具有这些能力中的任何一种,此时既不会保持恢复信息也不会自动尝试激活/取消激活对象。"
#. Tag: para
#: Chapter.xml:67
@@ -308,6 +349,11 @@
"<classname>Example</classname> that has integer member variables called A, B "
"and C could simply be:"
msgstr ""
+"如果某个对象是可恢复的(<emphasis>recoverable</emphasis>)或可恢复及持久的(<emphasis>recoverable "
+"and persistent</emphasis>),那么<classname>StateManager</classname> 将在应用程序执行过程中的不同时间调用 <command>save_state</command>(执行 <command>deactivate</"
+"command> 时)和 <command>restore_state</command>(执行 <command>activate</command> 时)操作。既然 <classname>StateManager</"
+"classname> 不能够检测用户级别的状态变化,程序员必须实现这些操作。(我们正在考虑自动生成缺省的 <command>save_state</command> 和 "
+"<command>restore_state</command> 操作,并在可以提高效率的情况下允许程序员对其进行覆盖。)这使得程序员能够决定对象状态的哪些部分应该持久化。例如,对于一个电子表格来说,如果某些值只是简单的重复计算结果,你没有必要存储所有的条目。具有整型成员变量 A、B 和 C 的 <classname>Example</classname> 类的 <command>save_state</command> 实现可以仅仅是:"
#. Tag: screen
#: Chapter.xml:69
@@ -332,6 +378,24 @@
"return true;\n"
"}"
msgstr ""
+"public boolean save_state(OutputObjectState o)\n"
+"{\n"
+" if (!super.save_state(o))\n"
+" return false;\n"
+" \n"
+" try\n"
+" {\n"
+" o.packInt(A);\n"
+" o.packInt(B);\n"
+" o.packInt(C));\n"
+" }\n"
+" catch (Exception e)\n"
+" {\n"
+" return false;\n"
+" }\n"
+" \n"
+"return true;\n"
+"}"
#. Tag: para
#: Chapter.xml:70
@@ -342,12 +406,15 @@
"</classname>and <classname>super.restore_state</classname>. This is to cater "
"for improvements in the crash recovery mechanisms."
msgstr ""
+"所有的 <command>save_state</command> 和 "
+"<command>restore_state</command> 方法都有必要调用 <classname>super.save_state "
+"</classname> 和 <classname>super.restore_state</classname>。这是为了顾及崩溃恢复机制里的性能问题。"
#. Tag: title
#: Chapter.xml:74
#, no-c-format
msgid "The life-cycle of a Transactional Object for Java"
-msgstr ""
+msgstr "Transactional Object for Java 的生命周期"
#. Tag: para
#: Chapter.xml:76
@@ -359,12 +426,15 @@
"persistent object in <emphasis>TXOJ</emphasis> is shown in <xref linkend="
"\"figure_2\"/>."
msgstr ""
+"我们假定未使用的持久性对象保持 <emphasis>passive</"
+"emphasis> 状态且状态保留在 object store 里,需要时可转换成 <emphasis>activated</emphasis> 状态。<xref linkend="
+"\"figure_2\"/> 里展示了 <emphasis>TXOJ</emphasis> 里的持久性对象的基本生命周期。"
#. Tag: caption
#: Chapter.xml:82
#, no-c-format
msgid "The lifecycle of a persistent object."
-msgstr ""
+msgstr "持久性对象的生命周期。"
#. Tag: para
#: Chapter.xml:86
@@ -372,7 +442,7 @@
msgid ""
"The object is initially passive, and is stored in the object store as an "
"instance of the class <classname>OutputObjectState</classname>."
-msgstr ""
+msgstr "对象的状态初始时为 passive,作为 <classname>OutputObjectState</classname> 类的实例保存在 object store 里。"
#. Tag: para
#: Chapter.xml:87
@@ -384,6 +454,8 @@
"classname> instance into a fully-fledged object by the "
"<command>restore_state</command> operation of the object."
msgstr ""
+"当应用程序需要时,<command>read_committed</command> 操作从 Object Store 里读取对象并自动激活它,且通过 <command>restore_state</command> 操作从 <classname>InputObjectState</"
+"classname> 实例转换成 fully-fledged 对象。"
#. Tag: para
#: Chapter.xml:88
@@ -398,7 +470,7 @@
"normally hidden from the programmer by the transaction system. Object de-"
"activation normally only occurs when the top-level transaction within which "
"the object was activated commits."
-msgstr ""
+msgstr "当应用程序已经结束运行,它用 <command>save_state</command> 操作将对象转换成 <classname>OutputObjectState</classname> 实例来取消激活,然后用 write_uncommitted 操作把对象作为影子拷贝(shadow copy)存回到 object store 里。这个影子拷贝可以用 <command>commit_state</command> 操作提交并覆盖前面的版本。事务系统通常向程序于隐藏现有的影子拷贝。对象的取消激活通常只在激活对象的顶级事务提交时才发生。"
#. Tag: para
#: Chapter.xml:91
@@ -406,13 +478,13 @@
msgid ""
"During its life time, a persistent object may be made active then passive "
"many times."
-msgstr ""
+msgstr "在其生存期间,持久性对象可以多次被激活和钝化。"
#. Tag: title
#: Chapter.xml:96
#, no-c-format
msgid "The concurrency controller"
-msgstr ""
+msgstr "并行控制器"
#. Tag: para
#: Chapter.xml:98
@@ -426,7 +498,7 @@
"implementations are accessed through interfaces. As well as providing access "
"to remote services, the current implementations of concurrency control "
"available to interfaces include:"
-msgstr ""
+msgstr "<classname>LockManager</classname> 类实现了并行控制器(concurrency controller),它提供智能的缺省行为,但又允许程序员在必要时进行覆盖。和 <classname>StateManager</classname> 和持久性一样,并行控制实现也是通过接口来进行访问。除了提供对远程服务的访问,目前并行控制的实现包括:"
#. Tag: para
#: Chapter.xml:101
@@ -434,7 +506,7 @@
msgid ""
"local disk/database implementation, where locks are made persistent by being "
"written to the local file system or database."
-msgstr ""
+msgstr "本地磁盘/数据库实现,通过写入本地文件系统或数据库使锁持久化。"
#. Tag: para
#: Chapter.xml:102
@@ -445,7 +517,7 @@
"performance than when writing locks to the local disk, but objects cannot be "
"shared between virtual machines. Importantly, it is a basic Java object with "
"no requirements which can be affected by the SecurityManager"
-msgstr ""
+msgstr "纯本地实现,锁在创建它的虚拟机的内存里进行维护。和写入本地磁盘相比,这个实现具有更好的性能,但对象不能在虚拟机之间共享。重要的是,这是一个基本的 Java 对象,它不具备 SecurityManager 能影响的需求。"
#. Tag: para
#: Chapter.xml:105
@@ -458,7 +530,7 @@
"the <classname>Lock</classname> class it is possible for programmers to "
"provide their own lock implementations with different lock conflict rules to "
"enable <firstterm>type specific concurrency control</firstterm>."
-msgstr ""
+msgstr "并行控制器的主要编程接口是通过 setlock 操作来实现。在缺省情况下,对每个对象,运行系统在多个 reader、单一 writer 策略之后,都强制严格的两阶段锁定。然而,如 <xref linkend=\"figure_1\"/> 所示,通过继承 <classname>Lock</classname> 类,程序员有可能提供自己的锁实现以及不同的锁冲突规则来启用<firstterm>类型专有的并行控制(type specific concurrency control)</firstterm>。"
#. Tag: para
#: Chapter.xml:107
@@ -471,7 +543,7 @@
"control of the system and requires no further intervention by the "
"programmer. This ensures that the two-phase property can be correctly "
"maintained."
-msgstr ""
+msgstr "既然 <classname>StateManager</classname> 不能决定某个操作是否修改了对象,<classname>LockManager</classname> 不能决定某个操作是否要求读或写锁,程序员需要控制对锁的获取。然而,锁的释放是由系统控制的,且不需要程序员的进一步干预。这确保可以维护正确的两阶段的属性。"
#. Tag: screen
#: Chapter.xml:109
@@ -482,6 +554,10 @@
" public LockResult setlock (Lock toSet, int retry, int timeout);\n"
"};"
msgstr ""
+"public abstract class LockManager extends StateManager\n"
+"{\n"
+" public LockResult setlock (Lock toSet, int retry, int timeout);\n"
+"};"
#. Tag: para
#: Chapter.xml:111
@@ -497,12 +573,14 @@
"if the object is recoverable. In a similar fashion, successful lock "
"acquisition causes activate to be invoked."
msgstr ""
+"<classname>LockManager</classname> 类主要负责管理为对象设置锁的请求或者酌情释放锁。然而,既然它来源于 <classname>StateManager</"
+"classname>,它也可以控制是否调用某些继承的功能。例如,<classname>LockManager</classname> 假定写锁的设定暗示着调用操作必须修改对象。反过来如果对象是可恢复的,这会导致对恢复信息的保存。类似地,对锁的成功获取导致激活操作的调用。"
#. Tag: para
#: Chapter.xml:113
#, no-c-format
msgid "The code below shows how we may try to obtain a write lock on an object:"
-msgstr ""
+msgstr "下面的代码展示了我们如何获取对象的写锁:"
#. Tag: screen
#: Chapter.xml:115
@@ -538,12 +616,41 @@
"}\n"
"}"
msgstr ""
+"public class Example extends LockManager\n"
+"{\n"
+"public boolean foobar ()\n"
+"{\n"
+" AtomicAction A = new AtomicAction;\n"
+" boolean result = false;\n"
+" \n"
+" A.begin();\n"
+" \n"
+" if (setlock(new Lock(LockMode.WRITE), 0) == Lock.GRANTED)\n"
+" {\n"
+" /*\n"
+" * Do some work, and TXOJ will\n"
+" * guarantee ACID properties.\n"
+" */\n"
+" \n"
+" // automatically aborts if fails\n"
+" \n"
+" if (A.commit() == AtomicAction.COMMITTED)\n"
+" {\n"
+" result = true;\n"
+" }\n"
+" }\n"
+" else\n"
+" A.rollback();\n"
+" \n"
+" return result;\n"
+"}\n"
+"}"
#. Tag: title
#: Chapter.xml:120
#, no-c-format
msgid "The transaction protocol engine"
-msgstr ""
+msgstr "事务协议引擎"
#. Tag: para
#: Chapter.xml:122
@@ -559,7 +666,7 @@
"transaction. Because <emphasis>TxCore</emphasis> supports subtransactions, "
"if a transaction is begun within the scope of an already executing "
"transaction it will automatically be nested."
-msgstr ""
+msgstr "事务协议引擎(transaction protocol engine)由 <classname>AtomicAction</classname> 类代表,它使用 <classname>StateManager</classname> 为崩溃恢复机制记录足够的信息以便在发生故障时完成事务。它具有启动和终止事务的方法,以及在程序员需要实现自己的资源时向当前事务注册的方法。因为 <emphasis>TxCore</emphasis> 支持子事务,如果事务以已经运行的事务的作用域开始,那么它将自动地进行嵌套。"
#. Tag: para
#: Chapter.xml:124
@@ -569,13 +676,13 @@
"within an application to share a transaction or execute within its own "
"transaction. Therefore, all <emphasis>TxCore</emphasis> classes are also "
"thread safe."
-msgstr ""
+msgstr "<emphasis>TxCore</emphasis> 可识别多线程,它允许应用程序里的每个线程共享一个事务或者在自己的事务里运行。因此,所有的 <emphasis>TxCore</emphasis> 类也线程安全的(thread safe)。"
#. Tag: title
#: Chapter.xml:128
#, no-c-format
msgid "Example"
-msgstr ""
+msgstr "示例"
#. Tag: para
#: Chapter.xml:130
@@ -583,7 +690,7 @@
msgid ""
"The simple example below illustrates the relationships between activation, "
"termination and commitment:"
-msgstr ""
+msgstr "下面这个简单的示例演示了激活(activation)、终止(termination)和提交(commitment)之间的关系:"
#. Tag: screen
#: Chapter.xml:132
@@ -606,6 +713,22 @@
"deactivated */\n"
" } /* (v) */"
msgstr ""
+"{\n"
+" . . .\n"
+" O1 objct1 = new objct1(Name-A);/* (i) bind to \"old\" persistent object "
+"A */\n"
+" O2 objct2 = new objct2(); /* create a \"new\" persistent object "
+"*/\n"
+" OTS.current().begin(); /* (ii) start of atomic action "
+"*/\n"
+" \n"
+" objct1.op(...); /* (iii) object activation and "
+"invocations */\n"
+" objct2.op(...);\n"
+" . . .\n"
+" OTS.current().commit(true); /* (iv) tx commits & objects "
+"deactivated */\n"
+" } /* (v) */"
#. Tag: para
#: Chapter.xml:134
@@ -613,7 +736,7 @@
msgid ""
"The execution of the above code involves the following sequence of "
"activities:"
-msgstr ""
+msgstr "上面代码的执行涉及了下面的活动序列:"
#. Tag: para
#: Chapter.xml:137
@@ -626,12 +749,14 @@
"maintains the mapping between object names and locations and is described in "
"a later chapter."
msgstr ""
+"创建对持久性对象绑定;这可能涉及 stub 对象的创建以及对远程对象的调用。在上面的例子里,我们重新绑定了一个现有的持久性对象 <literal>Name-A</"
+"literal> 和一个新的持久性对象。远程对象的命名系统维护着对象名和位置的映射,我们在后面的章节里将进行介绍。"
#. Tag: para
#: Chapter.xml:138
#, no-c-format
msgid "Start of the atomic transaction."
-msgstr ""
+msgstr "原子事务的启动。"
#. Tag: para
#: Chapter.xml:139
@@ -643,7 +768,7 @@
"latest committed state from the object store. The first time a lock is "
"acquired on an object within a transaction the object’s state is acquired, "
"if possible, from the object store."
-msgstr ""
+msgstr "操作调用: 作为给定调用的一部分,对象实现负责确保它在读或写模式下(假设没有锁突)被锁定并初始化,如果必要的话,使用 Object Store 里最新提交的状态。锁在事务里第一次被获取时,如果可能的话,对象的状态将从 Object Store 里获得。"
#. Tag: para
#: Chapter.xml:140
@@ -651,19 +776,19 @@
msgid ""
"Commit of the top-level action. This includes updating of the state of any "
"modified objects in the object store."
-msgstr ""
+msgstr "顶层动作的提交。这包括更新 Object Store 里任何被修改的对象的状态。"
#. Tag: para
#: Chapter.xml:141
#, no-c-format
msgid "Breaking of the previously created bindings."
-msgstr ""
+msgstr "破坏之前创建的绑定。"
#. Tag: title
#: Chapter.xml:147
#, no-c-format
msgid "The class hierarchy"
-msgstr ""
+msgstr "类层次结构"
#. Tag: para
#: Chapter.xml:149
@@ -672,6 +797,8 @@
"The principal classes which make up the class hierarchy of <emphasis>TxCore</"
"emphasis> are depicted below."
msgstr ""
+"下面是组成 <emphasis>TxCore</"
+"emphasis> 的类层次结构主要的类。"
#. Tag: screen
#: Chapter.xml:151
@@ -702,6 +829,30 @@
" ObjectStore // Interface to the "
"object storage services"
msgstr ""
+"StateManager // Basic naming, persistence and recovery "
+"control\n"
+" LockManager // Basic two-phase locking "
+"concurrency control service\n"
+" User-Defined Classes\n"
+" Lock // Standard lock type for "
+"multiple readers/single writer\n"
+" User-Defined Lock Classes\n"
+" AbstractRecord // Important utility class, "
+"similar to Resource\n"
+" RecoveryRecord // handles object "
+"recovery\n"
+" LockRecord // handles object locking\n"
+" RecordList // Intentions list\n"
+" other management record types\n"
+" AtomicAction // Implements transaction "
+"control abstraction\n"
+" TopLevelTransaction\n"
+" Input/OutputBuffer // Architecture neutral representation of "
+"an objects’ state\n"
+" Input/OutputObjectState // Convenient interface "
+"to Buffer\n"
+" ObjectStore // Interface to the "
+"object storage services"
#. Tag: para
#: Chapter.xml:153
@@ -723,6 +874,10 @@
"action facilities is supported by <classname>AtomicAction</classname> and "
"<classname>TopLevelTransaction</classname>."
msgstr ""
+"编写容错应用程序的程序员将主要关心 <classname>LockManager</classname>、 <classname>Lock</classname> 和 <classname>AtomicAction</classname> 类。对于程序员来说,其他重要的类是 <classname>Uid</classname> 和 <classname>ObjectState</"
+"classname>。大多数 <emphasis>TxCore</emphasis> 系统类都源自基类 <classname>StateManager</classname>,它为管理持久的和可恢复的对象提供必要的原始功能。这些功能包括对对象激活和取消激活的支持,以及基于状态的对象恢复。<classname>LockManager</"
+"classname> 类使用 <classname>StateManager</classname> 的功能并提供实现原子动作的 serialisability 属性所需的并行控制(当前实现里的两阶段锁定)。<classname>AtomicAction</classname> 和 "
+"<classname>TopLevelTransaction</classname> 支持对原子动作的实现。"
#. Tag: para
#: Chapter.xml:155
@@ -737,6 +892,8 @@
"provides the concurrency control required for implementing the "
"serialisability property of atomic actions."
msgstr ""
+"大多数 <emphasis>TxCore</emphasis> 系统类都源自基类 <classname>StateManager</classname>,它为管理持久的和可恢复的对象提供必要的原始功能。这些功能包括对对象激活和取消激活的支持,以及基于状态的对象恢复。<classname>LockManager</"
+"classname> 类使用 <classname>StateManager</classname> 的功能并提供实现原子动作的 serialisability 属性所需的并行控制。"
#. Tag: para
#: Chapter.xml:157
@@ -751,6 +908,8 @@
"O before it is modified; thus the body of op1 should contain a call to the "
"<literal>setlock</literal> operation of the concurrency controller:"
msgstr ""
+"让我们看一个简单的例子。假设 <classname>Example</classname> 是一个用户定义的、源自 <classname>LockManager</classname> 的持久性对象。包含原子事务(Trans)的应用程序通过调用 op1 操作(涉及对象 O 的状态改变)访问类型为 <classname>Example</"
+"classname> 的对象(称为 O)。serialisability 属性要求在对对象 O 进行修改之前,必须获取它的写锁;因此 op1 的内容必须包含对并行控制器的 <literal>setlock</literal> 操作的调用。"
#. Tag: screen
#: Chapter.xml:159
@@ -765,6 +924,14 @@
" }\n"
"}"
msgstr ""
+"public boolean op1 (...)\n"
+"{ \n"
+" if (setlock (new Lock(LockMode.WRITE) == LockResult.GRANTED)\n"
+" {\n"
+" // actual state change operations follow \n"
+" ...\n"
+" }\n"
+"}"
#. Tag: para
#: Chapter.xml:161
@@ -773,13 +940,13 @@
"The operation <literal>setlock</literal>, provided by the "
"<classname>LockManager</classname> class, performs the following functions "
"in this case:"
-msgstr ""
+msgstr "在这里,<classname>LockManager</classname> 类提供的 <literal>setlock</literal> 操作执行下面的功能:"
#. Tag: para
#: Chapter.xml:164
#, no-c-format
msgid "Check write lock compatibility with the currently held locks, and if allowed:"
-msgstr ""
+msgstr "检查写锁和当前持有的锁的兼容性,如果允许的话:"
#. Tag: para
#: Chapter.xml:165
@@ -795,12 +962,14 @@
"retained prior to modification) and inserting it into the "
"<classname>RecordList</classname> of <classname>Trans</classname>."
msgstr ""
+"调用 <classname>StateManager</classname> 的 activate 操作,如果还没完成的话,这将从 Object Store 载入 O 的最新持久性状态。然后调用 <classname>StateManager</classname> 的 modified 操作,它将影响为 O 创建的 <classname>RecoveryRecord</classname> 或 <classname>PersistenceRecord</"
+"classname> 的实例并将其插入到 <classname>Trans</classname> 的 <classname>RecordList</classname> 里,这取决于 O 是否是持久的(锁是 <literal>WRITE</literal> 锁,所以在修改前必须获取对象的旧的状态)。"
#. Tag: para
#: Chapter.xml:166
#, no-c-format
msgid "Create and insert a LockRecord instance in the RecordList of Trans."
-msgstr ""
+msgstr "创建并在 Trans 的 RecordList 里插入一个 LockRecord 实例。"
#. Tag: para
#: Chapter.xml:169
@@ -816,6 +985,9 @@
"<classname>RecoveryRecord</classname>/<classname>PersistenceRecord</"
"classname> will restore the prior state of O."
msgstr ""
+"现在假设在已经获取了锁以后,动作 <literal>Trans</literal> 在某个时间被取消了。<classname>AtomicAction</classname> 的 rollback 操作将在不同记录上调用合适的 <literal>Abort</literal> 操作来处理和 <literal>Trans</literal> 关联的 <classname>RecordList</"
+"classname> 实例。这个操作的实现 <classname>LockRecord</classname> 将释放 <literal>WRITE</literal> 锁,而 <classname>RecoveryRecord</classname>/<classname>PersistenceRecord</"
+"classname> 的实现将恢复 O 以前的状态。"
#. Tag: para
#: Chapter.xml:171
@@ -828,4 +1000,6 @@
"Objects for Java</emphasis> take care of participant registration, "
"persistence, concurrency control and recovery."
msgstr ""
+"明白上面所有的工作都是由 <emphasis>TxCore</emphasis> 代表应用程序程序员自动执行是很重要的。程序员只需要启动事务并设置一个合适的锁:<emphasis>TxCore</emphasis> and <emphasis>Transactional "
+"Objects for Java</emphasis> 将负责参与者的注册、持久化、并行控制和恢复。"
More information about the jboss-cvs-commits
mailing list