[jboss-cvs] JBossAS SVN: r77736 - projects/docs/enterprise/4.3/Cache/Cache_FAQ/zh-CN.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Sep 1 02:34:21 EDT 2008


Author: xhuang at jboss.com
Date: 2008-09-01 02:34:21 -0400 (Mon, 01 Sep 2008)
New Revision: 77736

Modified:
   projects/docs/enterprise/4.3/Cache/Cache_FAQ/zh-CN/Cache_Frequently_Asked_Questions.po
Log:
update

Modified: projects/docs/enterprise/4.3/Cache/Cache_FAQ/zh-CN/Cache_Frequently_Asked_Questions.po
===================================================================
--- projects/docs/enterprise/4.3/Cache/Cache_FAQ/zh-CN/Cache_Frequently_Asked_Questions.po	2008-09-01 06:02:37 UTC (rev 77735)
+++ projects/docs/enterprise/4.3/Cache/Cache_FAQ/zh-CN/Cache_Frequently_Asked_Questions.po	2008-09-01 06:34:21 UTC (rev 77736)
@@ -5,13 +5,13 @@
 "Project-Id-Version: Cache_Frequently_Asked_Questions\n"
 "Report-Msgid-Bugs-To: http://bugs.kde.org\n"
 "POT-Creation-Date: 2008-05-30 03:54+0000\n"
-"PO-Revision-Date: 2008-08-28 16:14+1000\n"
+"PO-Revision-Date: 2008-09-01 16:33+1000\n"
 "Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
-"Language-Team:  <en at li.org>\n"
+"Language-Team: Chinese Simplified <kde-i18n-doc at lists.kde.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"
+"X-Generator: KAider 0.1\n"
 "Plural-Forms: nplurals=2; plural=n != 1;\n"
 
 #. Tag: title
@@ -1040,7 +1040,7 @@
 msgid ""
 "Does JBoss Cache handle the concept of application classloading inside, say, "
 "a J2EE container?"
-msgstr ""
+msgstr "JBoss Cache 是否和 J2EE 容器一样具有内部的应用程序类加载机制?"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:898
@@ -1050,7 +1050,7 @@
 "For example, a web application may require a new classloader to scope a "
 "specific version of the user library. However, by default JBoss Cache is "
 "agnostic to the classloader. In general, this leads to two kinds of problems:"
-msgstr ""
+msgstr "J2EE 容器内部广泛地使用了应用程序专有的类加载。例如,web 应用程序可能需要新的类加载器来为特定版本的用户库划定作用域。然而,JBoss Cache 缺省是不使用类加载器的。因为这通常会导致两类问题:"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:907
@@ -1062,7 +1062,7 @@
 "required class. Even if replication doesn't fail, a user thread in cache2 "
 "may not be able to access the object if the user thread is expecting a type "
 "defined by the application classloader."
-msgstr ""
+msgstr "对象实例存储在 cache1 并复制到 cache2。因此,cache2 里的实例由系统类加载器创建。但如果 cache2 里的系统加载器没有对所需类的访问权限,则应用程序可能会运行失败。即使复制没有失败,如果 cache2 里的用户线程没有获得所期望的类加载器定义的类型,它也可能不能访问对象。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:918
@@ -1074,7 +1074,7 @@
 "<literal>ClassCastException</literal> . This is a standard problem in "
 "passing an object from one application space to another; JBossCache just "
 "adds a level of indirection in passing the object."
-msgstr ""
+msgstr "对象实例由 thread1 创建且将被 thread2 访问(使用两个不同的类加载器)。而 JBossCache 没有不同类加载器的标记,所以你会遇到 <literal>ClassCastException</literal>。在把对象从一个应用程序空间传递到另外一个时,这是一个标准的问题。JBossCache 只是在传递对象时添加一个间接层。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:931
@@ -1086,6 +1086,8 @@
 "for use in handling objects replicated to that portion. See the "
 "TreeCacheMarshaller section of the user guide for more details."
 msgstr ""
