[jboss-cvs] JBossAS SVN: r88326 - 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
Thu May 7 01:56:13 EDT 2009


Author: xhuang at jboss.com
Date: 2009-05-07 01:56:13 -0400 (Thu, 07 May 2009)
New Revision: 88326

Modified:
   projects/docs/enterprise/4.3.3/Server_Configuration_Guide/zh-CN/J2EE_Additional_Services.po
Log:
udpate

Modified: projects/docs/enterprise/4.3.3/Server_Configuration_Guide/zh-CN/J2EE_Additional_Services.po
===================================================================
--- projects/docs/enterprise/4.3.3/Server_Configuration_Guide/zh-CN/J2EE_Additional_Services.po	2009-05-07 05:55:44 UTC (rev 88325)
+++ projects/docs/enterprise/4.3.3/Server_Configuration_Guide/zh-CN/J2EE_Additional_Services.po	2009-05-07 05:56:13 UTC (rev 88326)
@@ -9,7 +9,7 @@
 "Project-Id-Version: J2EE_Additional_Services\n"
 "Report-Msgid-Bugs-To: http://bugs.kde.org\n"
 "POT-Creation-Date: 2009-01-20 02:37+0000\n"
-"PO-Revision-Date: 2009-05-05 16:25+1000\n"
+"PO-Revision-Date: 2009-05-07 15:55+1000\n"
 "Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
 "Language-Team:  <en at li.org>\n"
 "MIME-Version: 1.0\n"
@@ -1386,6 +1386,8 @@
 "The <literal>SchedulableClass</literal><literal>org.jboss.book.misc.ex2."
 "ExSchedulable</literal> example class is given below."
 msgstr ""
+"下面是 <literal>SchedulableClass</literal><literal>org.jboss.book.misc.ex2."
+"ExSchedulable</literal> 示例类。"
 
 #. Tag: programlisting
 #: J2EE_Additional_Services.xml:456
@@ -1426,18 +1428,52 @@
 "    }\n"
 "}"
 msgstr ""
+"package org.jboss.book.misc.ex2;\n"
+"\n"
+"import java.util.Date;\n"
+"import org.jboss.varia.scheduler.Schedulable;\n"
+"\n"
+"import org.apache.log4j.Logger;\n"
+"\n"
+"/**\n"
+" * A simple Schedulable example.\n"
+" * @author Scott.Stark at jboss.org\n"
+" * @version $Revision: 1.1 $\n"
+" */\n"
+"public class ExSchedulable implements Schedulable\n"
+"{\n"
+"    private static final Logger log = Logger.getLogger(ExSchedulable."
+"class);\n"
+"\n"
+"    private String name;\n"
+"    private long value;\n"
+"\n"
+"    public ExSchedulable(String name, long value)\n"
+"    {\n"
+"        this.name = name;\n"
+"        this.value = value;\n"
+"        log.info(\"ctor, name: \" + name + \", value: \" + value);\n"
+"    }\n"
+"\n"
+"    public void perform(Date now, long remainingRepetitions)\n"
+"    {\n"
+"        log.info(\"perform, now: \" + now +\n"
+"                 \", remainingRepetitions: \" + remainingRepetitions +\n"
+"                 \", name: \" + name + \", value: \" + value);\n"
+"    }\n"
+"}"
 
 #. Tag: para
 #: J2EE_Additional_Services.xml:457
-#, fuzzy, no-c-format
+#, no-c-format
 msgid "Deploy the timer SAR by running:"
-msgstr "用下面的命令部署示例 ear:"
+msgstr "用下面的命令部署 timer SAR:"
 
 #. Tag: programlisting
 #: J2EE_Additional_Services.xml:460
-#, fuzzy, no-c-format
+#, no-c-format
 msgid "[examples]$ ant -Dchap=misc -Dex=2 run-example"
-msgstr "[examples]$ ant -Dchap=chap2 -Dex=3 run-example"
+msgstr "[examples]$ ant -Dchap=misc -Dex=2 run-example"
 
 #. Tag: para
 #: J2EE_Additional_Services.xml:461
@@ -1445,7 +1481,7 @@
 msgid ""
 "The server console shows the following which includes the first two timer "
 "invocations, separated by 60 seconds:"
-msgstr ""
+msgstr "服务器控制台显示下面的消息,包括开始的两个 timer 调用,每次相隔 60 秒:"
 
 #. Tag: programlisting
 #: J2EE_Additional_Services.xml:464
