[webbeans-commits] Webbeans SVN: r1935 - doc/trunk/reference/zh-CN.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Wed Mar 11 23:20:56 EDT 2009
Author: alartin
Date: 2009-03-11 23:20:56 -0400 (Wed, 11 Mar 2009)
New Revision: 1935
Modified:
doc/trunk/reference/zh-CN/producermethods.po
Log:
Modified: doc/trunk/reference/zh-CN/producermethods.po
===================================================================
--- doc/trunk/reference/zh-CN/producermethods.po 2009-03-12 01:05:22 UTC (rev 1934)
+++ doc/trunk/reference/zh-CN/producermethods.po 2009-03-12 03:20:56 UTC (rev 1935)
@@ -3,11 +3,11 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: master.xml \n"
+"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-12-20 22:08+0000\n"
-"PO-Revision-Date: 2008-12-19 20:26+0000\n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2009-03-12 11:20+0800\n"
+"Last-Translator: Sean Wu <alartin at gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,48 +17,25 @@
#: producermethods.xml:5
#, no-c-format
msgid "Producer methods"
-msgstr ""
+msgstr "ç产è
æ¹æ³"
#. Tag: para
#: producermethods.xml:7
#, no-c-format
-msgid ""
-"Producer methods let us overcome certain limitations that arise when the Web "
-"Bean manager, instead of the application, is responsible for instantiating "
-"objects. They're also the easiest way to integrate objects which are not Web "
-"Beans into the Web Beans environment. (We'll meet a second approach in <xref "
-"linkend=\"xml\"/>.)"
-msgstr ""
+msgid "Producer methods let us overcome certain limitations that arise when the Web Bean manager, instead of the application, is responsible for instantiating objects. They're also the easiest way to integrate objects which are not Web Beans into the Web Beans environment. (We'll meet a second approach in <xref linkend=\"xml\"/>.)"
+msgstr "ç产è
æ¹æ³è½å¤è®©æ们å
æ使ç¨Web Bean管çå¨ä»£æ¿åºç¨æ¥è´è´£å®ä¾å对象æ带æ¥çç¹å®çéå¶ãç产è
æ¹æ³ä¹æ¯å°éWeb Beansç对象æ´åå°Web Beansç¯å¢ä¸çæç®åçéå¾ãï¼æ们å°å¨<xref linkend=\"xml\"/>讨论第äºç§æ¹æ³ï¼"
#. Tag: para
#: producermethods.xml:12
#, no-c-format
msgid "According to the spec:"
-msgstr ""
+msgstr "æ ¹æ®è§èï¼"
#. Tag: chapter
#: producermethods.xml:12
#, no-c-format
msgid ""
-"<blockquote> <para>A Web Beans producer method acts as a source of objects "
-"to be injected, where:</para> <itemizedlist> <listitem> <para>the objects to "
-"be injected are not required to be instances of Web Beans,</para> </"
-"listitem> <listitem> <para>the concrete type of the objects to be injected "
-"may vary at runtime or</para> </listitem> <listitem> <para>the objects "
-"require some custom initialization that is not performed by the Web Bean "
-"constructor</para> </listitem> </itemizedlist> </blockquote> <para>For "
-"example, producer methods let us:</para> <itemizedlist> <listitem> "
-"<para>expose a JPA entity as a Web Bean,</para> </listitem> <listitem> "
-"<para>expose any JDK class as a Web Bean,</para> </listitem> <listitem> "
-"<para>define multiple Web Beans, with different scopes or initialization, "
-"for the same implementation class, or</para> </listitem> <listitem> "
-"<para>vary the implementation of an API type at runtime.</para> </listitem> "
-"</itemizedlist> <para>In particular, producer methods let us use runtime "
-"polymorphism with Web Beans. As we've seen, deployment types are a powerful "
-"solution to the problem of deployment-time polymorphism. But once the system "
-"is deployed, the Web Bean implementation is fixed. A producer method has no "
-"such limitation:</para> <programlisting role=\"JAVA\"><![CDATA"
-"[@SessionScoped\n"
+"<blockquote> <para>A Web Beans producer method acts as a source of objects to be injected, where:</para> <itemizedlist> <listitem> <para>the objects to be injected are not required to be instances of Web Beans,</para> </listitem> <listitem> <para>the concrete type of the objects to be injected may vary at runtime or</para> </listitem> <listitem> <para>the objects require some custom initialization that is not performed by the Web Bean constructor</para> </listitem> </itemizedlist> </blockquote> <para>For example, producer methods let us:</para> <itemizedlist> <listitem> <para>expose a JPA entity as a Web Bean,</para> </listitem> <listitem> <para>expose any JDK class as a Web Bean,</para> </listitem> <listitem> <para>define multiple Web Beans, with different scopes or initialization, for the same implementation class, or</para> </listitem> <listitem> <para>vary the implementation of an API type at runtime.</para> </listitem> </itemizedlist> <para>In particular, producer met!
hods let us use runtime polymorphism with Web Beans. As we've seen, deployment types are a powerful solution to the problem of deployment-time polymorphism. But once the system is deployed, the Web Bean implementation is fixed. A producer method has no such limitation:</para> <programlisting role=\"JAVA\"><![CDATA[@SessionScoped\n"
"public class Preferences {\n"
" \n"
" private PaymentStrategyType paymentStrategy;\n"
@@ -75,39 +52,44 @@
" } \n"
" }\n"
" \n"
-"}]]></programlisting> <para>Consider an injection point:</para> "
-"<programlisting role=\"JAVA\"><![CDATA[@Preferred PaymentStrategy "
-"paymentStrat;]]></programlisting> <para>This injection point has the same "
-"type and binding annotations as the producer method, so it resolves to the "
-"producer method using the usual Web Beans injection rules. The producer "
-"method will be called by the Web Bean manager to obtain an instance to "
-"service this injection point.</para>."
+"}]]></programlisting> <para>Consider an injection point:</para> <programlisting role=\"JAVA\"><![CDATA[@Preferred PaymentStrategy paymentStrat;]]></programlisting> <para>This injection point has the same type and binding annotations as the producer method, so it resolves to the producer method using the usual Web Beans injection rules. The producer method will be called by the Web Bean manager to obtain an instance to service this injection point.</para>."
msgstr ""
+"<blockquote> <para>ä¸ä¸ªWeb Beanç产è
æ¹æ³å¨ä¸åæ
åµä¸ä½ä¸ºæ³¨å
¥å¯¹è±¡çæºï¼</para> <itemizedlist> <listitem> <para>æè¦æ³¨å
¥ç对象并ä¸è¦æ±æ¯ä¸ä¸ªWeb Beançå®ä¾ï¼</para> </listitem> <listitem> <para>æè¦æ³¨å
¥ç对象çå
·ä½ç±»åæå¯è½å¨è¿è¡æ¶ååï¼æè
</para> </listitem> <listitem> <para>对象éè¦ä¸äºWeb Beanæé å¨æ æ³å®æçä¸äºèªå®ä¹çåå§åå·¥ä½</para> </listitem> </itemizedlist> </blockquote> <para>ä¾å¦ï¼ç产è
æ¹æ³è½å¤è®©æ们ï¼</para> <itemizedlist> <listitem> <para>å°JPAå®ä½ä½ä¸ºä¸ä¸ªWeb Beanæ´é²åºæ¥ï¼</para> </listitem> <listitem> <para>å°ä»»ä½JDKç±»ä½ä¸ºWeb Beanæ´é²åºæ¥ï¼</para> </listitem> <listitem> <para>为ç¸åçä¸ä¸ªå®ç°ç±»å®ä¹å¤ä¸ªWeb Beansï¼æ¯ä¸ªé½æ¥æä¸åçèå´æè
åå§åï¼æè
</para> </listitem> <listitem> <para>å¨è¿è¡æ¶æ¹åä¸ä¸ªæ¥å£ç±»åçå
·ä½å®ç°ã</para> </listitem> </itemizedlist> <para>ç¹å«æ¯ç产è
æ¹æ!
³è®©æ们è½å¤ä½¿ç¨Web Beanså®ç°è¿è¡æ¶å¤ææ§ãå°±åæ们çå°çé£æ ·ï¼é¨ç½²ç±»åæ¯è§£å³é¨ç½²æ¶å¤ææ§ç解å³æ¹æ¡ãä¸è¿ä¸æ¦ç³»ç»è¢«é¨ç½²ä¹åï¼Web Beançå®ç°ä¹å°±åºå®äºãä¸ä¸ªç产è
æ¹æ³å¹¶æ²¡æè¿æ ·çéå¶ï¼</para> <programlisting role=\"JAVA\"><![CDATA[@SessionScoped\n"
+"public class Preferences {\n"
+" \n"
+" private PaymentStrategyType paymentStrategy;\n"
+" \n"
+" ...\n"
+" \n"
+" @Produces @Preferred \n"
+" public PaymentStrategy getPaymentStrategy() {\n"
+" switch (paymentStrategy) {\n"
+" case CREDIT_CARD: return new CreditCardPaymentStrategy();\n"
+" case CHEQUE: return new ChequePaymentStrategy();\n"
+" case PAYPAL: return new PayPalPaymentStrategy();\n"
+" default: return null;\n"
+" } \n"
+" }\n"
+" \n"
+"}]]></programlisting> <para>æ们çä¸ä¸æ³¨å
¥ç¹ï¼</para> <programlisting role=\"JAVA\"><![CDATA[@Preferred PaymentStrategy paymentStrat;]]></programlisting> <para>è¿ä¸ªæ³¨å
¥ç¹åç产è
æ¹æ³æ¥æç¸åçç±»ååç»å®æ³¨éï¼æ以使ç¨å¸¸è§çWeb Bean注å
¥è§åãç产è
æ¹æ³å°è¢«Web Bean管çå¨è°ç¨ï¼ä»èè·å¾ä¸ä¸ªå®ä¾æ¥ä¾ç»è¿ä¸ªæ³¨å
¥ç¹ã</para>."
#. Tag: title
#: producermethods.xml:68
#, no-c-format
msgid "Scope of a producer method"
-msgstr ""
+msgstr "ç产è
æ¹æ³çèå´"
#. Tag: para
#: producermethods.xml:70
#, no-c-format
-msgid ""
-"The scope of the producer method defaults to <literal>@Dependent</literal>, "
-"and so it will be called <emphasis>every time</emphasis> the Web Bean "
-"manager injects this field or any other field that resolves to the same "
-"producer method. Thus, there could be multiple instances of the "
-"<literal>PaymentStrategy</literal> object for each user session."
-msgstr ""
+msgid "The scope of the producer method defaults to <literal>@Dependent</literal>, and so it will be called <emphasis>every time</emphasis> the Web Bean manager injects this field or any other field that resolves to the same producer method. Thus, there could be multiple instances of the <literal>PaymentStrategy</literal> object for each user session."
+msgstr "é»è®¤çç产è
æ¹æ³çèå´æ¯ <literal>@Dependent</literal>ï¼æ以Web Bean管çå¨<emphasis>æ¯æ¬¡</emphasis>注å
¥è¿ä¸ªåæè
注å
¥ä»»ä½å
¶ä»å¯¹åºæ¹ç产è
æ¹æ³çåçæ¶åï¼è¿ä¸ªç产è
æ¹æ³é½ä¼è¢«è°ç¨ãè¿æ ·ï¼å¯¹äºæ¯ä¸ªç¨æ·ä¼è¯ï¼æ们æå¯è½æå¤ä¸ª<literal>PaymentStrategy</literal>å®ä¾ã"
#. Tag: para
#: producermethods.xml:75
#, no-c-format
-msgid ""
-"To change this behavior, we can add a <literal>@SessionScoped</literal> "
-"annotation to the method."
-msgstr ""
+msgid "To change this behavior, we can add a <literal>@SessionScoped</literal> annotation to the method."
+msgstr "è¦æ¹åè¿ç§è¡ä¸ºï¼æ们å¯ä»¥ç»è¿ä¸ªæ¹æ³æ·»å ä¸ä¸ª <literal>@SessionScoped</literal> 注éã"
#. Tag: programlisting
#: producermethods.xml:78
@@ -118,40 +100,34 @@
" ...\n"
"}]]>"
msgstr ""
+"<![CDATA[@Produces @Preferred @SessionScoped\n"
+"public PaymentStrategy getPaymentStrategy() {\n"
+" ...\n"
+"}]]>"
#. Tag: para
#: producermethods.xml:80
#, no-c-format
-msgid ""
-"Now, when the producer method is called, the returned "
-"<literal>PaymentStrategy</literal> will be bound to the session context. The "
-"producer method won't be called again in the same session."
-msgstr ""
+msgid "Now, when the producer method is called, the returned <literal>PaymentStrategy</literal> will be bound to the session context. The producer method won't be called again in the same session."
+msgstr "ç°å¨ï¼å½è¿ä¸ªç产è
æ¹æ³è¢«è°ç¨æ¶ï¼å®è¿åç <literal>PaymentStrategy</literal> 对象å°è¢«ç»å®å°ä¼è¯ä¸ä¸æä¸ãè¿ä¸ªç产è
æ¹æ³å¨åä¸ä¸ªä¼è¯èå´ä¸ä¸ä¼è¢«å次è°ç¨ã"
#. Tag: title
#: producermethods.xml:87
#, no-c-format
msgid "Injection into producer methods"
-msgstr ""
+msgstr "注å
¥å°ç产è
æ¹æ³ä¸"
#. Tag: para
#: producermethods.xml:89
#, no-c-format
-msgid ""
-"There's one potential problem with the code above. The implementations of "
-"<literal>CreditCardPaymentStrategy</literal> are instantiated using the Java "
-"<literal>new</literal> operator. Objects instantiated directly by the "
-"application can't take advantage of dependency injection and don't have "
-"interceptors."
-msgstr ""
+msgid "There's one potential problem with the code above. The implementations of <literal>CreditCardPaymentStrategy</literal> are instantiated using the Java <literal>new</literal> operator. Objects instantiated directly by the application can't take advantage of dependency injection and don't have interceptors."
+msgstr "ä¸é¢ç代ç æä¸ä¸ªæ½å¨çé®é¢ã <literal>CreditCardPaymentStrategy</literal> çå®ç°ä½¿ç¨Javaç <literal>new</literal> æä½ç¬¦æ¥å®ä¾åãåºç¨ç´æ¥å®ä¾åç对象æ æ³è·å¾ä¾èµæ³¨å
¥ç好å¤ï¼ä¹æ æ³è·å¾æ¦æªå¨ã"
#. Tag: para
#: producermethods.xml:94
#, no-c-format
-msgid ""
-"If this isn't what we want we can use dependency injection into the producer "
-"method to obtain Web Bean instances:"
-msgstr ""
+msgid "If this isn't what we want we can use dependency injection into the producer method to obtain Web Bean instances:"
+msgstr "å¦æè¿ä¸æ¯æ们æ³è¦çï¼æ们å¯ä»¥å¯¹ç产è
æ¹æ³ä½¿ç¨ä¾èµæ³¨å
¥æ¥è·å¾Web Beanå®ä¾ï¼"
#. Tag: programlisting
#: producermethods.xml:97
@@ -169,62 +145,56 @@
" } \n"
"}]]>"
msgstr ""
+"<![CDATA[@Produces @Preferred @SessionScoped\n"
+"public PaymentStrategy getPaymentStrategy(CreditCardPaymentStrategy ccps,\n"
+" ChequePaymentStrategy cps,\n"
+" PayPalPaymentStrategy ppps) {\n"
+" switch (paymentStrategy) {\n"
+" case CREDIT_CARD: return ccps;\n"
+" case CHEQUE: return cps;\n"
+" case PAYPAL: return ppps;\n"
+" default: return null;\n"
+" } \n"
+"}]]>"
#. Tag: para
#: producermethods.xml:99
#, no-c-format
-msgid ""
-"Wait, what if <literal>CreditCardPaymentStrategy</literal> is a request "
-"scoped Web Bean? Then the producer method has the effect of \"promoting\" "
-"the current request scoped instance into session scope. This is almost "
-"certainly a bug! The request scoped object will be destroyed by the Web Bean "
-"manager before the session ends, but the reference to the object will be "
-"left \"hanging\" in the session scope. This error will <emphasis>not</"
-"emphasis> be detected by the Web Bean manager, so please take extra care "
-"when returning Web Bean instances from producer methods!"
-msgstr ""
+msgid "Wait, what if <literal>CreditCardPaymentStrategy</literal> is a request scoped Web Bean? Then the producer method has the effect of \"promoting\" the current request scoped instance into session scope. This is almost certainly a bug! The request scoped object will be destroyed by the Web Bean manager before the session ends, but the reference to the object will be left \"hanging\" in the session scope. This error will <emphasis>not</emphasis> be detected by the Web Bean manager, so please take extra care when returning Web Bean instances from producer methods!"
+msgstr "çä¸ä¸ï¼å¦æ <literal>CreditCardPaymentStrategy</literal> æ¯ä¸ä¸ªè¯·æ±èå´çWeb Beanï¼é£ä¼ææ ·ï¼ç产è
æ¹æ³å°ä¼æå½å请æ±èå´çå®ä¾\"æå\"å°ä¼è¯èå´ãè¿è¿ä¹æ¯ä¸ä¸ªBugï¼è¯·æ±èå´ç对象ä¼å¨ä¼è¯ç»æå被Web Bean管çå¨éæ¯ï¼ä½æ¯è¿ä¸ªå¯¹è±¡çå¼ç¨å°è¢« \"æ¬æ\"å¨ä¼è¯èå´ãWeb Bean管çå¨<emphasis>ä¸ä¼</emphasis>æ£æµå°è¿ç§é误ï¼å æ¤ä½¿ç¨ç产è
æ¹æ³è¿åWeb beanå®ä¾çæ¶åä¸å®è¦å¤å å°å¿ï¼"
#. Tag: para
#: producermethods.xml:107
#, no-c-format
-msgid ""
-"There's at least three ways we could go about fixing this bug. We could "
-"change the scope of the <literal>CreditCardPaymentStrategy</literal> "
-"implementation, but this would affect other clients of that Web Bean. A "
-"better option would be to change the scope of the producer method to "
-"<literal>@Dependent</literal> or <literal>@RequestScoped</literal>."
-msgstr ""
+msgid "There's at least three ways we could go about fixing this bug. We could change the scope of the <literal>CreditCardPaymentStrategy</literal> implementation, but this would affect other clients of that Web Bean. A better option would be to change the scope of the producer method to <literal>@Dependent</literal> or <literal>@RequestScoped</literal>."
+msgstr "æ们è³å°æä¸ç§æ¹å¼æ¥è§£å³è¿ä¸ªBugãæ们å¯ä»¥æ¹å <literal>CreditCardPaymentStrategy</literal>å®ç°çèå´ï¼ä½æ¯è¿ç§æ¹æ³å°å½±åå°å
¶ä»ä½¿ç¨è¿ä¸ªWeb Beanç客æ·ãä¸ä¸ªæ´å¥½çéæ©æ¯å°ç产è
æ¹æ³çèå´æ´æ¹å° <literal>@Dependent</literal> æè
<literal>@RequestScoped</literal>ã"
#. Tag: para
#: producermethods.xml:113
#, no-c-format
-msgid ""
-"But a more common solution is to use the special <literal>@New</literal> "
-"binding annotation."
-msgstr ""
+msgid "But a more common solution is to use the special <literal>@New</literal> binding annotation."
+msgstr "ä¸è¿æ´å 常ç¨çæ¹æ³æ¯ä½¿ç¨ç¹æ®ç <literal>@New</literal> ç»å®æ³¨éã"
#. Tag: title
#: producermethods.xml:119
#, no-c-format
msgid "Use of <literal>@New</literal> with producer methods"
-msgstr ""
+msgstr "å¨ç产è
æ¹æ³ä¸ä½¿ç¨ <literal>@New</literal> "
#. Tag: para
#: producermethods.xml:121
#, no-c-format
msgid "Consider the following producer method:"
-msgstr ""
+msgstr "èèå°ä¸é¢çç产è
æ¹æ³ï¼"
#. Tag: programlisting
#: producermethods.xml:123
#, no-c-format
msgid ""
"<![CDATA[@Produces @Preferred @SessionScoped\n"
-"public PaymentStrategy getPaymentStrategy(@New CreditCardPaymentStrategy "
-"ccps,\n"
+"public PaymentStrategy getPaymentStrategy(@New CreditCardPaymentStrategy ccps,\n"
" @New ChequePaymentStrategy cps,\n"
-" @New PayPalPaymentStrategy ppps) "
-"{\n"
+" @New PayPalPaymentStrategy ppps) {\n"
" switch (paymentStrategy) {\n"
" case CREDIT_CARD: return ccps;\n"
" case CHEQUE: return cps;\n"
@@ -233,15 +203,21 @@
" } \n"
"}]]>"
msgstr ""
+"<![CDATA[@Produces @Preferred @SessionScoped\n"
+"public PaymentStrategy getPaymentStrategy(@New CreditCardPaymentStrategy ccps,\n"
+" @New ChequePaymentStrategy cps,\n"
+" @New PayPalPaymentStrategy ppps) {\n"
+" switch (paymentStrategy) {\n"
+" case CREDIT_CARD: return ccps;\n"
+" case CHEQUE: return cps;\n"
+" case PAYPAL: return ppps;\n"
+" default: return null;\n"
+" } \n"
+"}]]>"
#. Tag: para
#: producermethods.xml:125
#, no-c-format
-msgid ""
-"Then a new <emphasis>dependent</emphasis> instance of "
-"<literal>CreditCardPaymentStrategy</literal> will be created, passed to the "
-"producer method, returned by the producer method and finally bound to the "
-"session context. The dependent object won't be destroyed until the "
-"<literal>Preferences</literal> object is destroyed, at the end of the "
-"session."
-msgstr ""
+msgid "Then a new <emphasis>dependent</emphasis> instance of <literal>CreditCardPaymentStrategy</literal> will be created, passed to the producer method, returned by the producer method and finally bound to the session context. The dependent object won't be destroyed until the <literal>Preferences</literal> object is destroyed, at the end of the session."
+msgstr "ä¸ä¸ªæ°ç<emphasis>ä¾èµ</emphasis>ç <literal>CreditCardPaymentStrategy</literal> å®ä¾å°è¢«å建ï¼ç¶åä¼ éç»ç产è
æ¹æ³ï¼ç¶åç产è
æ¹æ³å°å
¶è¿åï¼æç»è¿ä¸ªå®ä¾å°è¢«ç»å®å°ä¼è¯ä¸ä¸æãè¿ä¸ªä¾èµå¯¹è±¡ä¸ä¼è¢«æåéæ¯ï¼èæ¯å¨ä¼è¯ç»ææ¶è·é <literal>Preferences</literal> ä¸èµ·è¢«éæ¯ã"
+
More information about the weld-commits
mailing list