+"为了解决第一类的问题,我们在 JBoss Cache 1.2.4 里引入了 <literal>TreeCacheMarshaller</literal> 的概念。基本上,这允许应用程序代码在类加载器里注册为缓存树的一部分而只处理该部分的对象复制。"
+"请参考《用户指南》的 TreeCacheMarshaller 部分来获得更多信息。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:941
@@ -1099,7 +1101,7 @@
 "approach is quite severe so in general another local in-vm version will need "
 "to be used as a \"near-line\" cache. Note also that each time the serialized "
 "bytes are deserialized, a new instance of the object is created."
-msgstr ""
+msgstr "要解决第二类的问题,唯一的办法(就我们所知的)就是缓存“序列化”的字节码且只在每次对象 get 时(这样代价很高)才进行解序列。也就是说,在 put 操作中,对象实例将被序列化因此就可以安全地被“外部的”类加载器进行解序列。然而,这种办法的所付出的性能代价相当大,所以通常在本地的虚拟机内的情况下需要用作 \"near-line\" 缓存。请注意,每次对序列化的字节码解序列时,对象的一个新实例将被创建。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:952
@@ -1109,7 +1111,7 @@
 "<literal>MarshalledValue</literal> that wraps around the serialized object. "
 "Here is a code snippet that illustrates how you can create a wrapper around "
 "JBossCache to handle the classloader issue:"
-msgstr ""
+msgstr "为了帮助实现这种处理方式,JBoss 有一个名为 <literal>MarshalledValue</literal> 的工具类,它包裹了被序列化的对象。下面是一个代码片段,它演示了如何创建这个类来处理类加载器的问题:"
 
 #. Tag: programlisting
 #: Cache_Frequently_Asked_Questions.xml:961
@@ -1141,12 +1143,37 @@
 "        }\n"
 "        }"
 msgstr ""
+"import org.jboss.invocation.MarshalledValue;\n"
+"\n"
+"        public class CacheService {\n"
+"        private TreeCache cache_;\n"
+"\n"
+"        public object get(Fqn fqn, String key) {\n"
+"        return getUnMarshalledValue(cache_.get(fqn, key));\n"
+"        }\n"
+"\n"
+"        public object set(Fqn fqn, String key, Object value) {\n"
+"        cache_.put(fqn, key, getMarshalledValue(value));\n"
+"        return value; // only if successful\n"
+"        }\n"
+"\n"
+"        ...\n"
+"\n"
+"        private Object getUnMarshalledValue(object value) {\n"
+"        // assuming we use the calling thread context classloader\n"
+"        return ((MarshalledValue)value).get();\n"
+"        }\n"
+"\n"
+"        private Object getMarshalledValue(Object value) {\n"
+"        return new MarshalledValue(value);\n"
+"        }\n"
+"        }"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:967
 #, no-c-format
 msgid "Does JBoss Cache currently support pre-event and post-event notification?"
-msgstr ""
+msgstr "JBoss Cache 目前支持 pre-event 和 post-event 通知吗?"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:973
@@ -1157,7 +1184,7 @@
 "notification. See documentation for more details. Note that "
 "TreeCacheListener and ExtendedTreeCacheListener will be merged into "
 "TreeCacheListener in release 1.3."
-msgstr ""
+msgstr "是的。从 1.2.4 版本开始,JBoss Cache 引入了 ExtendedTreeCacheListener,它考虑到了 pre 和 post event 通知。更多细节请参考相关文档。请注意,在版本 1.3 中,TreeCacheListener 和 ExtendedTreeCacheListener 将被合并到 TreeCacheListener 里。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:984
@@ -1165,7 +1192,7 @@
 msgid ""
 "How do I implement a custom listener to listen to <literal>TreeCache</"
 "literal> events?"
-msgstr ""
+msgstr "我怎样实现自定义的 listener 来侦听 <literal>TreeCache</literal> 事件"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:991
@@ -1176,7 +1203,7 @@
 "in. Then you add this listener to the TreeCache instance on startup to "
 "listen to the events as they occur by calling TreeCache.addTreeCacheListener"
 "(myListener)."