@@ -1462,6 +1498,16 @@
 "2004, \n"
 "  remainingRepetitions: -1, name: TheName, value: 123456789"
 msgstr ""
+"21:09:27,716 INFO  [ExSchedulable] ctor, name: TheName, value: 123456789\n"
+"21:09:28,925 INFO  [ExSchedulable] perform, now: Mon Dec 20 21:09:28 CST "
+"2004, \n"
+"  remainingRepetitions: -1, name: TheName, value: 123456789\n"
+"21:10:28,899 INFO  [ExSchedulable] perform, now: Mon Dec 20 21:10:28 CST "
+"2004, \n"
+"  remainingRepetitions: -1, name: TheName, value: 123456789\n"
+"21:11:28,897 INFO  [ExSchedulable] perform, now: Mon Dec 20 21:11:28 CST "
+"2004, \n"
+"  remainingRepetitions: -1, name: TheName, value: 123456789"
 
 #. Tag: title
 #: J2EE_Additional_Services.xml:470
@@ -1672,6 +1718,19 @@
 "    &lt;/attribute&gt;\n"
 "&lt;/mbean&gt;"
 msgstr ""
+"&lt;mbean code=\"org.jboss.monitor.services.NotificationListener\"\n"
+"      name=\"jboss.monitor:service=NotificationListener\"&gt;\n"
+"    &lt;attribute name=\"SubscriptionList\"&gt;\n"
+"        &lt;subscription-list&gt;\n"
+"            &lt;mbean name=\"jboss.monitor:name=Heartbeat,type=Timer\"&gt;\n"
+"                &lt;filter factory=\"NotificationFilterSupportFactory\"&gt;\n"
+"                    &lt;enable type=\"jboss.monitor.heartbeat\"/"
+"&gt;                        \n"
+"                &lt;/filter&gt;\n"
+"            &lt;/mbean&gt;\n"
+"        &lt;/subscription-list&gt;\n"
+"    &lt;/attribute&gt;\n"
+"&lt;/mbean&gt;"
 
 #. Tag: para
 #: J2EE_Additional_Services.xml:520
@@ -1682,7 +1741,7 @@
 "executes a specified script when events are received. The script can be "
 "written in any bean shell scripting language. The ScriptingListener accepts "
 "has the following parameters."
-msgstr ""
+msgstr "作为一个更有趣的 Listener,让我们来看看 ScriptingListener。这个 Listener 侦听特定的事件并在接收到事件后执行指定的脚本。这个脚本可以任何 Bean shell 脚本语言编写。ScriptingListener 具有下列的参数。"
 
 #. Tag: para
 #: J2EE_Additional_Services.xml:525
@@ -1691,7 +1750,7 @@
 "<emphasis role=\"bold\">ScriptLanguage</emphasis>: This is the language the "
 "script is written in. This should be <literal>beanshell</literal>, unless "
 "you have loaded libraries for another beanshell compatible language."
-msgstr ""
+msgstr "<emphasis role=\"bold\">ScriptLanguage</emphasis>:这是编写该脚本的语言。它应该是 <literal>beanshell</literal>,除非你加载了用于兼容 beanshell 的其他语言库。"
 
 #. Tag: para
 #: J2EE_Additional_Services.xml:530
@@ -1700,18 +1759,16 @@
 "<emphasis role=\"bold\">Script</emphasis>: This is the text of the script to "
 "evaluate. It is good practice to enclose the script in a CDATA section to "
 "minimize conflicts between scripting language syntax and XML syntax."
-msgstr ""
+msgstr "<emphasis role=\"bold\">Script</emphasis>:这是该脚本求值的文本。把这个脚本包裹在 CDATA 部分来最小化脚本语言语法和 XML 语法间的冲突是一个好的方法。"
 
 #. Tag: para
 #: J2EE_Additional_Services.xml:535
-#, fuzzy, no-c-format
+#, no-c-format
 msgid ""
 "<emphasis role=\"bold\">SubscriptionList</emphasis>: This is the list of "
 "MBeans that this MBean will listen to for events that will trigger the "
 "script."
-msgstr ""
-"<emphasis role=\"bold\">directory</emphasis>:这是建立访问日志文件的目录路"
-"径。"
+msgstr "<emphasis role=\"bold\">SubscriptionList</emphasis>:这是该 MBean 将侦听触发脚本事件的 MBean 列表。"
 
 #. Tag: para
 #: J2EE_Additional_Services.xml:540
@@ -1724,6 +1781,8 @@
 "that the beanshell script has a reference to the MBean server and can "
 "execute operations against other MBeans."
 msgstr ""
+"下面的例子解释了 <literal>ScriptingListener</"
+"literal> 的用法。当之前配置的定时器产生一个 Heartbeat 通知时,beanshell 脚本将开始执行并把当前的内存值输出 STDOUT 上(这个输出将被重定向到日志文件里)。请注意,beanshell 脚本里有一个对 MBean 服务器的引用,它可以执行针对其他 MBean 的操作。"
 
 #. Tag: programlisting
 #: J2EE_Additional_Services.xml:543
@@ -1752,6 +1811,28 @@
 "    &lt;/attribute&gt;\n"
 "&lt;/mbean&gt;"
 msgstr ""
+"&lt;mbean code=\"org.jboss.monitor.services.ScriptingListener\" \n"
+"       name=\"jboss.monitor:service=ScriptingListener\"&gt; \n"
+"    &lt;attribute name=\"SubscriptionList\"&gt;\n"
+"        &lt;subscription-list&gt;\n"
+"            &lt;mbean name=\"jboss.monitor:name=Heartbeat,type=Timer\"/&gt;\n"
+"        &lt;/subscription-list&gt;\n"
+"    &lt;/attribute&gt;\n"
+"    &lt;attribute name=\"ScriptLanguage\"&gt;beanshell&lt;/attribute&gt;\n"
+"    &lt;attribute name=\"Script\"&gt;\n"
+"                &lt;![CDATA[\n"
+"   import javax.management.ObjectName;\n"
+"\n"
+"   /* poll free memory and thread count */   \n"
+"   ObjectName target = new ObjectName(\"jboss.system:type=ServerInfo\");\n"
+"\n"
+"   long freeMemory = server.getAttribute(target, \"FreeMemory\");\n"
+"   long threadCount = server.getAttribute(target, \"ActiveThreadCount\");\n"
+"\n"
+"   log.info(\"freeMemory\" + freeMemory + \", threadCount\" + threadCount);\n"
+"]]&gt;\n"
+"    &lt;/attribute&gt;\n"
+"&lt;/mbean&gt;"
 
 #. Tag: para
 #: J2EE_Additional_Services.xml:544
@@ -1763,6 +1844,8 @@
 "notifications that could be generated from a timer. Additionally, any MBean "
 "can be coded to listen for timer-generated notifications."
 msgstr ""
+"当然,你并不仅限于这些 JBoss 提供的通知 Listener。其他服务如 barrier(请参考 <xref linkend="
+"\"Additional_Services-The_BarrierController_Service\"/>)接收定时器产生的通知并进行相应操作。此外,你可以对任何 MBean 编程,使其可以侦听定时器产生的通知。"
 
 #. Tag: title
 #: J2EE_Additional_Services.xml:550
@@ -1818,7 +1901,6 @@
 #. Tag: para
 #: J2EE_Additional_Services.xml:560
 #, no-c-format
-#, fuzzy
 msgid ""
 "Resolving such non-trivial dependencies is currently performed using JMX "
 "notifications. For example the <literal>jboss.system:type=Server</literal> "
@@ -1833,7 +1915,7 @@
 msgstr ""
 "解决如此重要的依赖性目前使用 JMX 通知来完成。例如,<literal>jboss.system:type=Server</literal> "
 "MBean 在启动后会发送类型为 <literal>org.jboss.system.server.started</"
-"literal> 的通知,并在关闭时发送 <literal>org.jboss.system.server.stopped</literal> 通知。"
+"literal> 的通知,并在关闭时发送 <literal>org.jboss.system.server.stopped</literal> 通知。类似地,<literal>jboss.web:service=WebServer</literal> 在启动时发送类型为 <literal>jboss.tomcat.connectors.started</literal> 的通知。服务可以订阅这些通知来实现更复杂的依赖关系。这个技术已经通过 barrier controller 服务进行推广了。"
 
 #. Tag: para
 #: J2EE_Additional_Services.xml:563