-msgstr ""
+msgstr "你可以创建一个类(如 myListener)来继承 AbstractTreeCacheListener 并为你所感兴趣的节点事件提供实现。然后把这个 listener 添加到 TreeCache 实例里,调用 TreeCache.addTreeCacheListener(myListener) 来启动对事件的侦听。"
 
 #. Tag: programlisting
 #: Cache_Frequently_Asked_Questions.xml:999
@@ -1198,6 +1225,21 @@
 "        ...\n"
 "        }"
 msgstr ""
+"public class MyListener extends AbstractTreeCacheListener\n"
+"        {\n"
+"        ...\n"
+"\n"
+"        public void nodeModify(Fqn fqn, boolean pre, boolean isLocal) {\n"
+"        if(log.isTraceEnabled()){\n"
+"        if(pre)\n"
+"        log.trace(\"Event DataNode about to be modified: \" + fqn);\n"
+"        else\n"
+"        log.trace(\"Event DataNode modified: \" + fqn);\n"
+"        }\n"
+"        }\n"
+"\n"
+"        ...\n"
+"        }"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1005
@@ -1206,17 +1248,17 @@
 "Can I use <literal>useRegionBasedMarshalling</literal> attribute in JBoss "
 "Cache in order to get around ClassCastExceptions happening when accessing "
 "data in the cache that has just been redeployed?"
-msgstr ""
+msgstr "在访问缓存里被重部署的数据时,我可以使用 JBoss Cache 里的 <literal>useRegionBasedMarshalling</literal> 属性来绕开 ClassCastExceptions 吗?"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1011
-#, no-c-format
+#, fuzzy, no-c-format
 msgid ""
 "Yes, you can. Originally, <literal>TreeCache</literal> Marshalling was "
 "designed as a workaround for those replicated caches that upon state "
 "transfer did not have access to the classloaders defining the objects in the "
 "cache."
-msgstr ""
+msgstr "可以。<literal>TreeCache</literal> 原来的解码"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1016
@@ -1321,7 +1363,7 @@
 #: Cache_Frequently_Asked_Questions.xml:1098
 #, no-c-format
 msgid "Does PojoCache have all the functional capabilities of TreeCache?"
-msgstr ""
+msgstr "PojoCache 具有 TreeCache 的所有功能吗?"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1104
@@ -1329,13 +1371,13 @@
 msgid ""
 "Yes. PojoCache extends TreeCache so it has all the same features TreeCache "
 "such as cache mode, transaction isolation level, and eviction policy."
-msgstr ""
+msgstr "对。PojoCache 继承了TreeCache,所以它具有和 TreeCache 相同的功能如缓存模式、事务隔离级别和 eviction 策略。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1113
 #, no-c-format
 msgid "What is the difference between TreeCache and PojoCache?"
-msgstr ""
+msgstr "TreeCache 和 PojoCache 的区别是什么?"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1119
@@ -1353,12 +1395,14 @@
 "about cache management. Furthermore, this is true in replication mode as "
 "well."
 msgstr ""
+"你可以把 PojoCache 想象成 TreeCache :)。严格来说,两者都是缓存库 - 一个是普通缓存而另外一个时 POJO 缓存。然而,虽然 TreeCache 只提供纯对象引用存储(例如:<literal>put(FQN fqn, Object key, Object value) </literal>),PojoCache 却可以为用户执行细颗粒度字段级别的对象复制映射和关系管理。因此,如果你有一个复杂的对象系统,你可以让 PojoCache "
+"替你进行管理。你可以简单地把对象系统当作驻留内存的,例如,使用常规的 POJO 方法而不用担心缓存管理。而且,在复制模式里也是这样。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1140
 #, no-c-format
 msgid "What are the steps to use the PojoCache feature?"
-msgstr ""
+msgstr "使用 PojoCache 功能的步骤是什么?"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1144
@@ -1366,7 +1410,7 @@
 msgid ""
 "Starting from release 1.3, depends on the JDK you use, it has slightly "
 "different steps. But in general, in order to use PojoCache, you will need to:"