@@ -1843,7 +1925,7 @@
 "<literal>ListenerServiceMBeanSupport</literal> and thus can subscribe to any "
 "notification in the system. It uses the received notifications to control "
 "the lifecycle of a dynamically created MBean called the barrier."
-msgstr ""
+msgstr "barrier controller 是一个相对简单的 MBean 服务,它继承了 <literal>ListenerServiceMBeanSupport</literal> 且可以订阅系统里的任何通知。它使用接收的通知来控制动态创建的 barrier MBean 的生命周期。"
 
 #. Tag: para
 #: J2EE_Additional_Services.xml:566
@@ -1857,6 +1939,9 @@
 "will be started and stopped in tandem with the Barrier. When the barrier "
 "controller is undeployed the barrier is destroyed."
 msgstr ""
+"当 barrier controller 被部署时,barrier 被初始化、注册并带入 create 状态。此后,当收到相应的通知时,barrier 被启动和停止。因此,其他服务只需要用普通的 <literal>&lt;depends&gt;</"
+"literal> 标签就可以依赖于 Barrier MBean,而不需要担心复杂的生命周期问题。它们将和 Barrier 一前一后地启动和停止。当卸载 barrier "
+"controller 时,barrier 将被销毁。"
 
 #. Tag: para
 #: J2EE_Additional_Services.xml:569
@@ -1871,7 +1956,7 @@
 "notifications, so that you can identify quickly from which subscription a "
 "notification is originating (because your listener can have many active "
 "subscriptions)."
-msgstr ""
+msgstr "令人感兴趣的通知在 barrier controller 里用 <literal>SubscriptionList</literal> 属性进行配置。为了识别启动和停止通知,我们把每个订阅和一个 Handback 字符串对象相关联。Handback 对象,如果进行了指定,将在接收时(也就是调用 <literal>handleNotification()</literal> 时)和被递送的通知一起被传回,所以你可以快速识别通知始自哪个订阅(因为你的 Listener 可以有多个订阅)。"
 
 #. Tag: para
 #: J2EE_Additional_Services.xml:572
@@ -1884,6 +1969,8 @@
 "barrier controller. Thus we can have more than one notifications triggering "
 "the starting or stopping of the barrier."
 msgstr ""
+"所以,我们可用任何 Handback 字符串对产生启动/停止通知的订阅进行标记,且我们把相同的字符串配置为 barrier controller 的 <literal>StartBarrierHandback</literal>(和对应的 "
+"<literal>StopBarrierHandback</literal>)属性。因此,我们可以有多个通知来触发 Barrier 的启动和停止。"
 
 #. Tag: para
 #: J2EE_Additional_Services.xml:575
@@ -1897,7 +1984,7 @@
 "crossed, but it could be anything. We&#39;ve used this because it prints out "
 "to the console starting and stopping messages, so we know when the service "
 "gets activated/deactivated."
-msgstr ""
+msgstr "下面的例子显示了一个依赖于 Tomcat 连接器的服务。实际上,对于想访问 Tomcat 内部的 Servlet 的服务来说,这是一个非常常见的模式。依赖于 Barrier 的这个服务,是一个简单的内存监控程序,它创建一个后台线程并监控内存的使用情况,当达到极限时发送通知。我们已经使用这个服务在控制台上输出启动和停止消息,所以我们知道服务在什么时候激活和取消激活。"
 
 #. Tag: programlisting
 #: J2EE_Additional_Services.xml:578
@@ -1978,6 +2065,80 @@
 "  \n"
 "&lt;/server&gt;"
 msgstr ""