-msgstr ""
+msgstr "从 1.3 版本开始,其步骤根据你的 JDK 不同而有轻微的不同。但通常你需要:"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1151
@@ -1376,7 +1420,7 @@
 "annotation, you can use either the JDK1.4 style or JDK50 one (of which is "
 "part of JVM spec). If you use JDK14, you will also need a annotation pre-"
 "compiler (annoc) to pre-process it."
-msgstr ""
+msgstr "准备 POJO。你可以通过 XML 声明或注解。对于注解,你可以使用 JDK1.4 或 JDK50 风格。如果使用 JDK14,你也将需要一个注解预编译器(annoc)来进行预处理。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1159
@@ -1387,7 +1431,7 @@
 "pre-compiler (aopc) to do bytecode manipulation. If you do it via load-time, "
 "however, you need either a special system class loader or, in JDK50, you can "
 "use the javaagent option."
-msgstr ""
+msgstr "instrumentation。你将需要在编译或加载时 instrument 你的 POJO。如果在编译时进行 instrument,你可使用所谓的 AOP 预编译器(aopc)来处理字节码操作。如果在加载时进行,那你将需要特殊的系统类加载器或使用 javaagent 选项(在 JDK50 里)。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1168
@@ -1397,13 +1441,13 @@
 "instrumentation, then you won't need any pre-processing step to use "
 "PojoCache. For a full example, please refer to the distro examples "
 "directory. There are numerous PojoCache examples that uses different options."
-msgstr ""
+msgstr "所以,如果你使用带有注解和加载时 instrumentation 的 JDK50,那么你不需要任何预处理步骤就可以使用 PojoCache。请参考 examples 目录下的完整示例。那里有使用不同选项的许多 PojoCache 例程。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1179
 #, no-c-format
 msgid "Can I run PojoCache in JBoss AS 3.2.x application server?"
-msgstr ""
+msgstr "我可以在 JBoss AS 3.2.x 应用服务器里使用 PojoCache 吗?"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1185
@@ -1412,13 +1456,13 @@
 "Yes and no. Yes, since JBossAop can also be back-ported to 3.2.x (see "
 "JBossAop wiki for details). However, it will take some effort. Therefore, "
 "the recommended JBoss version is 4.x to run PojoCache."
-msgstr ""
+msgstr "可以,也不可以。说可以,是因为 JBossAop 可以往后移植到 3.2.x(请参考 JBossAop wiki)。然而,这需要一定的努力。因此,我们推荐运行 PojoCache 的 JBoss 版本是 4.x。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1195
 #, no-c-format
 msgid "Can PojoCache run as a MBean as well?"
-msgstr ""
+msgstr "PojoCache 也可以作为 MBean 运行吗?"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1199
@@ -1433,6 +1477,9 @@
 "                     name=\"jboss.cache:service=PojoCache\"&gt;</"
 "programlisting> in the xml configuration file."
 msgstr ""
+"可以。这和 TreeCache MBean 几乎相同。唯一的区别是对象名和类名。例如,类似于 <programlisting>&lt;mbean code=\"org.jboss.cache.TreeCache\"\n"
+"                     name=\"jboss.cache:service=TreeCache\"&gt;</programlisting>,在 XML 配置文件里,你可以使用 <programlisting>&lt;mbean code=\"org.jboss.cache.aop.PojoCache\"\n"
+"                     name=\"jboss.cache:service=PojoCache\"&gt;</programlisting>。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1212
@@ -1440,7 +1487,7 @@
 msgid ""
 "Can I pre-compile the aop classes such that I don't need to use the system "
 "classloader and jboss-aop configuration xml?"
-msgstr ""
+msgstr "我是否可以预编译 aop 类,这样我就不需要使用系统类加载器和 jboss-aop 配置文件了?"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1218
@@ -1452,7 +1499,7 @@
 "can be treated as regular class files, i.e., you will not need to include "
 "any <literal>jboss-aop.xml</literal> that specifies the advisable POJO and "
 "to specify the JBossAop system class loader."
-msgstr ""
+msgstr "可以。JBossCache 的最新版本有一个预编译选项 <literal>aopc</literal>。你可以使用这个选项来预编译你的 \"aspectized\" POJO。一旦生成了类的字节码,它们就可以作为常规的类文件对待。也就是说,你不需要包括任何 <literal>jboss-aop.xml</literal> 来指定 advisable POJO 和 JBossAop 系统类加载器。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1230
@@ -1464,13 +1511,13 @@
 "regular project for <literal>annoc</literal> and <literal>aopc</literal> . "
 "In addition, please also check out the <literal>examples</literal> directory "
 "for concrete examples."
-msgstr ""
+msgstr "关于如何使用 <literal>aopc</literal> 的例子,请参考 1) <literal>tools</literal> 目录里的 PojoCacheTasks14.xml 和 PojoCacheTasks50.xml。两者都包含用于 <literal>annoc</literal> 和 <literal>aopc</literal> 的 Ant 任务,你可以将其导入到你的项目里。此外,也请参考 <literal>examples</literal> 目录里的相关例子。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1250
 #, no-c-format
 msgid "How do I use aopc on multiple module directories?"
-msgstr ""
+msgstr "我怎样把 aopc 用于多个模块目录?"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1254
@@ -1526,7 +1573,7 @@
 #: Cache_Frequently_Asked_Questions.xml:1308
 #, no-c-format
 msgid "What are the pro and con of xml vs. annotation?"
-msgstr ""
+msgstr "XML 和注解方式的优缺点各是什么?"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1312
@@ -1537,7 +1584,7 @@
 "annotation is well suited for PojoCache. This is because once you specify "
 "the annotation, you'd probably change it rarely since there is no parameters "
 "to tune, for example."
-msgstr ""
+msgstr "这确实取决于你的组织环境。虽然这会引起强烈争议,我还是强烈认为 POJO 注解更适合于 PojoCache。这是因为一旦你指定了注解,由于它并没有什么可调优的参数,你可能很少会修改它。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1324
@@ -1546,7 +1593,7 @@
 "What are the <literal>@org.jboss.cache.aop.annotation.Transient</literal> "
 "and <literal>@org.jboss.cache.aop.annotation.Serializable</literal> field "
 "level annotations?"
-msgstr ""
+msgstr "字段级注解 <literal>@org.jboss.cache.aop.annotation.Transient</literal> 和 <literal>@org.jboss.cache.aop.annotation.Serializable</literal> 是什么?"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1333
@@ -1556,7 +1603,7 @@
 "first one, <literal>@Transient</literal> , when applied has the same effect "
 "as declaring a field <literal>transient</literal> . PojoCache won't put this "
 "field under management."
-msgstr ""
+msgstr "从 1.4 开始,我们也提供两个额外的字段级注解。第一个是 <literal>@Transient</literal>,它和声明字段 <literal>transient</literal> 具有相同的效应。PojoCache 不会管理这个字段。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1341
@@ -1565,13 +1612,13 @@
 "The second one, <literal>@Serializable</literal> when applied, will cause "
 "PojoCache to treat the field as a Serializable object even when it is "
 "<literal>@PojoCacheable</literal> ."
-msgstr ""
+msgstr "第二个是 <literal>@Serializable</literal> ,它将导致 PojoCache 把字段作为可序列化的对象对待,即使这个字段具有 <literal>@PojoCacheable</literal> 注解。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1353
 #, no-c-format
 msgid "What about compile-time vs. load-time instrumentation then?"
-msgstr ""
+msgstr "编译时和加载时的 instrumentation 有何区别?"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1357
@@ -1581,7 +1628,7 @@
 "via aopc. I prefer this approach because it is easier to debug (at least at "
 "the development stage). In addition, once I generate the new class, there is "
 "no more steps needed."
-msgstr ""
+msgstr "这依情况而定。但我喜欢通过 aopc 进行编译时的 instrumentation。因为它更容易调试(至少在开发阶段),所以我更倾向于这个方法。此外,一旦生成了新的类,就不再需要其他步骤了。"
 
 #. Tag: para
 #: Cache_Frequently_Asked_Questions.xml:1368




More information about the jboss-cvs-commits mailing list