+"&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n"
+"&lt;!-- $Id: J2EE_Additional_Services.xml,v 1.1 2007/11/09 07:30:09 vrenish "
+"Exp $ --&gt;\n"
+"\n"
+"&lt;server&gt;\n"
+"  &lt;!--\n"
+"    In this example we have the BarrierController controlling a Barrier\n"
+"    that is started when we receive the \"jboss.tomcat.connectors.started\"\n"
+"    notification from the Tomcat mbean, and stopped when we receive the\n"
+"    \"org.jboss.system.server.stopped\" notification from the server mbean.\n"
+"    \n"
+"    The dependent services need only define a dependency on the Barrier "
+"mbean!\n"
+"  --&gt;\n"
+"  &lt;mbean code=\"org.jboss.system.BarrierController\"\n"
+"         name=\"jboss:service=BarrierController\"&gt;\n"
+"    \n"
+"    &lt;!-- Whether to have the Barrier initially started or not --&gt;\n"
+"    &lt;attribute name=\"BarrierEnabledOnStartup\"&gt;false&lt;/"
+"attribute&gt;\n"
+"    \n"
+"    &lt;!-- Whether to subscribe for notifications after startup --&gt;\n"
+"    &lt;attribute name=\"DynamicSubscriptions\"&gt;true&lt;/attribute&gt;\n"
+"    \n"
+"    &lt;!-- Dependent services will depend on this mbean --&gt;\n"
+"    &lt;attribute name=\"BarrierObjectName\"&gt;jboss:name=TomcatConnector,"
+"type=Barrier&lt;/attribute&gt;\n"
+"    \n"
+"    &lt;!-- The notification subscription handback that starts the barrier --"
+"&gt;\n"
+"    &lt;attribute name=\"StartBarrierHandback\"&gt;start&lt;/attribute&gt;\n"
+"    \n"
+"    &lt;!-- The notification subscription handback that stops the barrier --"
+"&gt;\n"
+"    &lt;attribute name=\"StopBarrierHandback\"&gt;stop&lt;/attribute&gt;\n"
+"    \n"
+"    &lt;!-- The notifications to subscribe for, along with their handbacks --"
+"&gt;\n"
+"    &lt;attribute name=\"SubscriptionList\"&gt;\n"
+"      &lt;subscription-list&gt;\n"
+"        &lt;mbean name=\"jboss.web:service=WebServer\" handback=\"start"
+"\"&gt;\n"
+"          &lt;filter factory=\"NotificationFilterSupportFactory\"&gt;\n"
+"            &lt;enable type=\"jboss.tomcat.connectors.started\"/&gt;\n"
+"          &lt;/filter&gt;\n"
+"        &lt;/mbean&gt;\n"
+"        &lt;mbean name=\"jboss.system:type=Server\" handback=\"stop\"&gt;\n"
+"          &lt;filter factory=\"NotificationFilterSupportFactory\"&gt;\n"
+"            &lt;enable type=\"org.jboss.system.server.stopped\"/&gt;\n"
+"          &lt;/filter&gt;\n"
+"        &lt;/mbean&gt;        \n"
+"      &lt;/subscription-list&gt;\n"
+"    &lt;/attribute&gt;\n"
+"  &lt;/mbean&gt;\n"
+"\n"
+"  &lt;!--\n"
+"    An example service that depends on the Barrier we declared above.\n"
+"    This services creates a background thread and monitors the memory\n"
+"    usage. When it exceeds the defined thresholds it emits notifications\n"
+"  --&gt;\n"
+"  &lt;mbean code=\"org.jboss.monitor.services.MemoryMonitor\"\n"
+"         name=\"jboss.monitor:service=MemoryMonitor\"&gt;\n"
+"\n"
+"    &lt;attribute name=\"FreeMemoryWarningThreshold\"&gt;20m&lt;/"
+"attribute&gt;\n"
+"    &lt;attribute name=\"FreeMemoryCriticalThreshold\"&gt;15m&lt;/"
+"attribute&gt;\n"
+"    \n"
+"    &lt;!-- The BarrierObjectName configured in the BarrierController --"
+"&gt;\n"
+"    &lt;depends&gt;jboss:name=TomcatConnector,type=Barrier&lt;/depends&gt;\n"
+"  &lt;/mbean&gt;\n"
+"  \n"
+"&lt;/server&gt;"
 
 #. Tag: para
 #: J2EE_Additional_Services.xml:579
@@ -1992,6 +2153,8 @@
 "literal> operations on the barrier controller. The attribute "
 "<literal>BarrierStateString</literal> indicates the status of the barrier."
 msgstr ""
+"如果你在正运行的服务器上热部署这个服务,Barrier 将停止,因为此时 Barrier Controller 被部署并已经发送了启动通知(有办法可以克服这一点)。然而,如果你重启服务器,Barrier 将在 Tomcat 连接器激活后被启动。你也可以通过 barrier controller 上的 <literal>startBarrier()</literal> 和 <literal>stopBarrier()</"
+"literal> 操作手工启动或停止 Barrier。<literal>BarrierStateString</literal> 属性表示 Barrier 的状态。"
 
 #. Tag: title
 #: J2EE_Additional_Services.xml:585




More information about the jboss-cvs-commits mailing list