[webbeans-commits] Webbeans SVN: r1956 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-13 02:39:07 -0400 (Fri, 13 Mar 2009)
New Revision: 1956
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
completed section 9 assertions
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-03-13 06:17:22 UTC (rev 1955)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-03-13 06:39:07 UTC (rev 1956)
@@ -5681,7 +5681,433 @@
</section>
<section id="9.6.2" title="Child elements of a producer method declaration">
+ <assertion id="a">
+ <text>If a child element of a producer method declaration is the <Produces> element in the Java EE namespace, it declares the return type, bindings and member-level metadata of the producer method</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the child element of a producer method declaration can be interpreted as an interceptor binding type, it declares a method-level interceptor binding</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container interprets the child element of a producer method declaration as declaring a parameter of the producer method, if it is not a <Produces> element and cannot be interpreted as an interceptor binding type</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If there is more than one child <Produces> element of a producer method declaration in the Java EE namespace, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The container inspects the direct child elements of the <Produces> element. For each child element, the element is interpreted as a Java type. If no such Java type exists in the classpath, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the type of the direct child element of a <Produces> element is a Java class or interface type, the return type of the producer method was declared</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the type of the direct child element of a <Produces> element is a Java annotation type, it declares member-level metadata of the producer method</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If the type of the direct child element of a <Produces> element is not a Java class or Java annotation, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If more than one child element represents a Java class or interface type, or if no child element represents a Java class or interface type, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+ <section id="9.6.3" title="Return type and bindings of a producer method or field">
+ <assertion id="a">
+ <text>Every XML producer method or field declaration has a direct child <Produces> element</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>This <Produces> element must, in turn, have a direct child element which declares the return type of the producer method or the type of the producer field and which is interpreted by the container as a type declaration, as defined in Section 9.10, "Specifying bean types and bindings"</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The type declaration that declares the return type of the producer method or the type of the producer field specifies the return type and bindings of the producer method bean, or the type and bindings of the producer field bean.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The type is used to calculate the set of bean types</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The type declared in XML must be a supertype or subtype of the Java method or field type. If the declared type is not a supertype or subtype of the Java method or field type, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
</section>
+
+ <section id="9.6.4" title="Member-level metadata for a producer method or field">
+ <assertion id="a">
+ <text>Member-level metadata for a producer method or field declaration is specified via direct child elements of the <Produces> element that represent Java annotation types.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Each child element is interpreted as a Java annotation type. If the type is not a Java annotation type, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the annotation type is a deployment type, the deployment type of the producer method or field was declared, as defined in Section 2.5.4, "Declaring the deployment type of a bean using XML".</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the annotation type is a scope type, the scope of the producer method or field was declared, as defined in Section 2.4.4, "Declaring the bean scope using XML".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the annotation type is a stereotype, a stereotype of the producer method or field was declared, as defined in Section 2.7.3, "Declaring the stereotypes for a bean using XML".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the annotation type is javax.annotation.Name, the name of the producer method or field was declared, as defined in Section 2.6.2, "Declaring the bean name using XML".</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the annotation type is not a deployment type, or a scope type, or a stereotype, or a javax.annotation.Name, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="9.7" title="Interceptor and decorator declarations">
+ <assertion id="a">
+ <text>A simple bean declaration is interpreted as an interceptor declaration if it contains a direct child <Interceptor> element in the Java EE namespace</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A simple bean declaration is interpreted as a decorator declaration if it contains a direct child <Decorator> element in the Java EE namespace</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a bean declaration that is not a simple bean declaration contains a child <Interceptor> element, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a bean declaration that is not a simple bean declaration contains a child <Decorator> element, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an inline bean declaration contains a child <Interceptor> element, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If an inline bean declaration contains a child <Decorator> element, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If a simple bean declaration contains more than one direct child <Interceptor> element in the Java EE namespace, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If a simple bean declaration contains more than one direct child <Decorator> element in the Java EE namespace, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+ </section>
+
+ <section id="9.7.1" title="Decorator delegate attribute">
+ <assertion id="a">
+ <text>Decorator declarations may declare the delegate attribute</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A delegate declaration is a direct child element of the decorator declaration.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The name of the delegate attribute is the same as the name of the element.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a direct child element of a decorator declaration exists in the same namespace as its parent, and has direct child <Decorates> element in the Java EE namespace then it is interpreted as a delegate declaration.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the bean class has a field with the same name as the child element, then the child element is interpreted to represent that field.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the bean class does not have have a field with the specified name, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If a delegate declaration has more than one direct child element, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The child element of the delegate declaration is a <Decorates> element in the Java EE namespace. If the <Decorates> element does not, in turn, have exactly one direct child element, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The direct child element of the <Decorates> element is interpreted as a type declaration as specified by Section 9.10, "Specifying bean types and bindings". If the declared bean type is not assignable to the type of the Java field, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The bean type declared in XML may be a subtype of the Java field type. In this case, the container will use the bean type declared in XML when resolving the dependency.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If simple bean declaration that is not a decorator declaration contains a direct child element that in turn contains a direct child <Decorates> element, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ </section>
+
+ <section id="9.8" title="Injection point declarations">
+ <assertion id="a">
+ <text>An injection point declaration is either a type declaration, as defined in Section 9.10, "Specifying bean types and bindings", or an inline bean declaration, as defined in Section 9.9, "Inline bean declarations".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When the container encounters an injection point declaration, it interprets the element as a Java class or interface. If no such Java type exists in the classpath, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the Java type is a parameterized type, the injection point declaration is a type declaration, and the declared type of the injection point is the bean type of the type declaration, including actual type parameters.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Otherwise, the container inspects the direct child elements. If any direct child element can be interpreted as a binding type, the injection point declaration is a type declaration, and the declared type of the injection point is the bean type of the type declaration.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Otherwise, if any direct child elements exist, the injection point declaration is an inline bean declaration, and the declared type of the injection point is the bean class of the bean.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Otherwise, the injection point declaration is a type declaration, and the declared type of the injection point is the bean type of the type declaration.</text>
+ </assertion>
+ </section>
+
+ <section id="9.9" title="Inline bean declarations">
+ <assertion id="a">
+ <text>An inline bean declaration is a simple bean declaration, as defined in Section 9.5, "Bean declarations" that occurs as an injection point declaration, instead of as a direct child of the <Beans> element.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The element is interpreted as a Java class. This Java class is the bean class of the simple bean</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Inline bean declarations may not explicitly specify a binding type. If an inline bean declaration explicitly specifies a binding type, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>For every inline injection point, the container generates a unique value for an implementation-specific binding type. This generated value is the binding of the injection point, and the only binding of the simple bean. The bean type of the injection point is the declared bean class of the simple bean.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An inline bean declaration results in a simple bean that is bound only to the injection point at which it was declared.</text>
+ </assertion>
+ </section>
+
+ <section id="9.10" title="Specifying bean types and bindings">
+ <assertion id="a">
+ <text>Every injection point defined in XML must explicitly specify a bean type and combination of bindings.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Every event parameter defined in XML must explicitly specify a bean type and combination of bindings.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Every delegate attribute defined in XML must explicitly specify a bean type and combination of bindings.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>XML-based producer method declarations must explicitly specify the return type (which is used to calculate the set of bean types) and bindings</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A type declaration is an element that represents a Java class or interface, or <Array></text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A type declaration is (if the type is a parameterized type), a set of child elements that represent Java classes and/or interfaces, and are interpreted as the actual type parameters, or, if the type is an array type, a single child element that represents the array element type</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A type declaration is optionally, a set of child elements that represent Java annotation types, and are interpreted as bindings</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>When the container encounters a type declaration it interprets the element as a Java type</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If the element is an <Array> element in the Java EE namespace, an array type was declared.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>Otherwise, the element is interpreted as a Java class or interface. If no such Java type exists in the classpath, a DefinitionException is thrown by the container at deployment time. If the Java type is not a class or interface type, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The container inspects every direct child element of the type declaration. Each child element is interpreted as a Java type. If no such Java type exists in the classpath, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>If the type is a Java annotation type, a binding was declared.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>If the type is a Java class or interface type, an actual type parameter or array element type was declared</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>If the type is not a Java annotation type or a Java class or interface type, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>If multiple array element types are declared, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>If the number of declared actual type parameters is not the same as the number of parameters of the Java type, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>If a type parameter of the Java type is bounded, and the corresponding declared actual type parameter does not satisfy the upper or lower bound, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>If a binding declaration declares a Java annotation type that is not a binding type, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="s">
+ <text>If no binding is declared, the default binding @Current is assumed</text>
+ </assertion>
+
+ <assertion id="t">
+ <text>If the same binding type occurs more than once, a DuplicateBindingTypeException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="u">
+ <text>For fields, type declarations are specified as direct child elements of the field declaration</text>
+ </assertion>
+
+ <assertion id="v">
+ <text>For methods, the method parameter declarations are type declarations</text>
+ </assertion>
+
+ <assertion id="w">
+ <text>For producer methods, the return type must be specified</text>
+ </assertion>
+
+ <assertion id="x">
+ <text>For constructors, the constructor parameter declarations are type declarations</text>
+ </assertion>
+ </section>
+
+ <section id="9.11" title="Annotation members">
+ <assertion id="a">
+ <text>Any binding or interceptor binding declaration must define the value of any annotation member without a default value, and may additionally define the value of any annotation member with a default value.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Annotation member values are defined by attributes of the XML element which represents the Java annotation.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>All attributes of any XML element which represents a Java annotation are interpreted as members of the annotation</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The name of the attribute is interpreted as the name of the corresponding annotation member.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The value of the attribute is interpreted as the value of the annotation member.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If there is no annotation member with the same name as the attribute, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The value of an annotation member named value may be specified in the body of the XML element which represents the Java annotation.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If the XML element has a non-empty body and also specifies an attribute named value, a
+DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If the XML element has a non-empty body, and there is no annotation member named value, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The value of a member of primitive type is specified using the Java literal syntax for that type</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The value of a member of type java.lang.String is specified using the string value</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The value of a member of enumerated type is specified using the unqualified name of the enumeration value.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>The value of a member of type java.lang.Class is specified using the fully qualified Java class name.</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>If the member value is not specified in the correct format for the type of the member, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>If an XML element that refers to a Java annotation with a member with no default value does not declare a value for that member, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+ </section>
+
+ <section id="9.12" title="Deployment declarations">
+ <assertion id="a">
+ <text>The <Deploy>, <Interceptors> and <Decorators> elements in the Java EE namespace determine which beans, interceptors and decorators are enabled in a particular deployment</text>
+ </assertion>
+ </section>
+
+ <section id="9.12.1" title="The <Deploy> declaration">
+ <assertion id="a">
+ <text>Each direct child element of a <Deploy> element is interpreted as the declaring an enabled deployment type, as specified in Section 2.5.6, "Enabled deployment types"</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Each child element is interpreted as a Java annotation type. If no such Java type exists in the classpath, a DefinitionException is thrown by the container at deployment time. If the type is not a deployment type, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the same deployment type is declared more than once, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+ </section>
+
+ <section id="9.12.2" title="The <Interceptors> declaration">
+ <assertion id="a">
+ <text>Each direct child element of an <Interceptors> element is interpreted as the declaring an enabled interceptor, as specified in Section A.3.7, "Interceptor enablement and ordering".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Each child element is interpreted as a Java class. If no such Java class exists in the classpath, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the same interceptor is declared more than once, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ </section>
+
+ <section id="9.12.3" title="The <Decorators> declaration">
+ <assertion id="a">
+ <text>Each direct child element of a <Decorators> element is interpreted as the declaring an enabled decorator, as specified in Section A.5.5, "Decorator enablement and ordering".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Each child element is interpreted as a Java class. If no such Java class exists in the classpath, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the same decorator is declared more than once, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+ </section>
</specification>
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1955 - doc/trunk/reference/zh-CN.
by webbeans-commits@lists.jboss.org
Author: alartin
Date: 2009-03-13 02:17:22 -0400 (Fri, 13 Mar 2009)
New Revision: 1955
Modified:
doc/trunk/reference/zh-CN/ri.po
Log:
Modified: doc/trunk/reference/zh-CN/ri.po
===================================================================
--- doc/trunk/reference/zh-CN/ri.po 2009-03-13 06:13:05 UTC (rev 1954)
+++ doc/trunk/reference/zh-CN/ri.po 2009-03-13 06:17:22 UTC (rev 1955)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-02-07 18:51+0000\n"
-"PO-Revision-Date: 2009-02-04 11:41+0800\n"
+"PO-Revision-Date: 2009-03-13 14:16+0800\n"
"Last-Translator: Sean Wu <alartin(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -22,55 +22,38 @@
#. Tag: para
#: ri.xml:6
#, no-c-format
-msgid ""
-"The Web Beans Reference Implementation is being developed at <ulink url="
-"\"http://seamframework.org/WebBeans\">the Seam project</ulink>. You can "
-"download the latest developer release of Web Beans from the <ulink url="
-"\"http://seamframework.org/Download\">the downloads page</ulink>."
-msgstr ""
+msgid "The Web Beans Reference Implementation is being developed at <ulink url=\"http://seamframework.org/WebBeans\">the Seam project</ulink>. You can download the latest developer release of Web Beans from the <ulink url=\"http://seamframework.org/Download\">the downloads page</ulink>."
+msgstr "Web Bean参考实现由<ulink url=\"http://seamframework.org/WebBeans\">Seam项目</ulink>开发。你可以从<ulink url=\"http://seamframework.org/Download\">the downloads page</ulink>下载最新的开发者版本。"
#. Tag: para
#: ri.xml:13
#, fuzzy, no-c-format
-msgid ""
-"The Web Beans RI comes with a two deployable example applications: "
-"<literal>webbeans-numberguess</literal>, a war example, containing only "
-"simple beans, and <literal>webbeans-translator</literal> an ear example, "
-"containing enterprise beans. To run the examples you'll need the following:"
-msgstr ""
-"Web Beans RI自带了两个例子:<literal>webbeans-numberguess</literal> (一个仅包"
-"含一个简单Bean的WAR应用例子)和<literal>webbeans-translator</literal> (一个包"
-"含企业Bean的EAR应用例子)。"
+msgid "The Web Beans RI comes with a two deployable example applications: <literal>webbeans-numberguess</literal>, a war example, containing only simple beans, and <literal>webbeans-translator</literal> an ear example, containing enterprise beans. To run the examples you'll need the following:"
+msgstr "Web Beans RI自带了两个例子:<literal>webbeans-numberguess</literal> (一个仅包含一个简单Bean的WAR应用例子)和<literal>webbeans-translator</literal> (一个包含企业Bean的EAR应用例子)。"
#. Tag: para
#: ri.xml:22
#, no-c-format
msgid "the latest release of the Web Beans RI,"
-msgstr ""
+msgstr "最新的Web Bean参考实现版本,"
#. Tag: para
#: ri.xml:25
#, no-c-format
msgid "JBoss AS 5.0.0.GA, and"
-msgstr ""
+msgstr "JBoss AS 5.0.0.GA, 和"
#. Tag: para
#: ri.xml:28
#, no-c-format
msgid "Ant 1.7.0."
-msgstr ""
+msgstr "Ant 1.7.0."
#. Tag: para
#: ri.xml:32
#, no-c-format
-msgid ""
-"Currently, the Web Beans RI only runs on JBoss Application Server 5. You'll "
-"need to download JBoss AS 5.0.0.GA from <ulink url=\"http://www.jboss.org/"
-"jbossas/downloads/\">jboss.org</ulink>, and unzip it. For example:"
-msgstr ""
-"当前,Web Beans参考实现只能运行在JBoss AS 5之上。你需要从<ulink url=\"http://"
-"www.jboss.org/jbossas/downloads/\">jboss.org</ulink>下载JBoss AS 5.0.0.GA, 然"
-"后解压。例如:"
+msgid "Currently, the Web Beans RI only runs on JBoss Application Server 5. You'll need to download JBoss AS 5.0.0.GA from <ulink url=\"http://www.jboss.org/jbossas/downloads/\">jboss.org</ulink>, and unzip it. For example:"
+msgstr "当前,Web Beans参考实现只能运行在JBoss AS 5之上。你需要从<ulink url=\"http://www.jboss.org/jbossas/downloads/\">jboss.org</ulink>下载JBoss AS 5.0.0.GA, 然后解压。例如:"
#. Tag: programlisting
#: ri.xml:39
@@ -85,12 +68,8 @@
#. Tag: para
#: ri.xml:41
#, fuzzy, no-c-format
-msgid ""
-"Next, download the Web Beans RI from <ulink url=\"http://seamframework.org/"
-"Download\">seamframework.org</ulink>, and unzip it. For example"
-msgstr ""
-"然后从<ulink url=\"http://seamframework.org/WebBeans\">seamframework.org</"
-"ulink>下载Web Beans的参考实现,然后解压。例如:"
+msgid "Next, download the Web Beans RI from <ulink url=\"http://seamframework.org/Download\">seamframework.org</ulink>, and unzip it. For example"
+msgstr "然后从<ulink url=\"http://seamframework.org/WebBeans\">seamframework.org</ulink>下载Web Beans的参考实现,然后解压。例如:"
#. Tag: programlisting
#: ri.xml:47
@@ -105,13 +84,8 @@
#. Tag: para
#: ri.xml:50
#, no-c-format
-msgid ""
-"Next, we need to tell Web Beans where JBoss is located. Edit <literal>jboss-"
-"as/build.properties</literal> and set the <literal>jboss.home</literal> "
-"property. For example:"
-msgstr ""
-"然后,我们需要告诉Web Beans JBoss的位置。编辑<literal>jboss-as/build."
-"properties</literal>,设置<literal>jboss.home</literal>属性。例如:"
+msgid "Next, we need to tell Web Beans where JBoss is located. Edit <literal>jboss-as/build.properties</literal> and set the <literal>jboss.home</literal> property. For example:"
+msgstr "然后,我们需要告诉Web Beans JBoss的位置。编辑<literal>jboss-as/build.properties</literal>,设置<literal>jboss.home</literal>属性。例如:"
#. Tag: programlisting
#: ri.xml:56
@@ -122,37 +96,20 @@
#. Tag: para
#: ri.xml:58
#, no-c-format
-msgid ""
-"As Web Beans is a new piece of software, you need to update JBoss AS to run "
-"the Web Beans RI. Future versions of JBoss AS will include these updates, "
-"and this step won't be necessary."
-msgstr ""
-"因为Web Beans是新的软件,你需要更新JBoss AS来运行Web Beans的参考实现。JBoss "
-"AS未来的版本将包括这些更新,这些步骤将不再是必须的。"
+msgid "As Web Beans is a new piece of software, you need to update JBoss AS to run the Web Beans RI. Future versions of JBoss AS will include these updates, and this step won't be necessary."
+msgstr "因为Web Beans是新的软件,你需要更新JBoss AS来运行Web Beans的参考实现。JBoss AS未来的版本将包括这些更新,这些步骤将不再是必须的。"
#. Tag: para
#: ri.xml:65
#, no-c-format
-msgid ""
-"Currently, two updates are needed. Firstly, a new deployer, "
-"<literal>webbeans.deployer</literal> is added. This adds supports for Web "
-"Bean archives to JBoss AS, and allows the Web Beans RI to query the EJB3 "
-"container and discover which EJBs are installed in your application. "
-"Secondly, an update to JBoss EJB3 is needed."
-msgstr ""
-"当前,我们需要两个更新。首先,需要添加一个新的部署器<literal>webbeans."
-"deployer</literal>。这个部署器提供JBoss AS对Web Bean档案包的支持,能够让Web "
-"Beans参考实现查询EJB3容器,发现应用中安装的EJB。第二,需要更新JBoss EJB3。"
+msgid "Currently, two updates are needed. Firstly, a new deployer, <literal>webbeans.deployer</literal> is added. This adds supports for Web Bean archives to JBoss AS, and allows the Web Beans RI to query the EJB3 container and discover which EJBs are installed in your application. Secondly, an update to JBoss EJB3 is needed."
+msgstr "当前,我们需要两个更新。首先,需要添加一个新的部署器<literal>webbeans.deployer</literal>。这个部署器提供JBoss AS对Web Bean档案包的支持,能够让Web Beans参考实现查询EJB3容器,发现应用中安装的EJB。第二,需要更新JBoss EJB3。"
#. Tag: para
#: ri.xml:74
#, fuzzy, no-c-format
-msgid ""
-"To install the update, you'll need Ant 1.7.0 installed, and the "
-"<literal>ANT_HOME</literal> environment variable set. For example:"
-msgstr ""
-"为了安装更新,你需要安装Ant 1.7.0,设置<literal>ANT_HOME</literal>环境变量。"
-"例如:"
+msgid "To install the update, you'll need Ant 1.7.0 installed, and the <literal>ANT_HOME</literal> environment variable set. For example:"
+msgstr "为了安装更新,你需要安装Ant 1.7.0,设置<literal>ANT_HOME</literal>环境变量。例如:"
#. Tag: programlisting
#: ri.xml:79
@@ -167,9 +124,7 @@
#. Tag: para
#: ri.xml:81
#, no-c-format
-msgid ""
-"Then, you can install the update. The update script will use Maven to "
-"download the Web Beans and EJB3 automatically."
+msgid "Then, you can install the update. The update script will use Maven to download the Web Beans and EJB3 automatically."
msgstr "然后,你需要安装更新,更新脚本使用Maven来自动下载Web Beans和EJB3。"
#. Tag: programlisting
@@ -191,8 +146,7 @@
#. Tag: para
#: ri.xml:93
#, no-c-format
-msgid ""
-"The build scripts for the examples offer a number of targets, these are:"
+msgid "The build scripts for the examples offer a number of targets, these are:"
msgstr "例子的构建脚本包含多个目标:"
#. Tag: para
@@ -204,17 +158,13 @@
#. Tag: para
#: ri.xml:105
#, no-c-format
-msgid ""
-"<literal>ant explode</literal> - update an exploded example, without "
-"restarting the deployment"
-msgstr ""
-"<literal>ant explode</literal> - 无需重新部署,更新一个exploded形式部署的例子"
+msgid "<literal>ant explode</literal> - update an exploded example, without restarting the deployment"
+msgstr "<literal>ant explode</literal> - 无需重新部署,更新一个exploded形式部署的例子"
#. Tag: para
#: ri.xml:111
#, no-c-format
-msgid ""
-"<literal>ant deploy</literal> - deploy the example in compressed jar format"
+msgid "<literal>ant deploy</literal> - deploy the example in compressed jar format"
msgstr "<literal>ant deploy</literal> - 以压缩jar包形式部署例子"
#. Tag: para
@@ -249,7 +199,7 @@
#: ri.xml:134
#, no-c-format
msgid "Start JBoss AS:"
-msgstr ""
+msgstr "启动 JBoss AS:"
#. Tag: programlisting
#: ri.xml:138
@@ -261,30 +211,19 @@
#: ri.xml:141
#, no-c-format
msgid "If you use Windows, use the <literal>run.bat</literal>script."
-msgstr ""
+msgstr "如果你使用Windows操作系统,则使用<literal>run.bat</literal> 脚本。"
#. Tag: para
#: ri.xml:146
#, no-c-format
-msgid ""
-"Wait for the application to deploy, and enjoy hours of fun at <ulink url="
-"\"http://localhost:8080/webbeans-numberguess\"></ulink>!"
-msgstr ""
-"等待应用部署完毕,好好体验一下<ulink url=\"http://localhost:8080/webbeans-"
-"numberguess\"></ulink>!"
+msgid "Wait for the application to deploy, and enjoy hours of fun at <ulink url=\"http://localhost:8080/webbeans-numberguess\"></ulink>!"
+msgstr "等待应用部署完毕,好好体验一下<ulink url=\"http://localhost:8080/webbeans-numberguess\"></ulink>!"
#. Tag: para
#: ri.xml:151
#, no-c-format
-msgid ""
-"The Web Beans RI includes a second simple example that will translate your "
-"text into Latin. The numberguess example is a war example, and uses only "
-"simple beans; the translator example is an ear example, and includes "
-"enterprise beans, packaged in an EJB module. To try it out:"
-msgstr ""
-"Web Bean参考实现的第二个简单例子能够将你的文本翻译为拉丁文。猜数字例子是一个"
-"WAR应用,仅仅使用了一个简单Beans;翻译器例子是一个EAR应用,包含了打包在EJB模"
-"块中的企业Beans。试一下:"
+msgid "The Web Beans RI includes a second simple example that will translate your text into Latin. The numberguess example is a war example, and uses only simple beans; the translator example is an ear example, and includes enterprise beans, packaged in an EJB module. To try it out:"
+msgstr "Web Bean参考实现的第二个简单例子能够将你的文本翻译为拉丁文。猜数字例子是一个WAR应用,仅仅使用了一个简单Beans;翻译器例子是一个EAR应用,包含了打包在EJB模块中的企业Beans。试一下:"
#. Tag: programlisting
#: ri.xml:158
@@ -299,12 +238,8 @@
#. Tag: para
#: ri.xml:160
#, no-c-format
-msgid ""
-"Wait for the application to deploy, and visit <ulink url=\"http://"
-"localhost:8080/webbeans-translator\"></ulink>!"
-msgstr ""
-"等待应用部署,试一下<ulink url=\"http://localhost:8080/webbeans-translator"
-"\"></ulink>!"
+msgid "Wait for the application to deploy, and visit <ulink url=\"http://localhost:8080/webbeans-translator\"></ulink>!"
+msgstr "等待应用部署,试一下<ulink url=\"http://localhost:8080/webbeans-translator\"></ulink>!"
#. Tag: title
#: ri.xml:166
@@ -315,37 +250,20 @@
#. Tag: para
#: ri.xml:168
#, no-c-format
-msgid ""
-"In the numberguess application you get given 10 attempts to guess a number "
-"between 1 and 100. After each attempt, you will be told whether you are too "
-"high, or too low."
-msgstr ""
-"在猜数字应用中,你有十次机会来猜一个1到100之间的数字。每次猜测之后,应用都会"
-"告诉你你猜的数字是高了还是低了。"
+msgid "In the numberguess application you get given 10 attempts to guess a number between 1 and 100. After each attempt, you will be told whether you are too high, or too low."
+msgstr "在猜数字应用中,你有十次机会来猜一个1到100之间的数字。每次猜测之后,应用都会告诉你你猜的数字是高了还是低了。"
#. Tag: para
#: ri.xml:174
#, no-c-format
-msgid ""
-"The numberguess example is comprised of a number of Web Beans, configuration "
-"files, and Facelet JSF pages, packaged as a war. Let's start with the "
-"configuration files."
-msgstr ""
-"猜数字应用由Web Beans,配置文件,Facelete JSF页面组成,打包为一个WAR。我们先"
-"看一下配置文件。"
+msgid "The numberguess example is comprised of a number of Web Beans, configuration files, and Facelet JSF pages, packaged as a war. Let's start with the configuration files."
+msgstr "猜数字应用由Web Beans,配置文件,Facelete JSF页面组成,打包为一个WAR。我们先看一下配置文件。"
#. Tag: para
#: ri.xml:180
#, no-c-format
-msgid ""
-"All the configuration files for this example are located in <literal>WEB-INF/"
-"</literal>, which is stored in <literal>WebContent</literal> in the source "
-"tree. First, we have <literal>faces-config.xml</literal>, in which we tell "
-"JSF to use Facelets:"
-msgstr ""
-"猜数字应用的所有的配置文件位于<literal>WEB-INF/</literal>,这个目录位于源码树"
-"的<literal>WebContent</literal>中。首先,我们在faces-config.xml文件中告诉JSF"
-"使用Faceletes:"
+msgid "All the configuration files for this example are located in <literal>WEB-INF/</literal>, which is stored in <literal>WebContent</literal> in the source tree. First, we have <literal>faces-config.xml</literal>, in which we tell JSF to use Facelets:"
+msgstr "猜数字应用的所有的配置文件位于<literal>WEB-INF/</literal>,这个目录位于源码树的<literal>WebContent</literal>中。首先,我们在faces-config.xml文件中告诉JSF使用Faceletes:"
#. Tag: programlisting
#: ri.xml:188
@@ -355,8 +273,7 @@
"<faces-config version=\"1.2\"\n"
" xmlns=\"http://java.sun.com/xml/ns/javaee\"\n"
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://"
-"java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd\">\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd\">\n"
" \n"
" <application>\n"
" <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>\n"
@@ -368,8 +285,7 @@
"<faces-config version=\"1.2\"\n"
" xmlns=\"http://java.sun.com/xml/ns/javaee\"\n"
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://"
-"java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd\">\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd\">\n"
" \n"
" <application>\n"
" <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>\n"
@@ -380,12 +296,8 @@
#. Tag: para
#: ri.xml:190
#, no-c-format
-msgid ""
-"There is an empty <literal>web-beans.xml</literal> file, which marks this "
-"application as a Web Beans application."
-msgstr ""
-"这有一个空的<literal>web-beans.xml</literal>文件,标识这个应用是一个Web Beans"
-"应用。"
+msgid "There is an empty <literal>web-beans.xml</literal> file, which marks this application as a Web Beans application."
+msgstr "这有一个空的<literal>web-beans.xml</literal>文件,标识这个应用是一个Web Beans应用。"
#. Tag: para
#: ri.xml:195
@@ -397,17 +309,12 @@
#: ri.xml:197
#, fuzzy, no-c-format
msgid ""
-"<programlistingco> <areaspec> <area id=\"faces.servlet\" coords=\"12\"/> "
-"<area id=\"faces.servlet.mapping\" coords=\"18\"/> <area id=\"faces.default."
-"suffix\" coords=\"23\"/> <area id=\"session.timeout\" coords=\"28\"/> <area "
-"id=\"webbeans.listener\" coords=\"32\"/> </areaspec> <programlisting><![CDATA"
-"[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+"<programlistingco> <areaspec> <area id=\"faces.servlet\" coords=\"12\"/> <area id=\"faces.servlet.mapping\" coords=\"18\"/> <area id=\"faces.default.suffix\" coords=\"23\"/> <area id=\"session.timeout\" coords=\"28\"/> <area id=\"webbeans.listener\" coords=\"32\"/> </areaspec> <programlisting><![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"\n"
"<web-app version=\"2.5\"\n"
" xmlns=\"http://java.sun.com/xml/ns/javaee\"\n"
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun."
-"com/xml/ns/javaee/web-app_2_5.xsd\">\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\">\n"
" \n"
" <display-name>Web Beans Numbergues example</display-name>\n"
"\n"
@@ -433,23 +340,7 @@
" <session-timeout>10</session-timeout>\n"
" </session-config>\n"
"\n"
-"</web-app>]]></programlisting> <calloutlist> <callout arearefs=\"faces."
-"servlet\"> <para> Enable and load the JSF servlet </para> </callout> "
-"<callout arearefs=\"faces.servlet.mapping\"> <para> Configure requests to "
-"<literal>.jsf</literal> pages to be handled by JSF </para> </callout> "
-"<callout arearefs=\"faces.default.suffix\"> <para> Tell JSF that we will be "
-"giving our source files (facelets) an extension of <literal>.jsf</literal> </"
-"para> </callout> <callout arearefs=\"session.timeout\"> <para> Configure a "
-"session timeout of 10 minutes </para> </callout> </calloutlist> </"
-"programlistingco> <note> <para> Whilst this demo is a JSF demo, you can use "
-"the Web Beans RI with any Servlet based web framework. </para> </note> "
-"<para> Let's take a look at the Facelet view: </para> <programlistingco> "
-"<areaspec> <area id=\"template\" coords=\"8\"/> <area id=\"messages\" coords="
-"\"12\"/> <area id=\"instructions\" coords=\"19\"/> <area id=\"guess\" coords="
-"\"25\"/> <area id=\"validator\" coords=\"30\"/> <area id=\"submit\" coords="
-"\"33\"/> </areaspec> <programlisting><![CDATA[<!DOCTYPE html PUBLIC \"-//"
-"W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/"
-"xhtml1-transitional.dtd\">\n"
+"</web-app>]]></programlisting> <calloutlist> <callout arearefs=\"faces.servlet\"> <para> Enable and load the JSF servlet </para> </callout> <callout arearefs=\"faces.servlet.mapping\"> <para> Configure requests to <literal>.jsf</literal> pages to be handled by JSF </para> </callout> <callout arearefs=\"faces.default.suffix\"> <para> Tell JSF that we will be giving our source files (facelets) an extension of <literal>.jsf</literal> </para> </callout> <callout arearefs=\"session.timeout\"> <para> Configure a session timeout of 10 minutes </para> </callout> </calloutlist> </programlistingco> <note> <para> Whilst this demo is a JSF demo, you can use the Web Beans RI with any Servlet based web framework. </para> </note> <para> Let's take a look at the Facelet view: </para> <programlistingco> <areaspec> <area id=\"template\" coords=\"8\"/> <area id=\"messages\" coords=\"12\"/> <area id=\"instructions\" coords=\"19\"/> <area id=\"guess\" coords=\"25\"/> <area id=\"validator\" coo!
rds=\"30\"/> <area id=\"submit\" coords=\"33\"/> </areaspec> <programlisting><![CDATA[<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
"<html xmlns=\"http://www.w3.org/1999/xhtml\"\n"
" xmlns:ui=\"http://java.sun.com/jsf/facelets\"\n"
" xmlns:h=\"http://java.sun.com/jsf/html\"\n"
@@ -462,15 +353,12 @@
" <h:form id=\"NumberGuessMain\">\n"
" <div style=\"color: red\">\n"
" <h:messages id=\"messages\" globalOnly=\"false\"/>\n"
-" <h:outputText id=\"Higher\" value=\"Higher!\" rendered=\"#{game."
-"number gt game.guess and game.guess ne 0}\"/>\n"
-" <h:outputText id=\"Lower\" value=\"Lower!\" rendered=\"#{game."
-"number lt game.guess and game.guess ne 0}\"/>\n"
+" <h:outputText id=\"Higher\" value=\"Higher!\" rendered=\"#{game.number gt game.guess and game.guess ne 0}\"/>\n"
+" <h:outputText id=\"Lower\" value=\"Lower!\" rendered=\"#{game.number lt game.guess and game.guess ne 0}\"/>\n"
" </div>\n"
" \n"
" <div>\n"
-" I'm thinking of a number between #{game.smallest} and #{game."
-"biggest}.\n"
+" I'm thinking of a number between #{game.smallest} and #{game.biggest}.\n"
" You have #{game.remainingGuesses} guesses.\n"
" </div>\n"
" \n"
@@ -490,41 +378,19 @@
" disabled=\"#{game.number eq game.guess}\"/>\n"
" </div>\n"
" <div>\n"
-" <h:commandButton id=\"RestartButton\" value=\"Reset\" action=\"#"
-"{game.reset}\" immediate=\"true\" />\n"
+" <h:commandButton id=\"RestartButton\" value=\"Reset\" action=\"#{game.reset}\" immediate=\"true\" />\n"
" </div>\n"
" </h:form>\n"
" </ui:define>\n"
" </ui:composition>\n"
-"</html>]]></programlisting> <calloutlist> <callout arearefs=\"template\"> "
-"<para> Facelets is a templating language for JSF, here we are wrapping our "
-"page in a template which defines the header. </para> </callout> <callout "
-"arearefs=\"messages\"> <para> There are a number of messages which can be "
-"sent to the user, \"Higher!\", \"Lower!\" and \"Correct!\" </para> </"
-"callout> <callout arearefs=\"instructions\"> <para> As the user guesses, the "
-"range of numbers they can guess gets smaller - this sentance changes to make "
-"sure they know what range to guess in. </para> </callout> <callout arearefs="
-"\"guess\"> <para> This input field is bound to a Web Bean, using the value "
-"expression. </para> </callout> <callout arearefs=\"validator\"> <para> A "
-"range validator is used to make sure the user doesn't accidentally input a "
-"number outside of the range in which they can guess - if the validator "
-"wasn't here, the user might use up a guess on an out of range number. </"
-"para> </callout> <callout arearefs=\"submit\"> <para> And, of course, there "
-"must be a way for the user to send their guess to the server. Here we bind "
-"to an action method on the Web Bean. </para> </callout> </calloutlist> </"
-"programlistingco>"
+"</html>]]></programlisting> <calloutlist> <callout arearefs=\"template\"> <para> Facelets is a templating language for JSF, here we are wrapping our page in a template which defines the header. </para> </callout> <callout arearefs=\"messages\"> <para> There are a number of messages which can be sent to the user, \"Higher!\", \"Lower!\" and \"Correct!\" </para> </callout> <callout arearefs=\"instructions\"> <para> As the user guesses, the range of numbers they can guess gets smaller - this sentance changes to make sure they know what range to guess in. </para> </callout> <callout arearefs=\"guess\"> <para> This input field is bound to a Web Bean, using the value expression. </para> </callout> <callout arearefs=\"validator\"> <para> A range validator is used to make sure the user doesn't accidentally input a number outside of the range in which they can guess - if the validator wasn't here, the user might use up a guess on an out of range number. </para> </callout> <callout !
arearefs=\"submit\"> <para> And, of course, there must be a way for the user to send their guess to the server. Here we bind to an action method on the Web Bean. </para> </callout> </calloutlist> </programlistingco>"
msgstr ""
-"<programlistingco> <areaspec> <area id=\"faces.servlet\" coords=\"12\"/> "
-"<area id=\"faces.servlet.mapping\" coords=\"18\"/> <area id=\"faces.default."
-"suffix\" coords=\"23\"/> <area id=\"session.timeout\" coords=\"28\"/> <area "
-"id=\"webbeans.listener\" coords=\"32\"/> </areaspec> <programlisting><![CDATA"
-"[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+"<programlistingco> <areaspec> <area id=\"faces.servlet\" coords=\"12\"/> <area id=\"faces.servlet.mapping\" coords=\"18\"/> <area id=\"faces.default.suffix\" coords=\"23\"/> <area id=\"session.timeout\" coords=\"28\"/> <area id=\"webbeans.listener\" coords=\"32\"/> </areaspec> <programlisting><![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"\n"
"<web-app version=\"2.5\"\n"
" xmlns=\"http://java.sun.com/xml/ns/javaee\"\n"
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun."
-"com/xml/ns/javaee/web-app_2_5.xsd\">\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\">\n"
" \n"
" <display-name>Web Beans Numbergues example</display-name>\n"
"\n"
@@ -551,31 +417,10 @@
" </session-config>\n"
" \n"
" <listener>\n"
-" <listener-class>org.jboss.webbeans.servlet.WebBeansListener</listener-"
-"class>\n"
+" <listener-class>org.jboss.webbeans.servlet.WebBeansListener</listener-class>\n"
" </listener>\n"
"\n"
-"</web-app>]]></programlisting> <calloutlist> <callout arearefs=\"faces."
-"servlet\"> <para> Enable and load the JSF servlet </para> </callout> "
-"<callout arearefs=\"faces.servlet.mapping\"> <para> Configure requests to "
-"<literal>.jsf</literal> pages to be handled by JSF </para> </callout> "
-"<callout arearefs=\"faces.default.suffix\"> <para> Tell JSF that we will be "
-"giving our source files (facelets) an extension of <literal>.jsf</literal> </"
-"para> </callout> <callout arearefs=\"session.timeout\"> <para> Configure a "
-"session timeout of 10 minutes </para> </callout> <callout arearefs="
-"\"webbeans.listener\"> <para> Configure the Web Beans listener, so that Web "
-"Beans services can be used in the servlet request </para> </callout> </"
-"calloutlist> </programlistingco> <note> <para> The only configuration "
-"required by the Web Beans RI in <literal>web.xml</literal> is to add the Web "
-"Beans listener. </para> <para> Whilst this demo is a JSF demo, you can use "
-"the Web Beans RI with any Servlet based web framework; just configure the "
-"Web Beans listener. </para> </note> <para> Let's take a look at the Facelet "
-"view: </para> <programlistingco> <areaspec> <area id=\"template\" coords=\"8"
-"\"/> <area id=\"messages\" coords=\"12\"/> <area id=\"instructions\" coords="
-"\"19\"/> <area id=\"guess\" coords=\"25\"/> <area id=\"validator\" coords="
-"\"29\"/> <area id=\"submit\" coords=\"32\"/> </areaspec> <programlisting><!"
-"[CDATA[<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" "
-"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
+"</web-app>]]></programlisting> <calloutlist> <callout arearefs=\"faces.servlet\"> <para> Enable and load the JSF servlet </para> </callout> <callout arearefs=\"faces.servlet.mapping\"> <para> Configure requests to <literal>.jsf</literal> pages to be handled by JSF </para> </callout> <callout arearefs=\"faces.default.suffix\"> <para> Tell JSF that we will be giving our source files (facelets) an extension of <literal>.jsf</literal> </para> </callout> <callout arearefs=\"session.timeout\"> <para> Configure a session timeout of 10 minutes </para> </callout> <callout arearefs=\"webbeans.listener\"> <para> Configure the Web Beans listener, so that Web Beans services can be used in the servlet request </para> </callout> </calloutlist> </programlistingco> <note> <para> The only configuration required by the Web Beans RI in <literal>web.xml</literal> is to add the Web Beans listener. </para> <para> Whilst this demo is a JSF demo, you can use the Web Beans RI with any Servlet based!
web framework; just configure the Web Beans listener. </para> </note> <para> Let's take a look at the Facelet view: </para> <programlistingco> <areaspec> <area id=\"template\" coords=\"8\"/> <area id=\"messages\" coords=\"12\"/> <area id=\"instructions\" coords=\"19\"/> <area id=\"guess\" coords=\"25\"/> <area id=\"validator\" coords=\"29\"/> <area id=\"submit\" coords=\"32\"/> </areaspec> <programlisting><![CDATA[<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
"<html xmlns=\"http://www.w3.org/1999/xhtml\"\n"
" xmlns:ui=\"http://java.sun.com/jsf/facelets\"\n"
" xmlns:h=\"http://java.sun.com/jsf/html\"\n"
@@ -588,15 +433,12 @@
" <h:form id=\"NumberGuessMain\">\n"
" <div style=\"color: red\">\n"
" <h:messages id=\"messages\" globalOnly=\"false\"/>\n"
-" <h:outputText id=\"Higher\" value=\"Higher!\" rendered=\"#{game."
-"number gt game.guess}\"/>\n"
-" <h:outputText id=\"Lower\" value=\"Lower!\" rendered=\"#{game."
-"number lt game.guess}\"/>\n"
+" <h:outputText id=\"Higher\" value=\"Higher!\" rendered=\"#{game.number gt game.guess}\"/>\n"
+" <h:outputText id=\"Lower\" value=\"Lower!\" rendered=\"#{game.number lt game.guess}\"/>\n"
" </div>\n"
" \n"
" <div>\n"
-" I'm thinking of a number between #{game.smallest} and #{game."
-"biggest}.\n"
+" I'm thinking of a number between #{game.smallest} and #{game.biggest}.\n"
" You have #{game.remainingGuesses} guesses.\n"
" </div>\n"
" \n"
@@ -617,34 +459,13 @@
" </h:form>\n"
" </ui:define>\n"
" </ui:composition>\n"
-"</html>]]></programlisting> <calloutlist> <callout arearefs=\"template\"> "
-"<para> Facelets is a templating language for JSF, here we are wrapping our "
-"page in a template which defines the header. </para> </callout> <callout "
-"arearefs=\"messages\"> <para> There are a number of messages which can be "
-"sent to the user, \"Higher!\", \"Lower!\" and \"Correct!\" </para> </"
-"callout> <callout arearefs=\"instructions\"> <para> As the user guesses, the "
-"range of numbers they can guess gets smaller - this sentance changes to make "
-"sure they know what range to guess in. </para> </callout> <callout arearefs="
-"\"guess\"> <para> This input field is bound to a Web Bean, using the value "
-"expression. </para> </callout> <callout arearefs=\"validator\"> <para> A "
-"range validator is used to make sure the user doesn't accidentally input a "
-"number outside of the range in which they can guess - if the validator "
-"wasn't here, the user might use up a guess on an out of range number. </"
-"para> </callout> <callout arearefs=\"submit\"> <para> And, of course, there "
-"must be a way for the user to send their guess to the server. Here we bind "
-"to an action method on the Web Bean. </para> </callout> </calloutlist> </"
-"programlistingco>"
+"</html>]]></programlisting> <calloutlist> <callout arearefs=\"template\"> <para> Facelets is a templating language for JSF, here we are wrapping our page in a template which defines the header. </para> </callout> <callout arearefs=\"messages\"> <para> There are a number of messages which can be sent to the user, \"Higher!\", \"Lower!\" and \"Correct!\" </para> </callout> <callout arearefs=\"instructions\"> <para> As the user guesses, the range of numbers they can guess gets smaller - this sentance changes to make sure they know what range to guess in. </para> </callout> <callout arearefs=\"guess\"> <para> This input field is bound to a Web Bean, using the value expression. </para> </callout> <callout arearefs=\"validator\"> <para> A range validator is used to make sure the user doesn't accidentally input a number outside of the range in which they can guess - if the validator wasn't here, the user might use up a guess on an out of range number. </para> </callout> <callout !
arearefs=\"submit\"> <para> And, of course, there must be a way for the user to send their guess to the server. Here we bind to an action method on the Web Bean. </para> </callout> </calloutlist> </programlistingco>"
#. Tag: para
#: ri.xml:299
#, no-c-format
-msgid ""
-"The example exists of 4 classes, the first two of which are binding types. "
-"First, there is the <literal>@Random</literal> binding type, used for "
-"injecting a random number:"
-msgstr ""
-"这个例子包括4个类,前面两个是绑定类型。首先,这有一个<literal>@Random</"
-"literal>绑定类型,用来注入一个随机数:"
+msgid "The example exists of 4 classes, the first two of which are binding types. First, there is the <literal>@Random</literal> binding type, used for injecting a random number:"
+msgstr "这个例子包括4个类,前面两个是绑定类型。首先,这有一个<literal>@Random</literal>绑定类型,用来注入一个随机数:"
#. Tag: programlisting
#: ri.xml:305
@@ -665,9 +486,7 @@
#. Tag: para
#: ri.xml:307
#, no-c-format
-msgid ""
-"There is also the <literal>@MaxNumber</literal> binding type, used for "
-"injecting the maximum number that can be injected:"
+msgid "There is also the <literal>@MaxNumber</literal> binding type, used for injecting the maximum number that can be injected:"
msgstr "这还有一个<literal>@MaxNumber</literal>绑定类型,用来注入一个最大值:"
#. Tag: programlisting
@@ -691,13 +510,8 @@
#. Tag: para
#: ri.xml:314
#, no-c-format
-msgid ""
-"The <literal>Generator</literal> class is responsible for creating the "
-"random number, via a producer method. It also exposes the maximum possible "
-"number via a producer method:"
-msgstr ""
-"<literal>Generator</literal>类通过一个生产者(producer)方法创建一个随机数。它"
-"也通过一个生产者方法暴露可能的最大值:"
+msgid "The <literal>Generator</literal> class is responsible for creating the random number, via a producer method. It also exposes the maximum possible number via a producer method:"
+msgstr "<literal>Generator</literal>类通过一个生产者(producer)方法创建一个随机数。它也通过一个生产者方法暴露可能的最大值:"
#. Tag: programlisting
#: ri.xml:320
@@ -706,8 +520,7 @@
"<![CDATA[@ApplicationScoped\n"
"public class Generator {\n"
" \n"
-" private java.util.Random random = new java.util.Random( System."
-"currentTimeMillis() );\n"
+" private java.util.Random random = new java.util.Random( System.currentTimeMillis() );\n"
" \n"
" private int maxNumber = 100;\n"
" \n"
@@ -730,8 +543,7 @@
"<![CDATA[@ApplicationScoped\n"
"public class Generator {\n"
" \n"
-" private java.util.Random random = new java.util.Random( System."
-"currentTimeMillis() );\n"
+" private java.util.Random random = new java.util.Random( System.currentTimeMillis() );\n"
" \n"
" private int maxNumber = 100;\n"
" \n"
@@ -754,35 +566,20 @@
#. Tag: para
#: ri.xml:322
#, no-c-format
-msgid ""
-"You'll notice that the <literal>Generator</literal> is application scoped; "
-"therefore we don't get a different random each time."
-msgstr ""
-"你会注意到<literal>Generator</literal>是应用范围的;因此我们不会每次都得到一"
-"个不同的随机对象。"
+msgid "You'll notice that the <literal>Generator</literal> is application scoped; therefore we don't get a different random each time."
+msgstr "你会注意到<literal>Generator</literal>是应用范围的;因此我们不会每次都得到一个不同的随机对象。"
#. Tag: para
#: ri.xml:327
#, no-c-format
-msgid ""
-"The final Web Bean in the application is the session scoped <literal>Game</"
-"literal>."
-msgstr ""
+msgid "The final Web Bean in the application is the session scoped <literal>Game</literal>."
+msgstr "最终的应用中的Web Bean是会话范围的 <literal>Game</literal> 。"
#. Tag: para
#: ri.xml:332
#, fuzzy, no-c-format
-msgid ""
-"You'll note that we've used the <literal>@Named</literal> annotation, so "
-"that we can use the bean through EL in the JSF page. Finally, we've used "
-"constructor injection to initialize the game with a random number. And of "
-"course, we need to tell the player when they've won, so we give feedback "
-"with a <literal>FacesMessage</literal>."
-msgstr ""
-"你也许注意到我们使用了 <literal>@Named</literal>注释,以便我们能够通过EL(表"
-"达式语言)在JSF页面中使用Bean。最后,我们通过构造器注入来初始化猜数字游戏并给"
-"它设一个随机数。当然,在玩家猜对数字后,我们需要告诉玩家他赢了,所以我们通过"
-"<literal>FacesMessage</literal>反馈给玩家一条信息。"
+msgid "You'll note that we've used the <literal>@Named</literal> annotation, so that we can use the bean through EL in the JSF page. Finally, we've used constructor injection to initialize the game with a random number. And of course, we need to tell the player when they've won, so we give feedback with a <literal>FacesMessage</literal>."
+msgstr "你也许注意到我们使用了 <literal>@Named</literal>注释,以便我们能够通过EL(表达式语言)在JSF页面中使用Bean。最后,我们通过构造器注入来初始化猜数字游戏并给它设一个随机数。当然,在玩家猜对数字后,我们需要告诉玩家他赢了,所以我们通过<literal>FacesMessage</literal>反馈给玩家一条信息。"
#. Tag: programlisting
#: ri.xml:340
@@ -866,8 +663,7 @@
" }\n"
" if (guess == number)\n"
" {\n"
-" FacesContext.getCurrentInstance().addMessage(null, new FacesMessage"
-"(\"Correct!\"));\n"
+" FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(\"Correct!\"));\n"
" }\n"
" remainingGuesses--;\n"
" return null;\n"
@@ -879,12 +675,105 @@
" this.smallest = 0;\n"
" this.guess = 0;\n"
" this.remainingGuesses = 10;\n"
-" this.number = manager.getInstanceByType(Integer.class, new "
-"AnnotationLiteral<Random>(){});\n"
+" this.number = manager.getInstanceByType(Integer.class, new AnnotationLiteral<Random>(){});\n"
" }\n"
" \n"
"}]]>"
msgstr ""
+"<![CDATA[package org.jboss.webbeans.examples.numberguess;\n"
+"\n"
+"\n"
+"import javax.annotation.PostConstruct;\n"
+"import javax.faces.application.FacesMessage;\n"
+"import javax.faces.context.FacesContext;\n"
+"import javax.webbeans.AnnotationLiteral;\n"
+"import javax.webbeans.Current;\n"
+"import javax.webbeans.Initializer;\n"
+"import javax.webbeans.Named;\n"
+"import javax.webbeans.SessionScoped;\n"
+"import javax.webbeans.manager.Manager;\n"
+"\n"
+"@Named\n"
+"@SessionScoped\n"
+"public class Game\n"
+"{\n"
+" private int number;\n"
+" \n"
+" private int guess;\n"
+" private int smallest;\n"
+" private int biggest;\n"
+" private int remainingGuesses;\n"
+" \n"
+" @Current Manager manager;\n"
+" \n"
+" public Game()\n"
+" {\n"
+" }\n"
+" \n"
+" @Initializer\n"
+" Game(@MaxNumber int maxNumber)\n"
+" { \n"
+" this.biggest = maxNumber;\n"
+" }\n"
+"\n"
+" public int getNumber()\n"
+" {\n"
+" return number;\n"
+" }\n"
+" \n"
+" public int getGuess()\n"
+" {\n"
+" return guess;\n"
+" }\n"
+" \n"
+" public void setGuess(int guess)\n"
+" {\n"
+" this.guess = guess;\n"
+" }\n"
+" \n"
+" public int getSmallest()\n"
+" {\n"
+" return smallest;\n"
+" }\n"
+" \n"
+" public int getBiggest()\n"
+" {\n"
+" return biggest;\n"
+" }\n"
+" \n"
+" public int getRemainingGuesses()\n"
+" {\n"
+" return remainingGuesses;\n"
+" }\n"
+" \n"
+" public String check()\n"
+" {\n"
+" if (guess>number)\n"
+" {\n"
+" biggest = guess - 1;\n"
+" }\n"
+" if (guess<number)\n"
+" {\n"
+" smallest = guess + 1;\n"
+" }\n"
+" if (guess == number)\n"
+" {\n"
+" FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(\"Correct!\"));\n"
+" }\n"
+" remainingGuesses--;\n"
+" return null;\n"
+" }\n"
+" \n"
+" @PostConstruct\n"
+" public void reset()\n"
+" {\n"
+" this.smallest = 0;\n"
+" this.guess = 0;\n"
+" this.remainingGuesses = 10;\n"
+" this.number = manager.getInstanceByType(Integer.class, new AnnotationLiteral<Random>(){});\n"
+" }\n"
+" \n"
+"}]]>"
#. Tag: title
#: ri.xml:344
@@ -895,40 +784,26 @@
#. Tag: para
#: ri.xml:346
#, no-c-format
-msgid ""
-"The translator example will take any sentences you enter, and translate them "
-"to Latin."
+msgid "The translator example will take any sentences you enter, and translate them to Latin."
msgstr "翻译器例子能够将你输入的句子翻译为拉丁文。"
#. Tag: para
#: ri.xml:351
#, fuzzy, no-c-format
-msgid ""
-"The translator example is built as an ear, and contains EJBs. As a result, "
-"it's structure is more complex than the numberguess example."
-msgstr ""
-"翻译器例子是一个EAR应用,包含EJBs和企业Beans。因此,它的结构比猜数字例子复"
-"杂。"
+msgid "The translator example is built as an ear, and contains EJBs. As a result, it's structure is more complex than the numberguess example."
+msgstr "翻译器例子是一个EAR应用,包含EJBs和企业Beans。因此,它的结构比猜数字例子复杂。"
#. Tag: para
#: ri.xml:357
#, no-c-format
-msgid ""
-"EJB 3.1 and Jave EE 6 allow you to package EJBs in a war, which will make "
-"this structure much simpler!"
+msgid "EJB 3.1 and Jave EE 6 allow you to package EJBs in a war, which will make this structure much simpler!"
msgstr "EJB3.1和Java EE 6允许你在WAR包中打包EJBs, 这将让这个结构更加简单!"
#. Tag: para
#: ri.xml:363
#, fuzzy, no-c-format
-msgid ""
-"First, let's take a look at the ear aggregator, which is located in "
-"<literal>webbeans-translator-ear</literal> module. Maven automatically "
-"generates the <literal>application.xml</literal> for us:"
-msgstr ""
-"首先,让我们看一下EAR聚合器,它位于<literal>webbeans-translator-ear</literal>"
-"模块下。Maven将为我们自动生成<literal>application.xml</literal>和"
-"<literal>jboss-app.xml</literal>文件:"
+msgid "First, let's take a look at the ear aggregator, which is located in <literal>webbeans-translator-ear</literal> module. Maven automatically generates the <literal>application.xml</literal> for us:"
+msgstr "首先,让我们看一下EAR聚合器,它位于<literal>webbeans-translator-ear</literal>模块下。Maven将为我们自动生成<literal>application.xml</literal>和<literal>jboss-app.xml</literal>文件:"
#. Tag: programlisting
#: ri.xml:369
@@ -960,8 +835,7 @@
" </webModule>\n"
" </modules>\n"
" <jboss>\n"
-" <loader-repository>webbeans.jboss.org:loader=webbeans-translator</"
-"loader-repository>\n"
+" <loader-repository>webbeans.jboss.org:loader=webbeans-translator</loader-repository>\n"
" </jboss>\n"
" </configuration>\n"
"</plugin>]]>"
@@ -969,24 +843,14 @@
#. Tag: para
#: ri.xml:371
#, fuzzy, no-c-format
-msgid ""
-"Here we set the context path, which gives us a nice url (<ulink url=\"http://"
-"localhost:8080/webbeans-translator\">http://localhost:8080/webbeans-"
-"translator</ulink>)."
-msgstr ""
-"我们需要在这里做些事情-首先我们需要设置上下文路径为一个不错的URL(<ulink url="
-"\"http://localhost:8080/webbeans-translator\">http://localhost:8080/webbeans-"
-"translator</ulink>),我们还需要将JBoss AS的类加载器隔离配置激活。"
+msgid "Here we set the context path, which gives us a nice url (<ulink url=\"http://localhost:8080/webbeans-translator\">http://localhost:8080/webbeans-translator</ulink>)."
+msgstr "我们需要在这里做些事情-首先我们需要设置上下文路径为一个不错的URL(<ulink url=\"http://localhost:8080/webbeans-translator\">http://localhost:8080/webbeans-translator</ulink>),我们还需要将JBoss AS的类加载器隔离配置激活。"
#. Tag: para
#: ri.xml:377
#, fuzzy, no-c-format
-msgid ""
-"If you aren't using Maven to generate these files, you would need "
-"<literal>META-INF/application.xml</literal>:"
-msgstr ""
-"如果你不使用Maven来生成这些文件,你将需要<literal>META-INF/jboss-app.xml</"
-"literal>:"
+msgid "If you aren't using Maven to generate these files, you would need <literal>META-INF/application.xml</literal>:"
+msgstr "如果你不使用Maven来生成这些文件,你将需要<literal>META-INF/jboss-app.xml</literal>:"
#. Tag: programlisting
#: ri.xml:382
@@ -995,12 +859,10 @@
"<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<application xmlns=\"http://java.sun.com/xml/ns/javaee\" \n"
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://"
-"java.sun.com/xml/ns/javaee/application_5.xsd\"\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd\"\n"
" version=\"5\">\n"
" <display-name>webbeans-translator-ear</display-name>\n"
-" <description>Ear Example for the reference implementation of JSR 299: Web "
-"Beans</description>\n"
+" <description>Ear Example for the reference implementation of JSR 299: Web Beans</description>\n"
" \n"
" <module>\n"
" <web>\n"
@@ -1016,12 +878,10 @@
"<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<application xmlns=\"http://java.sun.com/xml/ns/javaee\" \n"
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://"
-"java.sun.com/xml/ns/javaee/application_5.xsd\"\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd\"\n"
" version=\"5\">\n"
" <display-name>webbeans-translator-ear</display-name>\n"
-" <description>Ear Example for the reference implementation of JSR 299: Web "
-"Beans</description>\n"
+" <description>Ear Example for the reference implementation of JSR 299: Web Beans</description>\n"
" \n"
" <module>\n"
" <web>\n"
@@ -1037,25 +897,14 @@
#. Tag: para
#: ri.xml:385
#, fuzzy, no-c-format
-msgid ""
-"Next, lets look at the war. Just as in the numberguess example, we have a "
-"<literal>faces-config.xml</literal> (to enabled Facelets) and a <literal>web."
-"xml</literal> (to enable JSF) in <literal>WebContent/WEB-INF</literal>."
-msgstr ""
-"然后,我们看一下WAR包。在猜数字例子中,我们需要<literal>faces-config.xml</"
-"literal>(配置Facelets)和一个位于<literal>WebContent/WEB-INF</literal>下的"
-"<literal>web.xml</literal>(配置JSF并将Web Beans服务加入Servlet容器中)。"
+msgid "Next, lets look at the war. Just as in the numberguess example, we have a <literal>faces-config.xml</literal> (to enabled Facelets) and a <literal>web.xml</literal> (to enable JSF) in <literal>WebContent/WEB-INF</literal>."
+msgstr "然后,我们看一下WAR包。在猜数字例子中,我们需要<literal>faces-config.xml</literal>(配置Facelets)和一个位于<literal>WebContent/WEB-INF</literal>下的<literal>web.xml</literal>(配置JSF并将Web Beans服务加入Servlet容器中)。"
#. Tag: para
#: ri.xml:392
#, no-c-format
-msgid ""
-"More intersting is the facelet used to translate text. Just as in the "
-"numberguess example we have a template, which surrounds the form (ommitted "
-"here for brevity):"
-msgstr ""
-"更有意思的是用来翻译文本的facelet。在猜数字应用中我们有一个模板,这个模板套着"
-"表单(省略了表单):"
+msgid "More intersting is the facelet used to translate text. Just as in the numberguess example we have a template, which surrounds the form (ommitted here for brevity):"
+msgstr "更有意思的是用来翻译文本的facelet。在猜数字应用中我们有一个模板,这个模板套着表单(省略了表单):"
#. Tag: programlisting
#: ri.xml:398
@@ -1074,8 +923,7 @@
" </tr>\n"
" <tr>\n"
" <td>\n"
-" <h:inputTextarea id=\"text\" value=\"#{translator.text}\" "
-"required=\"true\" rows=\"5\" cols=\"80\" />\n"
+" <h:inputTextarea id=\"text\" value=\"#{translator.text}\" required=\"true\" rows=\"5\" cols=\"80\" />\n"
" </td>\n"
" <td>\n"
" <h:outputText value=\"#{translator.translatedText}\" />\n"
@@ -1083,8 +931,7 @@
" </tr>\n"
" </table>\n"
" <div>\n"
-" <h:commandButton id=\"button\" value=\"Translate\" action=\"#"
-"{translator.translate}\"/>\n"
+" <h:commandButton id=\"button\" value=\"Translate\" action=\"#{translator.translate}\"/>\n"
" </div>\n"
" \n"
"</h:form>]]>"
@@ -1102,8 +949,7 @@
" </tr>\n"
" <tr>\n"
" <td>\n"
-" <h:inputTextarea id=\"text\" value=\"#{translator.text}\" "
-"required=\"true\" rows=\"5\" cols=\"80\" />\n"
+" <h:inputTextarea id=\"text\" value=\"#{translator.text}\" required=\"true\" rows=\"5\" cols=\"80\" />\n"
" </td>\n"
" <td>\n"
" <h:outputText value=\"#{translator.translatedText}\" />\n"
@@ -1111,8 +957,7 @@
" </tr>\n"
" </table>\n"
" <div>\n"
-" <h:commandButton id=\"button\" value=\"Translate\" action=\"#"
-"{translator.translate}\"/>\n"
+" <h:commandButton id=\"button\" value=\"Translate\" action=\"#{translator.translate}\"/>\n"
" </div>\n"
" \n"
"</h:form>]]>"
@@ -1120,54 +965,26 @@
#. Tag: para
#: ri.xml:400
#, no-c-format
-msgid ""
-"The user can enter some text in the lefthand textarea, and hit the translate "
-"button to see the result to the right."
+msgid "The user can enter some text in the lefthand textarea, and hit the translate button to see the result to the right."
msgstr "用户可以在左手边的文本区输入一些文本,点击翻译按钮查看右边的翻译结果。"
#. Tag: para
#: ri.xml:405
#, fuzzy, no-c-format
-msgid ""
-"Finally, let's look at the ejb module, <literal>webbeans-translator-ejb</"
-"literal>. In <literal>src/main/resources/META-INF</literal> there is just an "
-"empty <literal>web-beans.xml</literal>, used to mark the archive as "
-"containing Web Beans."
-msgstr ""
-"最后,我们看一下EJB模块,<literal>webbeans-translator-ejb</literal>。在"
-"<literal>src/main/resources/META-INF</literal>下有两个配置文件,一个是空的"
-"<literal>web-beans.xml</literal>,用来标识这个档案包包含Web Beans,一个是"
-"<literal>ejb-jar.xml</literal>。Web Beans为所有的EJB提供注入和初始化服务,使"
-"用<literal>ejb-jar.xml</literal>文件来配置。你将在使用Web Beans的EJB项目中需"
-"要这些配置:"
+msgid "Finally, let's look at the ejb module, <literal>webbeans-translator-ejb</literal>. In <literal>src/main/resources/META-INF</literal> there is just an empty <literal>web-beans.xml</literal>, used to mark the archive as containing Web Beans."
+msgstr "最后,我们看一下EJB模块,<literal>webbeans-translator-ejb</literal>。在<literal>src/main/resources/META-INF</literal>下有两个配置文件,一个是空的<literal>web-beans.xml</literal>,用来标识这个档案包包含Web Beans,一个是<literal>ejb-jar.xml</literal>。Web Beans为所有的EJB提供注入和初始化服务,使用<literal>ejb-jar.xml</literal>文件来配置。你将在使用Web Beans的EJB项目中需要这些配置:"
#. Tag: para
#: ri.xml:413
#, fuzzy, no-c-format
-msgid ""
-"We've saved the most interesting bit to last, the code! The project has two "
-"simple beans, <literal>SentenceParser</literal> and <literal>TextTranslator</"
-"literal> and two enterprise beans, <literal>TranslatorControllerBean</"
-"literal> and <literal>SentenceTranslator</literal>. You should be getting "
-"quite familiar with what a Web Bean looks like by now, so we'll just "
-"highlight the most interesting bits here."
-msgstr ""
-"我们将最有意思的部分放在最后,那就是代码!这个例子有两个简单Beans, "
-"<literal>SentanceParser</literal>和<literal>TextTranslator</literal>,还有两"
-"个企业Beans,<literal>TanslatorControllerBean</literal>和"
-"<literal>SentenceTranslator</literal>。现在你应该对Web Beans有点熟悉了,我们"
-"在这里着重最有意思的部分。"
+msgid "We've saved the most interesting bit to last, the code! The project has two simple beans, <literal>SentenceParser</literal> and <literal>TextTranslator</literal> and two enterprise beans, <literal>TranslatorControllerBean</literal> and <literal>SentenceTranslator</literal>. You should be getting quite familiar with what a Web Bean looks like by now, so we'll just highlight the most interesting bits here."
+msgstr "我们将最有意思的部分放在最后,那就是代码!这个例子有两个简单Beans, <literal>SentanceParser</literal>和<literal>TextTranslator</literal>,还有两个企业Beans,<literal>TanslatorControllerBean</literal>和<literal>SentenceTranslator</literal>。现在你应该对Web Beans有点熟悉了,我们在这里着重最有意思的部分。"
#. Tag: para
#: ri.xml:423
#, fuzzy, no-c-format
-msgid ""
-"Both <literal>SentenceParser</literal> and <literal>TextTranslator</literal> "
-"are dependent beans, and <literal>TextTranslator</literal> uses constructor "
-"initialization:"
-msgstr ""
-"<literal>SentanceParser</literal>和<literal>TextTranslator</literal>是相互依"
-"赖的Beans,<literal>TextTranslator</literal>使用构造器初始化:"
+msgid "Both <literal>SentenceParser</literal> and <literal>TextTranslator</literal> are dependent beans, and <literal>TextTranslator</literal> uses constructor initialization:"
+msgstr "<literal>SentanceParser</literal>和<literal>TextTranslator</literal>是相互依赖的Beans,<literal>TextTranslator</literal>使用构造器初始化:"
#. Tag: programlisting
#: ri.xml:429
@@ -1178,8 +995,7 @@
" private Translator sentenceTranslator; \n"
" \n"
" @Initializer\n"
-" TextTranslator(SentenceParser sentenceParser, Translator "
-"sentenceTranslator) \n"
+" TextTranslator(SentenceParser sentenceParser, Translator sentenceTranslator) \n"
" { \n"
" this.sentenceParser = sentenceParser; \n"
" this.sentenceTranslator = sentenceTranslator;]]>"
@@ -1189,8 +1005,7 @@
" private Translator sentenceTranslator; \n"
" \n"
" @Initializer\n"
-" TextTranslator(SentenceParser sentenceParser, Translator "
-"sentenceTranslator) \n"
+" TextTranslator(SentenceParser sentenceParser, Translator sentenceTranslator) \n"
" { \n"
" this.sentenceParser = sentenceParser; \n"
" this.sentenceTranslator = sentenceTranslator;]]>"
@@ -1198,25 +1013,14 @@
#. Tag: para
#: ri.xml:431
#, no-c-format
-msgid ""
-"<literal>TextTranslator</literal> is a stateless bean (with a local business "
-"interface), where the magic happens - of course, we couldn't develop a full "
-"translator, but we gave it a good go!"
-msgstr ""
-"<literal>TextTranslator</literal>是一个无状态Bean(拥有一个本地业务接口),这"
-"里是魔术展现的地方-当然,我们不会开发一个完整的翻译器,但我们可以开发一个不错"
-"的小玩意!"
+msgid "<literal>TextTranslator</literal> is a stateless bean (with a local business interface), where the magic happens - of course, we couldn't develop a full translator, but we gave it a good go!"
+msgstr "<literal>TextTranslator</literal>是一个无状态Bean(拥有一个本地业务接口),这里是魔术展现的地方-当然,我们不会开发一个完整的翻译器,但我们可以开发一个不错的小玩意!"
#. Tag: para
#: ri.xml:437
#, no-c-format
-msgid ""
-"Finally, there is UI orientated controller, that collects the text from the "
-"user, and dispatches it to the translator. This is a request scoped, named, "
-"stateful session bean, which injects the translator."
-msgstr ""
-"最后,这里又要一个面向UI的控制器,从用户输入处搜集文本,转发给翻译器。这个控"
-"制器是请求范围的,具名的,有状态的会话Bean,它可以将翻译器注入进来。"
+msgid "Finally, there is UI orientated controller, that collects the text from the user, and dispatches it to the translator. This is a request scoped, named, stateful session bean, which injects the translator."
+msgstr "最后,这里又要一个面向UI的控制器,从用户输入处搜集文本,转发给翻译器。这个控制器是请求范围的,具名的,有状态的会话Bean,它可以将翻译器注入进来。"
#. Tag: programlisting
#: ri.xml:443
@@ -1269,34 +1073,20 @@
#. Tag: para
#: ri.xml:455
#, no-c-format
-msgid ""
-"The Web Beans manager will call the remove method for you when the bean is "
-"destroyed; in this case at the end of the request."
-msgstr ""
-"Web Beans管理器在这个bean销毁的时候调用remove方法;在这个例子中是请求结束的时"
-"候。"
+msgid "The Web Beans manager will call the remove method for you when the bean is destroyed; in this case at the end of the request."
+msgstr "Web Beans管理器在这个bean销毁的时候调用remove方法;在这个例子中是请求结束的时候。"
#. Tag: para
#: ri.xml:461
#, no-c-format
-msgid ""
-"That concludes our short tour of the Web Beans RI examples. For more on the "
-"RI, or to help out, please visit <ulink url=\"http://www.seamframework.org/"
-"WebBeans/Development\">http://www.seamframework.org/WebBeans/Development</"
-"ulink>."
-msgstr ""
-"Web Beans参考实现的例子到此结束。想要获得关于参考实现更多的知识或者帮助,请访"
-"问<ulink url=\"http://www.seamframework.org/WebBeans/Development\">http://"
-"www.seamframework.org/WebBeans/Development</ulink>。"
+msgid "That concludes our short tour of the Web Beans RI examples. For more on the RI, or to help out, please visit <ulink url=\"http://www.seamframework.org/WebBeans/Development\">http://www.seamframework.org/WebBeans/Development</ulink>."
+msgstr "Web Beans参考实现的例子到此结束。想要获得关于参考实现更多的知识或者帮助,请访问<ulink url=\"http://www.seamframework.org/WebBeans/Development\">http://www.seamframework.org/WebBeans/Development</ulink>。"
#. Tag: para
#: ri.xml:467
#, no-c-format
-msgid ""
-"We need help in all areas - bug fixing, writing new features, writing "
-"examples and translating this reference guide."
-msgstr ""
-"我们在各个方面都需要帮助-bug修复,新特性开发,例子开发和参考指南的翻译等等。"
+msgid "We need help in all areas - bug fixing, writing new features, writing examples and translating this reference guide."
+msgstr "我们在各个方面都需要帮助-bug修复,新特性开发,例子开发和参考指南的翻译等等。"
#~ msgid ""
#~ "The final Web Bean in the application is the session scoped "
@@ -1307,7 +1097,6 @@
#~ "最后,应用的Web Bean是会话范围的 <literal>Game</literal>。通过将 "
#~ "<literal>Game</literal>的范围设为会话范围,你可以为每个浏览器会话启动一个"
#~ "猜数字游戏。你可以简单地添加一个复位按钮-对于读者来说是一个很好的练习 :)"
-
#~ msgid ""
#~ "<![CDATA[@Named\n"
#~ "@SessionScoped\n"
@@ -1386,7 +1175,6 @@
#~ " }\n"
#~ " \n"
#~ "}]]>"
-
#~ msgid ""
#~ "<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
#~ "<!DOCTYPE jboss-app\n"
@@ -1405,10 +1193,8 @@
#~ " <loader-repository>webbeans.jboss.org:loader=webbeans-translator</"
#~ "loader-repository>\n"
#~ "</jboss-app>]]>"
-
#~ msgid "and <literal>META-INF/application.xml</literal>:"
#~ msgstr "和 <literal>META-INF/application.xml</literal>:"
-
#~ msgid ""
#~ "<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
#~ "<ejb-jar xmlns=\"http://java.sun.com/xml/ns/javaee\" \n"
@@ -1457,3 +1243,4 @@
#~ " </assembly-descriptor>\n"
#~ " \n"
#~ "</ejb-jar>]]>"
+
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1954 - doc/trunk/reference/zh-CN.
by webbeans-commits@lists.jboss.org
Author: alartin
Date: 2009-03-13 02:13:05 -0400 (Fri, 13 Mar 2009)
New Revision: 1954
Modified:
doc/trunk/reference/zh-CN/intro.po
Log:
Modified: doc/trunk/reference/zh-CN/intro.po
===================================================================
--- doc/trunk/reference/zh-CN/intro.po 2009-03-13 06:09:01 UTC (rev 1953)
+++ doc/trunk/reference/zh-CN/intro.po 2009-03-13 06:13:05 UTC (rev 1954)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-02-07 18:51+0000\n"
-"PO-Revision-Date: 2009-02-03 15:24+0800\n"
+"PO-Revision-Date: 2009-03-13 14:09+0800\n"
"Last-Translator: Sean Wu <alartin(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -22,17 +22,8 @@
#. Tag: para
#: intro.xml:6
#, no-c-format
-msgid ""
-"So you're already keen to get started writing your first Web Bean? Or "
-"perhaps you're skeptical, wondering what kinds of hoops the Web Beans "
-"specification will make you jump through! The good news is that you've "
-"probably already written and used hundreds, perhaps thousands of Web Beans. "
-"You might not even remember the first Web Bean you wrote."
-msgstr ""
-"你是否已经迫不及待想要开始编写你的第一个Web Bean了?或许,你仍旧抱有怀疑态"
-"度,想要知道Web Beans规范会给出什么样的圈套让你跳。好消息是你也许已经编写并且"
-"使用了好几百个或者好几千个Web Bean了。你也许甚至想不起来你写的第一个Web Bean"
-"了。"
+msgid "So you're already keen to get started writing your first Web Bean? Or perhaps you're skeptical, wondering what kinds of hoops the Web Beans specification will make you jump through! The good news is that you've probably already written and used hundreds, perhaps thousands of Web Beans. You might not even remember the first Web Bean you wrote."
+msgstr "你是否已经迫不及待想要开始编写你的第一个Web Bean了?或许,你仍旧抱有怀疑态度,想要知道Web Beans规范会给出什么样的圈套让你跳。好消息是你也许已经编写并且使用了好几百个或者好几千个Web Bean了。你也许甚至想不起来你写的第一个Web Bean了。"
#. Tag: title
#: intro.xml:13
@@ -43,33 +34,14 @@
#. Tag: para
#: intro.xml:15
#, fuzzy, no-c-format
-msgid ""
-"With certain, very special exceptions, every Java class with a constructor "
-"that accepts no parameters is a Web Bean. That includes every JavaBean. "
-"Furthermore, every EJB 3-style session bean is a Web Bean. Sure, the "
-"JavaBeans and EJBs you've been writing every day have not been able to take "
-"advantage of the new services defined by the Web Beans specification, but "
-"you'll be able to use every one of them as Web Beans — injecting them "
-"into other Web Beans, configuring them via the Web Beans XML configuration "
-"facility, even adding interceptors and decorators to them — without "
-"touching your existing code."
-msgstr ""
-"除非特殊情况,每个具有一个非参构造器的Java类都可以是一个Web Bean。这包括了每"
-"个JavaBean, 并且每个EJB3的会话Bean都是一个Web Bean。当然,你每天已经写过的"
-"JavaBean和EJB无法使用Web Beans规范定义的新服务,但是你能够通过Web Beans的XML"
-"配置将这些组件配置为Web Bean,然后将其注入到其他Web Bean中。你甚至可以不用修"
-"改已有代码就可以为其添加拦截器和装饰器。"
+msgid "With certain, very special exceptions, every Java class with a constructor that accepts no parameters is a Web Bean. That includes every JavaBean. Furthermore, every EJB 3-style session bean is a Web Bean. Sure, the JavaBeans and EJBs you've been writing every day have not been able to take advantage of the new services defined by the Web Beans specification, but you'll be able to use every one of them as Web Beans — injecting them into other Web Beans, configuring them via the Web Beans XML configuration facility, even adding interceptors and decorators to them — without touching your existing code."
+msgstr "除非特殊情况,每个具有一个非参构造器的Java类都可以是一个Web Bean。这包括了每个JavaBean, 并且每个EJB3的会话Bean都是一个Web Bean。当然,你每天已经写过的JavaBean和EJB无法使用Web Beans规范定义的新服务,但是你能够通过Web Beans的XML配置将这些组件配置为Web Bean,然后将其注入到其他Web Bean中。你甚至可以不用修改已有代码就可以为其添加拦截器和装饰器。"
#. Tag: para
#: intro.xml:25
#, no-c-format
-msgid ""
-"Suppose that we have two existing Java classes, that we've been using for "
-"years in various applications. The first class parses a string into a list "
-"of sentences:"
-msgstr ""
-"假定我们有两个已经写好的Java类,我们已经在不同的应用中使用它们好多年了。第一"
-"个类将一个字符串解析为一个句子列表:"
+msgid "Suppose that we have two existing Java classes, that we've been using for years in various applications. The first class parses a string into a list of sentences:"
+msgstr "假定我们有两个已经写好的Java类,我们已经在不同的应用中使用它们好多年了。第一个类将一个字符串解析为一个句子列表:"
#. Tag: programlisting
#: intro.xml:29
@@ -86,13 +58,8 @@
#. Tag: para
#: intro.xml:31
#, no-c-format
-msgid ""
-"The second existing class is a stateless session bean front-end for an "
-"external system that is able to translate sentences from one language to "
-"another:"
-msgstr ""
-"第二个已有类是一个无状态的会话Bean,这个会话Bean作为一个外部系统的前端,能够"
-"将句子从一种语言翻译到另一个语言:"
+msgid "The second existing class is a stateless session bean front-end for an external system that is able to translate sentences from one language to another:"
+msgstr "第二个已有类是一个无状态的会话Bean,这个会话Bean作为一个外部系统的前端,能够将句子从一种语言翻译到另一个语言:"
#. Tag: programlisting
#: intro.xml:35
@@ -131,12 +98,8 @@
#. Tag: para
#: intro.xml:41
#, no-c-format
-msgid ""
-"Unfortunately, we don't have a preexisting class that translates whole text "
-"documents. So let's write a Web Bean that does this job:"
-msgstr ""
-"不幸的是,我们没有Java类能够翻译整个文档。因此,让我们写一个Web Bean来做这个"
-"工作:"
+msgid "Unfortunately, we don't have a preexisting class that translates whole text documents. So let's write a Web Bean that does this job:"
+msgstr "不幸的是,我们没有Java类能够翻译整个文档。因此,让我们写一个Web Bean来做这个工作:"
#. Tag: programlisting
#: intro.xml:44
@@ -148,8 +111,7 @@
" private Translator sentenceTranslator;\n"
" \n"
" @Initializer\n"
-" TextTranslator(SentenceParser sentenceParser, Translator "
-"sentenceTranslator) {\n"
+" TextTranslator(SentenceParser sentenceParser, Translator sentenceTranslator) {\n"
" this.sentenceParser = sentenceParser;\n"
" this.sentenceTranslator = sentenceTranslator;\n"
" }\n"
@@ -170,8 +132,7 @@
" private Translator sentenceTranslator;\n"
" \n"
" @Initializer\n"
-" TextTranslator(SentenceParser sentenceParser, Translator "
-"sentenceTranslator) {\n"
+" TextTranslator(SentenceParser sentenceParser, Translator sentenceTranslator) {\n"
" this.sentenceParser = sentenceParser;\n"
" this.sentenceTranslator = sentenceTranslator;\n"
" }\n"
@@ -189,12 +150,8 @@
#. Tag: para
#: intro.xml:46
#, no-c-format
-msgid ""
-"We may obtain an instance of <literal>TextTranslator</literal> by injecting "
-"it into a Web Bean, Servlet or EJB:"
-msgstr ""
-"通过将其注入到一个Web Bean,Servlet或者EJB,我们能够获得一个 "
-"<literal>TextTranslator</literal>的实例:"
+msgid "We may obtain an instance of <literal>TextTranslator</literal> by injecting it into a Web Bean, Servlet or EJB:"
+msgstr "通过将其注入到一个Web Bean,Servlet或者EJB,我们能够获得一个 <literal>TextTranslator</literal>的实例:"
#. Tag: programlisting
#: intro.xml:49
@@ -213,69 +170,32 @@
#. Tag: para
#: intro.xml:51
#, no-c-format
-msgid ""
-"Alternatively, we may obtain an instance by directly calling a method of the "
-"Web Bean manager:"
+msgid "Alternatively, we may obtain an instance by directly calling a method of the Web Bean manager:"
msgstr "或者,我们可以直接调用Web Bean管理器的方法获得这个实例:"
#. Tag: programlisting
#: intro.xml:54
#, no-c-format
-msgid ""
-"<![CDATA[TextTranslator tt = manager.getInstanceByType(TextTranslator."
-"class);]]>"
-msgstr ""
-"<![CDATA[TextTranslator tt = manager.getInstanceByType(TextTranslator."
-"class);]]>"
+msgid "<![CDATA[TextTranslator tt = manager.getInstanceByType(TextTranslator.class);]]>"
+msgstr "<![CDATA[TextTranslator tt = manager.getInstanceByType(TextTranslator.class);]]>"
#. Tag: para
#: intro.xml:56
#, no-c-format
-msgid ""
-"But wait: <literal>TextTranslator</literal> does not have a constructor with "
-"no parameters! Is it still a Web Bean? Well, a class that does not have a "
-"constructor with no parameters can still be a Web Bean if it has a "
-"constructor annotated <literal>@Initializer</literal>."
-msgstr ""
-"但是,等一下:<literal>TextTranslator</literal>并没有一个无参构造器!它仍然是"
-"一个Web Bean么?好吧,一个没有无参构造器的类依然能够成为一个Web Bean,只要你"
-"在它的一个构造器上使用<literal>@Initializer</literal>注释即可。"
+msgid "But wait: <literal>TextTranslator</literal> does not have a constructor with no parameters! Is it still a Web Bean? Well, a class that does not have a constructor with no parameters can still be a Web Bean if it has a constructor annotated <literal>@Initializer</literal>."
+msgstr "但是,等一下:<literal>TextTranslator</literal>并没有一个无参构造器!它仍然是一个Web Bean么?好吧,一个没有无参构造器的类依然能够成为一个Web Bean,只要你在它的一个构造器上使用<literal>@Initializer</literal>注释即可。"
#. Tag: para
#: intro.xml:61
#, no-c-format
-msgid ""
-"As you've guessed, the <literal>@Initializer</literal> annotation has "
-"something to do with dependency injection! <literal>@Initializer</literal> "
-"may be applied to a constructor or method of a Web Bean, and tells the Web "
-"Bean manager to call that constructor or method when instantiating the Web "
-"Bean. The Web Bean manager will inject other Web Beans to the parameters of "
-"the constructor or method."
-msgstr ""
-"就像你猜到的一样, <literal>@Initializer</literal>注释和依赖注入有关! "
-"<literal>@Initializer</literal>可以应用到一个Web Bean的构造器或者方法上,它告"
-"诉Web Bean管理器在初始化一个Web Bean的时候去调用这个构造器或者方法。Web Beam"
-"管理器能够将其他的Web Bean注入到构造器或者方法的参数中。"
+msgid "As you've guessed, the <literal>@Initializer</literal> annotation has something to do with dependency injection! <literal>@Initializer</literal> may be applied to a constructor or method of a Web Bean, and tells the Web Bean manager to call that constructor or method when instantiating the Web Bean. The Web Bean manager will inject other Web Beans to the parameters of the constructor or method."
+msgstr "就像你猜到的一样, <literal>@Initializer</literal>注释和依赖注入有关! <literal>@Initializer</literal>可以应用到一个Web Bean的构造器或者方法上,它告诉Web Bean管理器在初始化一个Web Bean的时候去调用这个构造器或者方法。Web Beam管理器能够将其他的Web Bean注入到构造器或者方法的参数中。"
#. Tag: para
#: intro.xml:68
#, fuzzy, no-c-format
-msgid ""
-"At system initialization time, the Web Bean manager must validate that "
-"exactly one Web Bean exists which satisfies each injection point. In our "
-"example, if no implementation of <literal>Translator</literal> available "
-"— if the <literal>SentenceTranslator</literal> EJB was not deployed "
-"— the Web Bean manager would throw an "
-"<literal>UnsatisfiedDependencyException</literal>. If more than one "
-"implementation of <literal>Translator</literal> was available, the Web Bean "
-"manager would throw an <literal>AmbiguousDependencyException</literal>."
-msgstr ""
-"在系统初始化的时候,Web Bean管理器必须验证只存在一个Web Bean能够满足每个注入"
-"点。在我们的例子中,如果没有<literal>Translator</literal>实现—如果"
-"<literal>SentenceTranslator</literal> EJB没有被部署—Web Bean管理器将会抛"
-"出一个<literal>UnsatisfiedDependencyException</literal>异常。如果多于一个"
-"<literal>Translator</literal>实现,Web Bean管理器将会抛出一个"
-"<literal>AmbiguousDependencyException</literal>异常。"
+msgid "At system initialization time, the Web Bean manager must validate that exactly one Web Bean exists which satisfies each injection point. In our example, if no implementation of <literal>Translator</literal> available — if the <literal>SentenceTranslator</literal> EJB was not deployed — the Web Bean manager would throw an <literal>UnsatisfiedDependencyException</literal>. If more than one implementation of <literal>Translator</literal> was available, the Web Bean manager would throw an <literal>AmbiguousDependencyException</literal>."
+msgstr "在系统初始化的时候,Web Bean管理器必须验证只存在一个Web Bean能够满足每个注入点。在我们的例子中,如果没有<literal>Translator</literal>实现—如果<literal>SentenceTranslator</literal> EJB没有被部署—Web Bean管理器将会抛出一个<literal>UnsatisfiedDependencyException</literal>异常。如果多于一个<literal>Translator</literal>实现,Web Bean管理器将会抛出一个<literal>AmbiguousDependencyException</literal>异常。"
#. Tag: title
#: intro.xml:80
@@ -292,50 +212,20 @@
#. Tag: para
#: intro.xml:84
#, no-c-format
-msgid ""
-"A Web Bean is an application class that contains business logic. A Web Bean "
-"may be called directly from Java code, or it may be invoked via Unified EL. "
-"A Web Bean may access transactional resources. Dependencies between Web "
-"Beans are managed automatically by the Web Bean manager. Most Web Beans are "
-"<emphasis>stateful</emphasis> and <emphasis>contextual</emphasis>. The "
-"lifecycle of a Web Bean is always managed by the Web Bean manager."
-msgstr ""
-"一个Web Bean是一个包含业务逻辑的应用类。一个Web Bean能够从Java代码中直接调"
-"用,也可以通过统一表达语言调用。一个Web Bean可以访问事务性的资源。Web Bean之"
-"间的依赖通过Web Bean管理器自动管理。大部分Web Bean是具有 <emphasis>状态</"
-"emphasis>和<emphasis>上下文</emphasis>的。Web Bean的生命周期总是通过Web Bean"
-"管理器进行管理。"
+msgid "A Web Bean is an application class that contains business logic. A Web Bean may be called directly from Java code, or it may be invoked via Unified EL. A Web Bean may access transactional resources. Dependencies between Web Beans are managed automatically by the Web Bean manager. Most Web Beans are <emphasis>stateful</emphasis> and <emphasis>contextual</emphasis>. The lifecycle of a Web Bean is always managed by the Web Bean manager."
+msgstr "一个Web Bean是一个包含业务逻辑的应用类。一个Web Bean能够从Java代码中直接调用,也可以通过统一表达语言调用。一个Web Bean可以访问事务性的资源。Web Bean之间的依赖通过Web Bean管理器自动管理。大部分Web Bean是具有 <emphasis>状态</emphasis>和<emphasis>上下文</emphasis>的。Web Bean的生命周期总是通过Web Bean管理器进行管理。"
#. Tag: para
#: intro.xml:91
#, no-c-format
-msgid ""
-"Let's back up a second. What does it really mean to be \"contextual\"? Since "
-"Web Beans may be stateful, it matters <emphasis>which</emphasis> bean "
-"instance I have. Unlike a stateless component model (for example, stateless "
-"session beans) or a singleton component model (such as servlets, or "
-"singleton beans), different clients of a Web Bean see the Web Bean in "
-"different states. The client-visible state depends upon which instance of "
-"the Web Bean the client has a reference to."
-msgstr ""
-"让我们后退一步。\"上下文\"究竟意味着什么?既然Web Beans可以是有状态的,那它关"
-"系到我到底拥有<emphasis>哪个</emphasis>Bean实例。和无状态组件模型(例如无状态"
-"的会话Bean)或者一个单例模型组件(例如Servlet或者单例Bean)不同,一个Web Bean"
-"的不同客户端看到的Web Bean的状态是不同的。客户端所见的状态取决于这个客户端拥"
-"有的是哪一个Web Bean实例的引用。"
+msgid "Let's back up a second. What does it really mean to be \"contextual\"? Since Web Beans may be stateful, it matters <emphasis>which</emphasis> bean instance I have. Unlike a stateless component model (for example, stateless session beans) or a singleton component model (such as servlets, or singleton beans), different clients of a Web Bean see the Web Bean in different states. The client-visible state depends upon which instance of the Web Bean the client has a reference to."
+msgstr "让我们后退一步。\"上下文\"究竟意味着什么?既然Web Beans可以是有状态的,那它关系到我到底拥有<emphasis>哪个</emphasis>Bean实例。和无状态组件模型(例如无状态的会话Bean)或者一个单例模型组件(例如Servlet或者单例Bean)不同,一个Web Bean的不同客户端看到的Web Bean的状态是不同的。客户端所见的状态取决于这个客户端拥有的是哪一个Web Bean实例的引用。"
#. Tag: para
#: intro.xml:98
#, no-c-format
-msgid ""
-"However, like a stateless or singleton model, but <emphasis>unlike</"
-"emphasis> stateful session beans, the client does not control the lifecycle "
-"of the instance by explicitly creating and destroying it. Instead, the "
-"<emphasis>scope</emphasis> of the Web Bean determines:"
-msgstr ""
-"然而,Web Bean像无状态或者单例模型那样,却和有状态的会话Bean<emphasis>不同</"
-"emphasis>,客户端无法通过显式地创建或者销毁它来控制实例的生命周期。取而代之,"
-"Web Bean的<emphasis>范围</emphasis>决定了:"
+msgid "However, like a stateless or singleton model, but <emphasis>unlike</emphasis> stateful session beans, the client does not control the lifecycle of the instance by explicitly creating and destroying it. Instead, the <emphasis>scope</emphasis> of the Web Bean determines:"
+msgstr "然而,Web Bean像无状态或者单例模型那样,却和有状态的会话Bean<emphasis>不同</emphasis>,客户端无法通过显式地创建或者销毁它来控制实例的生命周期。取而代之,Web Bean的<emphasis>范围</emphasis>决定了:"
#. Tag: para
#: intro.xml:105
@@ -346,53 +236,26 @@
#. Tag: para
#: intro.xml:108
#, no-c-format
-msgid ""
-"which clients share a reference to a particular instance of the Web Bean."
+msgid "which clients share a reference to a particular instance of the Web Bean."
msgstr "哪些客户端共享Web Bean特定实例的一个引用。"
#. Tag: para
#: intro.xml:113
#, no-c-format
-msgid ""
-"For a given thread in a Web Beans application, there may be an "
-"<emphasis>active context</emphasis> associated with the scope of the Web "
-"Bean. This context may be unique to the thread (for example, if the Web Bean "
-"is request scoped), or it may be shared with certain other threads (for "
-"example, if the Web Bean is session scoped) or even all other threads (if it "
-"is application scoped)."
-msgstr ""
-"给定一个Web Bean应用的线程,将可能有一个<emphasis>激活的上下文</emphasis>和"
-"Web Bean的范围关联。这个上下文可能对于该线程是唯一的(例如,如果这个Web Bean"
-"是请求范围的),或者这个上下文可能被某些其他线程共享(例如,如果这个Web Bean"
-"是会话范围的),这个上下文甚至可以被所有线程共享(例如,这个Web Bean是应用范"
-"围的)。"
+msgid "For a given thread in a Web Beans application, there may be an <emphasis>active context</emphasis> associated with the scope of the Web Bean. This context may be unique to the thread (for example, if the Web Bean is request scoped), or it may be shared with certain other threads (for example, if the Web Bean is session scoped) or even all other threads (if it is application scoped)."
+msgstr "给定一个Web Bean应用的线程,将可能有一个<emphasis>激活的上下文</emphasis>和Web Bean的范围关联。这个上下文可能对于该线程是唯一的(例如,如果这个Web Bean是请求范围的),或者这个上下文可能被某些其他线程共享(例如,如果这个Web Bean是会话范围的),这个上下文甚至可以被所有线程共享(例如,这个Web Bean是应用范围的)。"
#. Tag: para
#: intro.xml:119
#, no-c-format
-msgid ""
-"Clients (for example, other Web Beans) executing in the same context will "
-"see the same instance of the Web Bean. But clients in a different context "
-"will see a different instance."
-msgstr ""
-"在同一个上下文中执行的客户端(例如,其他的Web Bean)看到的是同一个Web Bean的"
-"实例。但是不同的上下文中的客户端看到的是不同的实例。"
+msgid "Clients (for example, other Web Beans) executing in the same context will see the same instance of the Web Bean. But clients in a different context will see a different instance."
+msgstr "在同一个上下文中执行的客户端(例如,其他的Web Bean)看到的是同一个Web Bean的实例。但是不同的上下文中的客户端看到的是不同的实例。"
#. Tag: para
#: intro.xml:123
#, no-c-format
-msgid ""
-"One great advantage of the contextual model is that it allows stateful Web "
-"Beans to be treated like services! The client need not concern itself with "
-"managing the lifecycle of the Web Bean it is using, <emphasis>nor does it "
-"even need to know what that lifecyle is.</emphasis> Web Beans interact by "
-"passing messages, and the Web Bean implementations define the lifecycle of "
-"their own state. The Web Beans are loosely coupled because:"
-msgstr ""
-"具备上下文的模型带来的一个巨大优点是它允许有状态的Web Bean可以像服务一样使"
-"用!客户端不需要关注本身以及它使用的Web Bean的生命周期,<emphasis>甚至它根本"
-"不需要知道生命周期是什么</emphasis>。Web Bean通过传递消息来交互,Web Bean的实"
-"现定义了他们自己状态的生命周期。Web Bean是松耦合的,因为:"
+msgid "One great advantage of the contextual model is that it allows stateful Web Beans to be treated like services! The client need not concern itself with managing the lifecycle of the Web Bean it is using, <emphasis>nor does it even need to know what that lifecyle is.</emphasis> Web Beans interact by passing messages, and the Web Bean implementations define the lifecycle of their own state. The Web Beans are loosely coupled because:"
+msgstr "具备上下文的模型带来的一个巨大优点是它允许有状态的Web Bean可以像服务一样使用!客户端不需要关注本身以及它使用的Web Bean的生命周期,<emphasis>甚至它根本不需要知道生命周期是什么</emphasis>。Web Bean通过传递消息来交互,Web Bean的实现定义了他们自己状态的生命周期。Web Bean是松耦合的,因为:"
#. Tag: para
#: intro.xml:132
@@ -409,30 +272,14 @@
#. Tag: para
#: intro.xml:139
#, no-c-format
-msgid ""
-"We can replace one Web Bean with a different Web Bean that implements the "
-"same API and has a different lifecycle (a different scope) without affecting "
-"the other Web Bean implementation. In fact, Web Beans defines a "
-"sophisticated facility for overriding Web Bean implementations at deployment "
-"time, as we will see in <xref linkend=\"deploymenttypes\"/>."
-msgstr ""
-"我们能够使用一个实现相同接口,具有不同生命周期(一个不同的范围)的Web Bean替"
-"换一个Web Bean而不会影响其他的Web Bean实现。实际上,Web Bean定义了一个复杂的"
-"机制能够在部署时覆盖Web Bean的实现,我们将在<xref linkend=\"deploymenttypes"
-"\"/>一章阐述。"
+msgid "We can replace one Web Bean with a different Web Bean that implements the same API and has a different lifecycle (a different scope) without affecting the other Web Bean implementation. In fact, Web Beans defines a sophisticated facility for overriding Web Bean implementations at deployment time, as we will see in <xref linkend=\"deploymenttypes\"/>."
+msgstr "我们能够使用一个实现相同接口,具有不同生命周期(一个不同的范围)的Web Bean替换一个Web Bean而不会影响其他的Web Bean实现。实际上,Web Bean定义了一个复杂的机制能够在部署时覆盖Web Bean的实现,我们将在<xref linkend=\"deploymenttypes\"/>一章阐述。"
#. Tag: para
#: intro.xml:145
#, fuzzy, no-c-format
-msgid ""
-"Note that not all clients of a Web Bean are Web Beans. Other objects such as "
-"Servlets or Message-Driven Beans — which are by nature not injectable, "
-"contextual objects — may also obtain references to Web Beans by "
-"injection."
-msgstr ""
-"需要注意的是并非所有的Web Bean的客户端都是Web Bean。其他对象诸如Servlet或者消"
-"息驱动Bean#151;天生不可注入的, 具备上下文的对象—也可以通过注入获得Web "
-"Bean的引用。"
+msgid "Note that not all clients of a Web Bean are Web Beans. Other objects such as Servlets or Message-Driven Beans — which are by nature not injectable, contextual objects — may also obtain references to Web Beans by injection."
+msgstr "需要注意的是并非所有的Web Bean的客户端都是Web Bean。其他对象诸如Servlet或者消息驱动Bean#151;天生不可注入的, 具备上下文的对象—也可以通过注入获得Web Bean的引用。"
#. Tag: para
#: intro.xml:149
@@ -503,13 +350,8 @@
#. Tag: para
#: intro.xml:172
#, no-c-format
-msgid ""
-"Web Beans usually acquire references to other Web Beans via dependency "
-"injection. Any injected attribute specifies a \"contract\" that must be "
-"satisfied by the Web Bean to be injected. The contract is:"
-msgstr ""
-"Web Bean通常通过依赖注入获得其他Web Bean的引用。任何注入的属性都要指定一个"
-"\"合约\",这个合约必须满足注入的Web Bean的要求。这个合约是:"
+msgid "Web Beans usually acquire references to other Web Beans via dependency injection. Any injected attribute specifies a \"contract\" that must be satisfied by the Web Bean to be injected. The contract is:"
+msgstr "Web Bean通常通过依赖注入获得其他Web Bean的引用。任何注入的属性都要指定一个\"合约\",这个合约必须满足注入的Web Bean的要求。这个合约是:"
#. Tag: para
#: intro.xml:177
@@ -526,29 +368,14 @@
#. Tag: para
#: intro.xml:181
#, no-c-format
-msgid ""
-"An API is a user-defined class or interface. (If the Web Bean is an EJB "
-"session bean, the API type is the <literal>@Local</literal> interface or "
-"bean-class local view). A binding type represents some client-visible "
-"semantic that is satisfied by some implementations of the API and not by "
-"others."
-msgstr ""
-"一个API指的是用户定义的类或者接口。(如果Web Bean是一个EJB会话Bean,API类型"
-"是 <literal>@Local</literal> 接口或者Bean类的本地视图)。一个绑定类型表示某个"
-"客户端可见的语义,这个语义由API的某个实现而不是其他实现来满足。"
+msgid "An API is a user-defined class or interface. (If the Web Bean is an EJB session bean, the API type is the <literal>@Local</literal> interface or bean-class local view). A binding type represents some client-visible semantic that is satisfied by some implementations of the API and not by others."
+msgstr "一个API指的是用户定义的类或者接口。(如果Web Bean是一个EJB会话Bean,API类型是 <literal>@Local</literal> 接口或者Bean类的本地视图)。一个绑定类型表示某个客户端可见的语义,这个语义由API的某个实现而不是其他实现来满足。"
#. Tag: para
#: intro.xml:186
#, no-c-format
-msgid ""
-"Binding types are represented by user-defined annotations that are "
-"themselves annotated <literal>@BindingType</literal>. For example, the "
-"following injection point has API type <literal>PaymentProcessor</literal> "
-"and binding type <literal>@CreditCard</literal>:"
-msgstr ""
-"绑定类型通过用户定义的注释来表现,这些注释自己需要通过<literal>@BindingType</"
-"literal>来注释。例如,下面的注入点有一个API类型 <literal>PaymentProcessor</"
-"literal>和绑定类型<literal>@CreditCard</literal>:"
+msgid "Binding types are represented by user-defined annotations that are themselves annotated <literal>@BindingType</literal>. For example, the following injection point has API type <literal>PaymentProcessor</literal> and binding type <literal>@CreditCard</literal>:"
+msgstr "绑定类型通过用户定义的注释来表现,这些注释自己需要通过<literal>@BindingType</literal>来注释。例如,下面的注入点有一个API类型 <literal>PaymentProcessor</literal>和绑定类型<literal>@CreditCard</literal>:"
#. Tag: programlisting
#: intro.xml:191
@@ -559,35 +386,20 @@
#. Tag: para
#: intro.xml:193
#, no-c-format
-msgid ""
-"If no binding type is explicitly specified at an injection point, the "
-"default binding type <literal>@Current</literal> is assumed."
-msgstr ""
-"如果在一个注入点没有显式的指定一个绑定类型,那么默认的绑定类型是"
-"<literal>@Current</literal>。"
+msgid "If no binding type is explicitly specified at an injection point, the default binding type <literal>@Current</literal> is assumed."
+msgstr "如果在一个注入点没有显式的指定一个绑定类型,那么默认的绑定类型是<literal>@Current</literal>。"
#. Tag: para
#: intro.xml:196
#, no-c-format
-msgid ""
-"For each injection point, the Web Bean manager searches for a Web Bean which "
-"satisfies the contract (implements the API, and has all the binding types), "
-"and injects that Web Bean."
-msgstr ""
-"对于每个注入点,Web Bean管理器都会搜索满足合约的Web Bean(实现了API并且拥有所"
-"有的绑定类型),然后将这个Web Bean注入。"
+msgid "For each injection point, the Web Bean manager searches for a Web Bean which satisfies the contract (implements the API, and has all the binding types), and injects that Web Bean."
+msgstr "对于每个注入点,Web Bean管理器都会搜索满足合约的Web Bean(实现了API并且拥有所有的绑定类型),然后将这个Web Bean注入。"
#. Tag: para
#: intro.xml:200
#, no-c-format
-msgid ""
-"The following Web Bean has the binding type <literal>@CreditCard</literal> "
-"and implements the API type <literal>PaymentProcessor</literal>. It could "
-"therefore be injected to the example injection point:"
-msgstr ""
-"下面的Web Bean拥有一个绑定类型<literal>@CreditCard</literal>,并且实现了API类"
-"型<literal>PaymentProcessor</literal>。因此,这个Web Bean可以被注入到这个例子"
-"的注入点中:"
+msgid "The following Web Bean has the binding type <literal>@CreditCard</literal> and implements the API type <literal>PaymentProcessor</literal>. It could therefore be injected to the example injection point:"
+msgstr "下面的Web Bean拥有一个绑定类型<literal>@CreditCard</literal>,并且实现了API类型<literal>PaymentProcessor</literal>。因此,这个Web Bean可以被注入到这个例子的注入点中:"
#. Tag: programlisting
#: intro.xml:204
@@ -604,26 +416,14 @@
#. Tag: para
#: intro.xml:206
#, no-c-format
-msgid ""
-"If a Web Bean does not explicitly specify a set of binding types, it has "
-"exactly one binding type: the default binding type <literal>@Current</"
-"literal>."
-msgstr ""
-"如果一个Web Bean没有显式的指定一套绑定类型,它将只有一个绑定类型:默认的绑定"
-"类型<literal>@Current</literal>。"
+msgid "If a Web Bean does not explicitly specify a set of binding types, it has exactly one binding type: the default binding type <literal>@Current</literal>."
+msgstr "如果一个Web Bean没有显式的指定一套绑定类型,它将只有一个绑定类型:默认的绑定类型<literal>@Current</literal>。"
#. Tag: para
#: intro.xml:209
#, no-c-format
-msgid ""
-"Web Beans defines a sophisticated but intuitive <emphasis>resolution "
-"algorithm</emphasis> that helps the container decide what to do if there is "
-"more than one Web Bean that satisfies a particular contract. We'll get into "
-"the details in <xref linkend=\"injection\"/>."
-msgstr ""
-"Web Bean定义了一个复杂但是很直观的<emphasis>解析算法</emphasis>来帮助容器确定"
-"如何处理多个Web Bean满足特定合约的情况。我们将在 <xref linkend=\"injection\"/"
-">一章中详述。"
+msgid "Web Beans defines a sophisticated but intuitive <emphasis>resolution algorithm</emphasis> that helps the container decide what to do if there is more than one Web Bean that satisfies a particular contract. We'll get into the details in <xref linkend=\"injection\"/>."
+msgstr "Web Bean定义了一个复杂但是很直观的<emphasis>解析算法</emphasis>来帮助容器确定如何处理多个Web Bean满足特定合约的情况。我们将在 <xref linkend=\"injection\"/>一章中详述。"
#. Tag: title
#: intro.xml:217
@@ -634,43 +434,20 @@
#. Tag: para
#: intro.xml:219
#, no-c-format
-msgid ""
-"<emphasis>Deployment types</emphasis> let us classify our Web Beans by "
-"deployment scenario. A deployment type is an annotation that represents a "
-"particular deployment scenario, for example <literal>@Mock</literal>, "
-"<literal>@Staging</literal> or <literal>@AustralianTaxLaw</literal>. We "
-"apply the annotation to Web Beans which should be deployed in that scenario. "
-"A deployment type allows a whole set of Web Beans to be conditionally "
-"deployed, with a just single line of configuration."
-msgstr ""
-"<emphasis>部署类型</emphasis>能够让我们根据部署场景来划分我们的Web Bean。一个"
-"部署类型是一个注释,这个注释代表了一种特定的部署场景,例如<literal>@Mock</"
-"literal>,<literal>@Staging</literal>或者<literal>@AustralianTaxLaw</"
-"literal>。我们通过这些注释来决定哪些Web Bean部署在哪些场景中。一个部署类型允"
-"许我们只使用一行配置就可以对一整套Web Bean进行条件化的部署。"
+msgid "<emphasis>Deployment types</emphasis> let us classify our Web Beans by deployment scenario. A deployment type is an annotation that represents a particular deployment scenario, for example <literal>@Mock</literal>, <literal>@Staging</literal> or <literal>@AustralianTaxLaw</literal>. We apply the annotation to Web Beans which should be deployed in that scenario. A deployment type allows a whole set of Web Beans to be conditionally deployed, with a just single line of configuration."
+msgstr "<emphasis>部署类型</emphasis>能够让我们根据部署场景来划分我们的Web Bean。一个部署类型是一个注释,这个注释代表了一种特定的部署场景,例如<literal>@Mock</literal>,<literal>@Staging</literal>或者<literal>@AustralianTaxLaw</literal>。我们通过这些注释来决定哪些Web Bean部署在哪些场景中。一个部署类型允许我们只使用一行配置就可以对一整套Web Bean进行条件化的部署。"
#. Tag: para
#: intro.xml:226
#, no-c-format
-msgid ""
-"Many Web Beans just use the default deployment type <literal>@Production</"
-"literal>, in which case no deployment type need be explicitly specified. All "
-"three Web Bean in our example have the deployment type <literal>@Production</"
-"literal>."
-msgstr ""
-"很多Web Bean只使用默认的部署类型<literal>@Production</literal>。在这种情况"
-"下,不需要显式的指定部署类型。在我们的例子中的三个Web Bean都拥有部署类型"
-"<literal>@Production</literal>。"
+msgid "Many Web Beans just use the default deployment type <literal>@Production</literal>, in which case no deployment type need be explicitly specified. All three Web Bean in our example have the deployment type <literal>@Production</literal>."
+msgstr "很多Web Bean只使用默认的部署类型<literal>@Production</literal>。在这种情况下,不需要显式的指定部署类型。在我们的例子中的三个Web Bean都拥有部署类型<literal>@Production</literal>。"
#. Tag: para
#: intro.xml:230
#, no-c-format
-msgid ""
-"In a testing environment, we might want to replace the "
-"<literal>SentenceTranslator</literal> Web Bean with a \"mock object\":"
-msgstr ""
-"在一个测试环境中,我们有可能将<literal>SentenceTranslator</literal> Web Bean"
-"替换为一个\"模拟对象\":"
+msgid "In a testing environment, we might want to replace the <literal>SentenceTranslator</literal> Web Bean with a \"mock object\":"
+msgstr "在一个测试环境中,我们有可能将<literal>SentenceTranslator</literal> Web Bean替换为一个\"模拟对象\":"
#. Tag: programlisting
#: intro.xml:233
@@ -693,23 +470,14 @@
#. Tag: para
#: intro.xml:236
#, no-c-format
-msgid ""
-"We would enable the deployment type <literal>@Mock</literal> in our testing "
-"environment, to indicate that <literal>MockSentenceTranslator</literal> and "
-"any other Web Bean annotated <literal>@Mock</literal> should be used."
-msgstr ""
-"我们需要在测试环境中激活部署类型<literal>@Mock</literal>,这时应用会使用 "
-"<literal>MockSentenceTranslator</literal>或者其他拥有<literal>@Mock</literal>"
-"注释的Web Bean。"
+msgid "We would enable the deployment type <literal>@Mock</literal> in our testing environment, to indicate that <literal>MockSentenceTranslator</literal> and any other Web Bean annotated <literal>@Mock</literal> should be used."
+msgstr "我们需要在测试环境中激活部署类型<literal>@Mock</literal>,这时应用会使用 <literal>MockSentenceTranslator</literal>或者其他拥有<literal>@Mock</literal>注释的Web Bean。"
#. Tag: para
#: intro.xml:240
#, no-c-format
-msgid ""
-"We'll talk more about this unique and powerful feature in <xref linkend="
-"\"deploymenttypes\"/>."
-msgstr ""
-"我们将在<xref linkend=\"deploymenttypes\"/>一章中详述这个独特而强大的特性。"
+msgid "We'll talk more about this unique and powerful feature in <xref linkend=\"deploymenttypes\"/>."
+msgstr "我们将在<xref linkend=\"deploymenttypes\"/>一章中详述这个独特而强大的特性。"
#. Tag: title
#: intro.xml:246
@@ -720,25 +488,14 @@
#. Tag: para
#: intro.xml:248
#, no-c-format
-msgid ""
-"The <emphasis>scope</emphasis> defines the lifecycle and visibility of "
-"instances of the Web Bean. The Web Beans context model is extensible, "
-"accommodating arbitrary scopes. However, certain important scopes are built-"
-"in to the specification, and provided by the Web Bean manager. A scope is "
-"represented by an annotation type."
-msgstr ""
-" <emphasis>范围</emphasis>定义了一个Web Bean实例的生命周期和可见度。Web Bean"
-"的上下文模型是可扩展的,可以适应任意范围。不过某些特定的重要的范围已经内置于"
-"规范中了,由Web Bean管理器提供这些范围。一个范围也是通过注释类型来表示的。"
+msgid "The <emphasis>scope</emphasis> defines the lifecycle and visibility of instances of the Web Bean. The Web Beans context model is extensible, accommodating arbitrary scopes. However, certain important scopes are built-in to the specification, and provided by the Web Bean manager. A scope is represented by an annotation type."
+msgstr " <emphasis>范围</emphasis>定义了一个Web Bean实例的生命周期和可见度。Web Bean的上下文模型是可扩展的,可以适应任意范围。不过某些特定的重要的范围已经内置于规范中了,由Web Bean管理器提供这些范围。一个范围也是通过注释类型来表示的。"
#. Tag: para
#: intro.xml:254
#, no-c-format
-msgid ""
-"For example, any web application may have <emphasis>session scoped</"
-"emphasis> Web Beans:"
-msgstr ""
-"例如,任何一个Web应用都可能拥有 <emphasis>会话范围</emphasis>的Web Bean:"
+msgid "For example, any web application may have <emphasis>session scoped</emphasis> Web Beans:"
+msgstr "例如,任何一个Web应用都可能拥有 <emphasis>会话范围</emphasis>的Web Bean:"
#. Tag: programlisting
#: intro.xml:257
@@ -753,25 +510,14 @@
#. Tag: para
#: intro.xml:259
#, no-c-format
-msgid ""
-"An instance of a session scoped Web Bean is bound to a user session and is "
-"shared by all requests that execute in the context of that session."
-msgstr ""
-"一个会话范围的Web Bean实例将绑定到用户会话中,它被这个会话上下文中的所有请求"
-"共享。"
+msgid "An instance of a session scoped Web Bean is bound to a user session and is shared by all requests that execute in the context of that session."
+msgstr "一个会话范围的Web Bean实例将绑定到用户会话中,它被这个会话上下文中的所有请求共享。"
#. Tag: para
#: intro.xml:262
#, no-c-format
-msgid ""
-"By default, Web Beans belong to a special scope called the "
-"<emphasis>dependent pseudo-scope</emphasis>. Web Beans with this scope are "
-"pure dependent objects of the object into which they are injected, and their "
-"lifecycle is bound to the lifecycle of that object."
-msgstr ""
-"默认情况下,Web Bean属于一个名为<emphasis>依赖伪范围</emphasis>的特殊范围。拥"
-"有这个范围的Web Bean的范围取决于其所注入的对象的范围,它的生命周期和所注入的"
-"对象的生命周期绑定在一起。"
+msgid "By default, Web Beans belong to a special scope called the <emphasis>dependent pseudo-scope</emphasis>. Web Beans with this scope are pure dependent objects of the object into which they are injected, and their lifecycle is bound to the lifecycle of that object."
+msgstr "默认情况下,Web Bean属于一个名为<emphasis>依赖伪范围</emphasis>的特殊范围。拥有这个范围的Web Bean的范围取决于其所注入的对象的范围,它的生命周期和所注入的对象的生命周期绑定在一起。"
#. Tag: para
#: intro.xml:267
@@ -788,12 +534,8 @@
#. Tag: para
#: intro.xml:274
#, no-c-format
-msgid ""
-"A Web Bean may have a <emphasis>name</emphasis>, allowing it to be used in "
-"Unified EL expressions. It's easy to specify the name of a Web Bean:"
-msgstr ""
-"一个Web Bean可能有一个<emphasis>名字</emphasis>,通过名字,Web Bean可以在统一"
-"表达式语言中使用。为Web Bean指定一个名字非常简单:"
+msgid "A Web Bean may have a <emphasis>name</emphasis>, allowing it to be used in Unified EL expressions. It's easy to specify the name of a Web Bean:"
+msgstr "一个Web Bean可能有一个<emphasis>名字</emphasis>,通过名字,Web Bean可以在统一表达式语言中使用。为Web Bean指定一个名字非常简单:"
#. Tag: programlisting
#: intro.xml:278
@@ -826,8 +568,7 @@
#. Tag: para
#: intro.xml:284
#, no-c-format
-msgid ""
-"It's even easier to just let the name be defaulted by the Web Bean manager:"
+msgid "It's even easier to just let the name be defaulted by the Web Bean manager:"
msgstr "甚至我们可以让Web Bean管理器来给Web Bean指定默认的名字:"
#. Tag: programlisting
@@ -843,12 +584,8 @@
#. Tag: para
#: intro.xml:289
#, fuzzy, no-c-format
-msgid ""
-"In this case, the name defaults to <literal>shoppingCart</literal> — "
-"the unqualified class name, with the first character changed to lowercase."
-msgstr ""
-"在这种情况下,Web Bean的名字默认为<literal>shoppingCart</literal>—非完整"
-"的类名,首字母改为小写"
+msgid "In this case, the name defaults to <literal>shoppingCart</literal> — the unqualified class name, with the first character changed to lowercase."
+msgstr "在这种情况下,Web Bean的名字默认为<literal>shoppingCart</literal>—非完整的类名,首字母改为小写"
#. Tag: title
#: intro.xml:295
@@ -859,21 +596,13 @@
#. Tag: para
#: intro.xml:297
#, no-c-format
-msgid ""
-"Web Beans supports the interceptor functionality defined by EJB 3, not only "
-"for EJB beans, but also for plain Java classes. In addition, Web Beans "
-"provides a new approach to binding interceptors to EJB beans and other Web "
-"Beans."
-msgstr ""
-"Web Bean支持EJB3定义的拦截器功能,Web Bean将其扩展,使得POJO也具备该功能。另"
-"外,Web Bean提供一个新的方式来将拦截器绑定到EJB Bean和其他Web Bean上。"
+msgid "Web Beans supports the interceptor functionality defined by EJB 3, not only for EJB beans, but also for plain Java classes. In addition, Web Beans provides a new approach to binding interceptors to EJB beans and other Web Beans."
+msgstr "Web Bean支持EJB3定义的拦截器功能,Web Bean将其扩展,使得POJO也具备该功能。另外,Web Bean提供一个新的方式来将拦截器绑定到EJB Bean和其他Web Bean上。"
#. Tag: para
#: intro.xml:302
#, no-c-format
-msgid ""
-"It remains possible to directly specify the interceptor class via use of the "
-"<literal>@Interceptors</literal> annotation:"
+msgid "It remains possible to directly specify the interceptor class via use of the <literal>@Interceptors</literal> annotation:"
msgstr "可以通过<literal>@Interceptors</literal> 注释直接指定拦截器类:"
#. Tag: programlisting
@@ -891,12 +620,8 @@
#. Tag: para
#: intro.xml:307
#, no-c-format
-msgid ""
-"However, it is more elegant, and better practice, to indirect the "
-"interceptor binding through an <emphasis>interceptor binding type</emphasis>:"
-msgstr ""
-"然而,更优雅的方式或者更佳的实践是通过<emphasis>拦截器绑定类型</emphasis>来间"
-"接地绑定拦截器:"
+msgid "However, it is more elegant, and better practice, to indirect the interceptor binding through an <emphasis>interceptor binding type</emphasis>:"
+msgstr "然而,更优雅的方式或者更佳的实践是通过<emphasis>拦截器绑定类型</emphasis>来间接地绑定拦截器:"
#. Tag: programlisting
#: intro.xml:311
@@ -911,12 +636,8 @@
#. Tag: para
#: intro.xml:313
#, no-c-format
-msgid ""
-"We'll discuss Web Beans interceptors and decorators in <xref linkend="
-"\"interceptors\"/> and <xref linkend=\"decorators\"/>."
-msgstr ""
-"我们将在<xref linkend=\"interceptors\"/>和<xref linkend=\"decorators\"/>两章"
-"分别讨论Web Bean拦截器和装饰器。"
+msgid "We'll discuss Web Beans interceptors and decorators in <xref linkend=\"interceptors\"/> and <xref linkend=\"decorators\"/>."
+msgstr "我们将在<xref linkend=\"interceptors\"/>和<xref linkend=\"decorators\"/>两章分别讨论Web Bean拦截器和装饰器。"
#. Tag: title
#: intro.xml:321
@@ -927,12 +648,8 @@
#. Tag: para
#: intro.xml:323
#, no-c-format
-msgid ""
-"We've already seen that JavaBeans, EJBs and some other Java classes can be "
-"Web Beans. But exactly what kinds of objects are Web Beans?"
-msgstr ""
-"我们已经看到,JavaBean, EJB和其他Java类都可以成为Web Bean。但是,确切地说,什"
-"么样的对象能够称为Web Bean?"
+msgid "We've already seen that JavaBeans, EJBs and some other Java classes can be Web Beans. But exactly what kinds of objects are Web Beans?"
+msgstr "我们已经看到,JavaBean, EJB和其他Java类都可以成为Web Bean。但是,确切地说,什么样的对象能够称为Web Bean?"
#. Tag: title
#: intro.xml:327
@@ -943,19 +660,13 @@
#. Tag: para
#: intro.xml:329
#, no-c-format
-msgid ""
-"The Web Beans specification says that a concrete Java class is a "
-"<emphasis>simple</emphasis> Web Bean if:"
-msgstr ""
-"Web Bean规范声称一个具体的Java类可以成为一个<emphasis>简单</emphasis>的Web "
-"Bean, 只要这个类:"
+msgid "The Web Beans specification says that a concrete Java class is a <emphasis>simple</emphasis> Web Bean if:"
+msgstr "Web Bean规范声称一个具体的Java类可以成为一个<emphasis>简单</emphasis>的Web Bean, 只要这个类:"
#. Tag: para
#: intro.xml:334
#, no-c-format
-msgid ""
-"it is not an EE container-managed component, like an EJB, a Servlet or a JPA "
-"entity,"
+msgid "it is not an EE container-managed component, like an EJB, a Servlet or a JPA entity,"
msgstr "它不是一个EE容器管理的组件,例如一个EJB,一个Servlet或者一个JPA实体,"
#. Tag: para
@@ -973,11 +684,8 @@
#. Tag: para
#: intro.xml:344
#, no-c-format
-msgid ""
-"it has a constructor with no parameters, or a constructor annotated "
-"<literal>@Initializer</literal>."
-msgstr ""
-"它拥有一个无参构造器,或者构造器具有<literal>@Initializer</literal>注释。"
+msgid "it has a constructor with no parameters, or a constructor annotated <literal>@Initializer</literal>."
+msgstr "它拥有一个无参构造器,或者构造器具有<literal>@Initializer</literal>注释。"
#. Tag: para
#: intro.xml:349
@@ -988,13 +696,8 @@
#. Tag: para
#: intro.xml:351
#, no-c-format
-msgid ""
-"Every interface implemented directly or indirectly by a simple Web Bean is "
-"an API type of the simple Web Bean. The class and its superclasses are also "
-"API types."
-msgstr ""
-"每个被简单Web Bean直接或者间接实现的接口都是这个简单Web Bean的一个API类型。这"
-"个类和它的超类也是API类型。"
+msgid "Every interface implemented directly or indirectly by a simple Web Bean is an API type of the simple Web Bean. The class and its superclasses are also API types."
+msgstr "每个被简单Web Bean直接或者间接实现的接口都是这个简单Web Bean的一个API类型。这个类和它的超类也是API类型。"
#. Tag: title
#: intro.xml:358
@@ -1005,46 +708,20 @@
#. Tag: para
#: intro.xml:360
#, fuzzy, no-c-format
-msgid ""
-"The specification says that all EJB 3-style session and singleton beans are "
-"<emphasis>enterprise</emphasis> Web Beans. Message driven beans are not Web "
-"Beans — since they are not intended to be injected into other objects "
-"— but they can take advantage of most of the functionality of Web "
-"Beans, including dependency injection and interceptors."
-msgstr ""
-"规范指出所有EJB3类型的会话Bean或者单例Bean都是<emphasis>企业级</emphasis>Web "
-"Bean。消息驱动Bean不是Web Beans—因为它们不能被注入到其他对象中#151;但是"
-"它们可以使用大部分Web Bean的功能,包括依赖注入和拦截器。"
+msgid "The specification says that all EJB 3-style session and singleton beans are <emphasis>enterprise</emphasis> Web Beans. Message driven beans are not Web Beans — since they are not intended to be injected into other objects — but they can take advantage of most of the functionality of Web Beans, including dependency injection and interceptors."
+msgstr "规范指出所有EJB3类型的会话Bean或者单例Bean都是<emphasis>企业级</emphasis>Web Bean。消息驱动Bean不是Web Beans—因为它们不能被注入到其他对象中#151;但是它们可以使用大部分Web Bean的功能,包括依赖注入和拦截器。"
#. Tag: para
#: intro.xml:366
#, no-c-format
-msgid ""
-"Every local interface of an enterprise Web Bean that does not have a "
-"wildcard type parameter or type variable, and every one of its "
-"superinterfaces, is an API type of the enterprise Web Bean. If the EJB bean "
-"has a bean class local view, the bean class, and every one of its "
-"superclasses, is also an API type."
-msgstr ""
-"一个企业级Web Bean的本地接口,只要没有一个通配类型参数或者类型变量,它都是这"
-"个企业级Web Bean的API类型,该接口的每个父接口也都是这个企业级Web Bean的API类"
-"型。如果EJB Bean有一个Bean类的本地视图,这个Bean类和它的每个父类也是一个API类"
-"型。"
+msgid "Every local interface of an enterprise Web Bean that does not have a wildcard type parameter or type variable, and every one of its superinterfaces, is an API type of the enterprise Web Bean. If the EJB bean has a bean class local view, the bean class, and every one of its superclasses, is also an API type."
+msgstr "一个企业级Web Bean的本地接口,只要没有一个通配类型参数或者类型变量,它都是这个企业级Web Bean的API类型,该接口的每个父接口也都是这个企业级Web Bean的API类型。如果EJB Bean有一个Bean类的本地视图,这个Bean类和它的每个父类也是一个API类型。"
#. Tag: para
#: intro.xml:372
#, no-c-format
-msgid ""
-"Stateful session beans should declare a remove method with no parameters or "
-"a remove method annotated <literal>@Destructor</literal>. The Web Bean "
-"manager calls this method to destroy the stateful session bean instance at "
-"the end of its lifecycle. This method is called the <emphasis>destructor</"
-"emphasis> method of the enterprise Web Bean."
-msgstr ""
-"有状态的会话Bean应该声明一个无参的删除方法或者一个拥有<literal>@Destructor</"
-"literal>注释的删除方法。Web Bean管理器将在这个有状态会话Bean实例的生命周期结"
-"束时调用这个方法。这个方法被称为企业级Web Bean的<emphasis>销毁</emphasis>方"
-"法。"
+msgid "Stateful session beans should declare a remove method with no parameters or a remove method annotated <literal>@Destructor</literal>. The Web Bean manager calls this method to destroy the stateful session bean instance at the end of its lifecycle. This method is called the <emphasis>destructor</emphasis> method of the enterprise Web Bean."
+msgstr "有状态的会话Bean应该声明一个无参的删除方法或者一个拥有<literal>@Destructor</literal>注释的删除方法。Web Bean管理器将在这个有状态会话Bean实例的生命周期结束时调用这个方法。这个方法被称为企业级Web Bean的<emphasis>销毁</emphasis>方法。"
#. Tag: programlisting
#: intro.xml:378
@@ -1073,13 +750,8 @@
#. Tag: para
#: intro.xml:380
#, no-c-format
-msgid ""
-"So when should we use an enterprise Web Bean instead of a simple Web Bean? "
-"Well, whenever we need the advanced enterprise services offered by EJB, such "
-"as:"
-msgstr ""
-"我们什么时候使用企业级Web Bean来替代简单Web Bean呢?当我们需要EJB提供的高级的"
-"企业服务的时候,例如:"
+msgid "So when should we use an enterprise Web Bean instead of a simple Web Bean? Well, whenever we need the advanced enterprise services offered by EJB, such as:"
+msgstr "我们什么时候使用企业级Web Bean来替代简单Web Bean呢?当我们需要EJB提供的高级的企业服务的时候,例如:"
#. Tag: para
#: intro.xml:387
@@ -1096,9 +768,7 @@
#. Tag: para
#: intro.xml:393
#, no-c-format
-msgid ""
-"instance-level passivation for stateful session beans and instance-pooling "
-"for stateless session beans,"
+msgid "instance-level passivation for stateful session beans and instance-pooling for stateless session beans,"
msgstr "实例水平的有状态会话Bean的钝化和无状态会话Bean的实例池,"
#. Tag: para
@@ -1116,62 +786,32 @@
#. Tag: para
#: intro.xml:404
#, no-c-format
-msgid ""
-"we should use an enterprise Web Bean. When we don't need any of these "
-"things, a simple Web Bean will serve just fine."
-msgstr ""
-"在这中情况下,我们应该使用一个企业级Web Bean。当我们不需要这些服务的时候,一"
-"个简单Web Bean就足够了。"
+msgid "we should use an enterprise Web Bean. When we don't need any of these things, a simple Web Bean will serve just fine."
+msgstr "在这中情况下,我们应该使用一个企业级Web Bean。当我们不需要这些服务的时候,一个简单Web Bean就足够了。"
#. Tag: para
#: intro.xml:407
#, no-c-format
-msgid ""
-"Many Web Beans (including any session or application scoped Web Bean) are "
-"available for concurrent access. Therefore, the concurrency management "
-"provided by EJB 3.1 is especially useful. Most session and application "
-"scoped Web Beans should be EJBs."
-msgstr ""
-"很多Web Bean(包括任何会话范围或者应用范围的Web Bean)都需要并发访问。因此,"
-"EJB3.1提供的并发管理相当有用。大部分会话范围和应用范围的Web Bean应该是EJB。"
+msgid "Many Web Beans (including any session or application scoped Web Bean) are available for concurrent access. Therefore, the concurrency management provided by EJB 3.1 is especially useful. Most session and application scoped Web Beans should be EJBs."
+msgstr "很多Web Bean(包括任何会话范围或者应用范围的Web Bean)都需要并发访问。因此,EJB3.1提供的并发管理相当有用。大部分会话范围和应用范围的Web Bean应该是EJB。"
#. Tag: para
#: intro.xml:412
#, no-c-format
-msgid ""
-"Web Beans which hold references to heavy-weight resources, or hold a lot of "
-"internal state benefit from the advanced container-managed lifecycle defined "
-"by the EJB <literal>@Stateless</literal>/<literal>@Stateful</literal>/"
-"<literal>@Singleton</literal> model, with its support for passivation and "
-"instance pooling."
-msgstr ""
-"对于拥有重量级资源引用或者大量内部状态的Web Bean来说,它能够从高级的容器管理"
-"的生命周期获得好处。这些生命周期由EJB的 <literal>@Stateless</literal>/"
-"<literal>@Stateful</literal>/<literal>@Singleton</literal>模型定义,它支持钝"
-"化和实例池。"
+msgid "Web Beans which hold references to heavy-weight resources, or hold a lot of internal state benefit from the advanced container-managed lifecycle defined by the EJB <literal>@Stateless</literal>/<literal>@Stateful</literal>/<literal>@Singleton</literal> model, with its support for passivation and instance pooling."
+msgstr "对于拥有重量级资源引用或者大量内部状态的Web Bean来说,它能够从高级的容器管理的生命周期获得好处。这些生命周期由EJB的 <literal>@Stateless</literal>/<literal>@Stateful</literal>/<literal>@Singleton</literal>模型定义,它支持钝化和实例池。"
#. Tag: para
#: intro.xml:417
#, no-c-format
-msgid ""
-"Finally, it's usually obvious when method-level transaction management, "
-"method-level security, timers, remote methods or asynchronous methods are "
-"needed."
-msgstr ""
-"最后,什么情况下应该使用方法水平的事务管理,方法水平的安全,计时器,远程方法"
-"或者异步方法应该是显而易见的。"
+msgid "Finally, it's usually obvious when method-level transaction management, method-level security, timers, remote methods or asynchronous methods are needed."
+msgstr "最后,什么情况下应该使用方法水平的事务管理,方法水平的安全,计时器,远程方法或者异步方法应该是显而易见的。"
#. Tag: para
#: intro.xml:420
#, no-c-format
-msgid ""
-"It's usually easy to start with simple Web Bean, and then turn it into an "
-"EJB, just by adding an annotation: <literal>@Stateless</literal>, "
-"<literal>@Stateful</literal> or <literal>@Singleton</literal>."
-msgstr ""
-"从简单Web Bean起步最容易,然后转换到EJB上,过程很简单,只须添加一个注释:"
-"<literal>@Stateless</literal>, <literal>@Stateful</literal> 或者 "
-"<literal>@Singleton</literal>。"
+msgid "It's usually easy to start with simple Web Bean, and then turn it into an EJB, just by adding an annotation: <literal>@Stateless</literal>, <literal>@Stateful</literal> or <literal>@Singleton</literal>."
+msgstr "从简单Web Bean起步最容易,然后转换到EJB上,过程很简单,只须添加一个注释:<literal>@Stateless</literal>, <literal>@Stateful</literal> 或者 <literal>@Singleton</literal>。"
#. Tag: title
#: intro.xml:427
@@ -1182,16 +822,8 @@
#. Tag: para
#: intro.xml:429
#, no-c-format
-msgid ""
-"A <emphasis>producer method</emphasis> is a method that is called by the Web "
-"Bean manager to obtain an instance of the Web Bean when no instance exists "
-"in the current context. A producer method lets the application take full "
-"control of the instantiation process, instead of leaving instantiation to "
-"the Web Bean manager. For example:"
-msgstr ""
-"一个<emphasis>生产者方法</emphasis>由Web Bean管理器在当前上下文中没有某个Web "
-"Bean实例的时候调用,用以获得该Web Bean的一个实例。一个生产者方法能够让应用完"
-"全控制实例化的过程,而不是将初始化交给Web Bean管理器处理。例如:"
+msgid "A <emphasis>producer method</emphasis> is a method that is called by the Web Bean manager to obtain an instance of the Web Bean when no instance exists in the current context. A producer method lets the application take full control of the instantiation process, instead of leaving instantiation to the Web Bean manager. For example:"
+msgstr "一个<emphasis>生产者方法</emphasis>由Web Bean管理器在当前上下文中没有某个Web Bean实例的时候调用,用以获得该Web Bean的一个实例。一个生产者方法能够让应用完全控制实例化的过程,而不是将初始化交给Web Bean管理器处理。例如:"
#. Tag: programlisting
#: intro.xml:435
@@ -1222,11 +854,8 @@
#. Tag: para
#: intro.xml:437
#, no-c-format
-msgid ""
-"The result of a producer method is injected just like any other Web Bean."
-msgstr ""
-"一个生产者方法的输出或者返回值将被注入到注入点中,就像其他任何的Web Bean一"
-"样。"
+msgid "The result of a producer method is injected just like any other Web Bean."
+msgstr "一个生产者方法的输出或者返回值将被注入到注入点中,就像其他任何的Web Bean一样。"
#. Tag: programlisting
#: intro.xml:439
@@ -1237,13 +866,8 @@
#. Tag: para
#: intro.xml:441
#, no-c-format
-msgid ""
-"The method return type and all interfaces it extends/implements directly or "
-"indirectly are API types of the producer method. If the return type is a "
-"class, all superclasses are also API types."
-msgstr ""
-"方法返回的类型和它直接或者间接继承或者实现的所有接口都是这个生产者方法的API类"
-"型。如果返回的类型一个类,其所有的父类也是API类型。"
+msgid "The method return type and all interfaces it extends/implements directly or indirectly are API types of the producer method. If the return type is a class, all superclasses are also API types."
+msgstr "方法返回的类型和它直接或者间接继承或者实现的所有接口都是这个生产者方法的API类型。如果返回的类型一个类,其所有的父类也是API类型。"
#. Tag: para
#: intro.xml:445
@@ -1266,9 +890,7 @@
#. Tag: para
#: intro.xml:449
#, no-c-format
-msgid ""
-"These producer methods may define matching <emphasis>disposal methods</"
-"emphasis>:"
+msgid "These producer methods may define matching <emphasis>disposal methods</emphasis>:"
msgstr "这些生产者方法可以定义对应的<emphasis>清除方法</emphasis>:"
#. Tag: programlisting
@@ -1286,17 +908,13 @@
#. Tag: para
#: intro.xml:453
#, no-c-format
-msgid ""
-"This disposal method is called automatically by the Web Bean manager at the "
-"end of the request."
+msgid "This disposal method is called automatically by the Web Bean manager at the end of the request."
msgstr "这个清除方法将在请求结束的时候自动被Web Bean管理器调用。"
#. Tag: para
#: intro.xml:456
#, no-c-format
-msgid ""
-"We'll talk much more about producer methods in <xref linkend="
-"\"producermethods\"/>."
+msgid "We'll talk much more about producer methods in <xref linkend=\"producermethods\"/>."
msgstr "我们将在<xref linkend=\"producermethods\"/>一章中详述生产者方法。"
#. Tag: title
@@ -1308,12 +926,6 @@
#. Tag: para
#: intro.xml:463
#, no-c-format
-msgid ""
-"Finally, a JMS queue or topic can be a Web Bean. Web Beans relieves the "
-"developer from the tedium of managing the lifecycles of all the various JMS "
-"objects required to send messages to queues and topics. We'll discuss JMS "
-"endpoints in <xref linkend=\"jms\"/>."
-msgstr ""
-"最后,一个JMS的队列或者主题能够成为一个Web Bean。为了向队列或者主题发送消息,"
-"开发者不得不处理所有不同JMS对象的生命周期。Web Bean将开发者从这些冗长乏味的工"
-"作中解放出来。我们将在<xref linkend=\"jms\"/>一章中讨论JMS端点。"
+msgid "Finally, a JMS queue or topic can be a Web Bean. Web Beans relieves the developer from the tedium of managing the lifecycles of all the various JMS objects required to send messages to queues and topics. We'll discuss JMS endpoints in <xref linkend=\"jms\"/>."
+msgstr "最后,一个JMS的队列或者主题能够成为一个Web Bean。为了向队列或者主题发送消息,开发者不得不处理所有不同JMS对象的生命周期。Web Bean将开发者从这些冗长乏味的工作中解放出来。我们将在<xref linkend=\"jms\"/>一章中讨论JMS端点。"
+
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1953 - doc/trunk/reference/zh-CN.
by webbeans-commits@lists.jboss.org
Author: alartin
Date: 2009-03-13 02:09:01 -0400 (Fri, 13 Mar 2009)
New Revision: 1953
Modified:
doc/trunk/reference/zh-CN/master.po
Log:
master section finished
Modified: doc/trunk/reference/zh-CN/master.po
===================================================================
--- doc/trunk/reference/zh-CN/master.po 2009-03-13 05:17:15 UTC (rev 1952)
+++ doc/trunk/reference/zh-CN/master.po 2009-03-13 06:09:01 UTC (rev 1953)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-02-07 18:51+0000\n"
-"PO-Revision-Date: 2008-12-22 09:29+0800\n"
+"PO-Revision-Date: 2009-03-13 14:08+0800\n"
"Last-Translator: Sean Wu <alartin(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -17,19 +17,13 @@
#: master.xml:10
#, no-c-format
msgid "Note"
-msgstr ""
+msgstr "注释"
#. Tag: para
#: master.xml:11
#, no-c-format
-msgid ""
-"JSR-299 has recently changed its name from \"Web Beans\" to \"Java Contexts "
-"and Dependency Injection\". The reference guide still refers to JSR-299 as "
-"\"Web Beans\" and the JSR-299 Reference Implementation as the \"Web Beans RI"
-"\". Other documentation, blogs, forum posts etc. may use the new "
-"nomenclature, including the new name for the JSR-299 Reference "
-"Implementation - \"Web Beans\"."
-msgstr ""
+msgid "JSR-299 has recently changed its name from \"Web Beans\" to \"Java Contexts and Dependency Injection\". The reference guide still refers to JSR-299 as \"Web Beans\" and the JSR-299 Reference Implementation as the \"Web Beans RI\". Other documentation, blogs, forum posts etc. may use the new nomenclature, including the new name for the JSR-299 Reference Implementation - \"Web Beans\"."
+msgstr "JSR-299最近将名字从\"Web Beans\"改为\"Java上下文和依赖注入\"。参考指南仍然使用\"Web Beans\"名称,参考实现仍然使用\"Web Beans RI\"名称。其他的文档,博客,论坛帖子等等可能使用新的命名,包括新的JSR-299参考实现的名字- \"Web Beans\"。"
#. Tag: title
#: master.xml:24
@@ -54,3 +48,4 @@
#, no-c-format
msgid "Web Beans and the Java EE ecosystem"
msgstr "Web Beans和Java EE生态系统"
+
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1952 - doc/trunk/reference/zh-CN.
by webbeans-commits@lists.jboss.org
Author: alartin
Date: 2009-03-13 01:17:15 -0400 (Fri, 13 Mar 2009)
New Revision: 1952
Modified:
doc/trunk/reference/zh-CN/interceptors.po
Log:
Simplified Chinese translation of interceptor section is finished.
Modified: doc/trunk/reference/zh-CN/interceptors.po
===================================================================
--- doc/trunk/reference/zh-CN/interceptors.po 2009-03-13 02:09:48 UTC (rev 1951)
+++ doc/trunk/reference/zh-CN/interceptors.po 2009-03-13 05:17:15 UTC (rev 1952)
@@ -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: 2009-01-04 23:18+0000\n"
-"PO-Revision-Date: 2008-12-19 20:26+0000\n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2009-03-13 13:15+0800\n"
+"Last-Translator: Sean Wu <alartin(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,106 +17,97 @@
#: interceptors.xml:4
#, no-c-format
msgid "Interceptors"
-msgstr ""
+msgstr "拦截器"
#. Tag: para
#: interceptors.xml:6
#, no-c-format
-msgid ""
-"Web Beans re-uses the basic interceptor architecture of EJB 3.0, extending "
-"the functionality in two directions:"
-msgstr ""
+msgid "Web Beans re-uses the basic interceptor architecture of EJB 3.0, extending the functionality in two directions:"
+msgstr "Web Beans重用了EJB3.0的基本的拦截器体系,并且在两个方向上扩展了其功能:"
#. Tag: para
#: interceptors.xml:11
#, no-c-format
msgid "Any Web Bean may have interceptors, not just session beans."
-msgstr ""
+msgstr "任何Web Bean都可以拥有拦截器,而不仅仅是会话Bean。"
#. Tag: para
#: interceptors.xml:14
#, no-c-format
-msgid ""
-"Web Beans features a more sophisticated annotation-based approach to binding "
-"interceptors to Web Beans."
-msgstr ""
+msgid "Web Beans features a more sophisticated annotation-based approach to binding interceptors to Web Beans."
+msgstr "Web Beans拥有一个更复杂的基于注释的方法将拦截器绑定到Web Bean上。"
#. Tag: para
#: interceptors.xml:22
#, no-c-format
msgid "The EJB specification defines two kinds of interception points:"
-msgstr ""
+msgstr "EJB规范定义了两种拦截点:"
#. Tag: para
#: interceptors.xml:26
#, no-c-format
msgid "business method interception, and"
-msgstr ""
+msgstr "业务方法拦截,和"
#. Tag: para
#: interceptors.xml:29
#, no-c-format
msgid "lifecycle callback interception."
-msgstr ""
+msgstr "生命周期回调方法拦截。"
#. Tag: para
#: interceptors.xml:33
#, no-c-format
-msgid ""
-"A <emphasis>business method interceptor</emphasis> applies to invocations of "
-"methods of the Web Bean by clients of the Web Bean:"
-msgstr ""
+msgid "A <emphasis>business method interceptor</emphasis> applies to invocations of methods of the Web Bean by clients of the Web Bean:"
+msgstr "一个 <emphasis>业务方法拦截</emphasis> 是Web Bean的客户应用在Web Bean的方法调用上:"
#. Tag: programlisting
#: interceptors.xml:36
#, no-c-format
msgid ""
"<![CDATA[public class TransactionInterceptor {\n"
-" @AroundInvoke public Object manageTransaction(InvocationContext ctx) "
-"{ ... }\n"
+" @AroundInvoke public Object manageTransaction(InvocationContext ctx) { ... }\n"
"}]]>"
msgstr ""
+"<![CDATA[public class TransactionInterceptor {\n"
+" @AroundInvoke public Object manageTransaction(InvocationContext ctx) { ... }\n"
+"}]]>"
#. Tag: para
#: interceptors.xml:38
#, no-c-format
-msgid ""
-"A <emphasis>lifecycle callback interceptor</emphasis> applies to invocations "
-"of lifecycle callbacks by the container:"
-msgstr ""
+msgid "A <emphasis>lifecycle callback interceptor</emphasis> applies to invocations of lifecycle callbacks by the container:"
+msgstr "一个 <emphasis>生命周期回调拦截器</emphasis> 是容器应用在生命周期回调方法的调用上:"
#. Tag: programlisting
#: interceptors.xml:41
#, no-c-format
msgid ""
"<![CDATA[public class DependencyInjectionInterceptor {\n"
-" @PostConstruct public void injectDependencies(InvocationContext ctx) "
-"{ ... }\n"
+" @PostConstruct public void injectDependencies(InvocationContext ctx) { ... }\n"
"}]]>"
msgstr ""
+"<![CDATA[public class DependencyInjectionInterceptor {\n"
+" @PostConstruct public void injectDependencies(InvocationContext ctx) { ... }\n"
+"}]]>"
#. Tag: para
#: interceptors.xml:43
#, no-c-format
-msgid ""
-"An interceptor class may intercept both lifecycle callbacks and business "
-"methods."
-msgstr ""
+msgid "An interceptor class may intercept both lifecycle callbacks and business methods."
+msgstr "一个拦截器类既可以拦截生命周期回调方法,也可以拦截业务方法。"
#. Tag: title
#: interceptors.xml:49
#, no-c-format
msgid "Interceptor bindings"
-msgstr ""
+msgstr "拦截器绑定"
#. Tag: para
#: interceptors.xml:51
#, no-c-format
-msgid ""
-"Suppose we want to declare that some of our Web Beans are transactional. The "
-"first thing we need is an <emphasis>interceptor binding annotation</"
-"emphasis> to specify exactly which Web Beans we're interested in:"
-msgstr ""
+msgid "Suppose we want to declare that some of our Web Beans are transactional. The first thing we need is an <emphasis>interceptor binding annotation</emphasis> to specify exactly which Web Beans we're interested in:"
+msgstr "假定我们想声明我们的某些Web Beans是事务性的。我们要做的第一个事情就是需要一个 <emphasis>拦截器绑定注释</emphasis> 以便指定哪些Web Beans是事务性的:"
#. Tag: programlisting
#: interceptors.xml:55
@@ -127,14 +118,16 @@
"@Retention(RUNTIME)\n"
"public @interface Transactional {}]]>"
msgstr ""
+"<![CDATA[@InterceptorBindingType\n"
+"@Target({METHOD, TYPE})\n"
+"@Retention(RUNTIME)\n"
+"public @interface Transactional {}]]>"
#. Tag: para
#: interceptors.xml:57
#, no-c-format
-msgid ""
-"Now we can easily specify that our <literal>ShoppingCart</literal> is a "
-"transactional object:"
-msgstr ""
+msgid "Now we can easily specify that our <literal>ShoppingCart</literal> is a transactional object:"
+msgstr "现在我们可以很容易地指定我们的 <literal>ShoppingCart</literal> 是一个事务性的对象:"
#. Tag: programlisting
#: interceptors.xml:60
@@ -143,12 +136,14 @@
"<![CDATA[@Transactional\n"
"public class ShoppingCart { ... }]]>"
msgstr ""
+"<![CDATA[@Transactional\n"
+"public class ShoppingCart { ... }]]>"
#. Tag: para
#: interceptors.xml:62
#, no-c-format
msgid "Or, if we prefer, we can specify that just one method is transactional:"
-msgstr ""
+msgstr "或者,如果我们愿意的话,我们可以仅仅指定一个方法是事务性的:"
#. Tag: programlisting
#: interceptors.xml:64
@@ -158,22 +153,21 @@
" @Transactional public void checkout() { ... }\n"
"}]]>"
msgstr ""
+"<![CDATA[public class ShoppingCart {\n"
+" @Transactional public void checkout() { ... }\n"
+"}]]>"
#. Tag: title
#: interceptors.xml:69
#, no-c-format
msgid "Implementing interceptors"
-msgstr ""
+msgstr "实现拦截器"
#. Tag: para
#: interceptors.xml:71
#, no-c-format
-msgid ""
-"That's great, but somewhere along the line we're going to have to actually "
-"implement the interceptor that provides this transaction management aspect. "
-"All we need to do is create a standard EJB interceptor, and annotate it "
-"<literal>@Interceptor</literal> and <literal>@Transactional</literal>."
-msgstr ""
+msgid "That's great, but somewhere along the line we're going to have to actually implement the interceptor that provides this transaction management aspect. All we need to do is create a standard EJB interceptor, and annotate it <literal>@Interceptor</literal> and <literal>@Transactional</literal>."
+msgstr "很好,但是在代码中有些地方需要我们实现提供事务管理的拦截器。我们需要做的事情就是创建一个标准的EJB拦截器,使用 <literal>@Interceptor</literal> 和 <literal>@Transactional</literal>注释它。"
#. Tag: programlisting
#: interceptors.xml:76
@@ -181,18 +175,19 @@
msgid ""
"<![CDATA[@Transactional @Interceptor\n"
"public class TransactionInterceptor {\n"
-" @AroundInvoke public Object manageTransaction(InvocationContext ctx) "
-"{ ... }\n"
+" @AroundInvoke public Object manageTransaction(InvocationContext ctx) { ... }\n"
"}]]>"
msgstr ""
+"<![CDATA[@Transactional @Interceptor\n"
+"public class TransactionInterceptor {\n"
+" @AroundInvoke public Object manageTransaction(InvocationContext ctx) { ... }\n"
+"}]]>"
#. Tag: para
#: interceptors.xml:78
#, no-c-format
-msgid ""
-"All Web Beans interceptors are simple Web Beans, and can take advantage of "
-"dependency injection and contextual lifecycle management."
-msgstr ""
+msgid "All Web Beans interceptors are simple Web Beans, and can take advantage of dependency injection and contextual lifecycle management."
+msgstr "所有的Web Beans拦截器都是简单的Web Beans,因此可以使用依赖注入和具有上下文的生命周期的管理。"
#. Tag: programlisting
#: interceptors.xml:81
@@ -203,31 +198,36 @@
"\n"
" @Resource Transaction transaction;\n"
"\n"
-" @AroundInvoke public Object manageTransaction(InvocationContext ctx) "
-"{ ... }\n"
+" @AroundInvoke public Object manageTransaction(InvocationContext ctx) { ... }\n"
" \n"
"}]]>"
msgstr ""
+"<![CDATA[@ApplicationScoped @Transactional @Interceptor\n"
+"public class TransactionInterceptor {\n"
+"\n"
+" @Resource Transaction transaction;\n"
+"\n"
+" @AroundInvoke public Object manageTransaction(InvocationContext ctx) { ... }\n"
+" \n"
+"}]]>"
#. Tag: para
#: interceptors.xml:83
#, no-c-format
msgid "Multiple interceptors may use the same interceptor binding type."
-msgstr ""
+msgstr "多个拦截器可以使用相同的拦截器绑定类型"
#. Tag: title
#: interceptors.xml:88
#, no-c-format
msgid "Enabling interceptors"
-msgstr ""
+msgstr "激活拦截器"
#. Tag: para
#: interceptors.xml:90
#, no-c-format
-msgid ""
-"Finally, we need to <emphasis>enable</emphasis> our interceptor in "
-"<literal>web-beans.xml</literal>."
-msgstr ""
+msgid "Finally, we need to <emphasis>enable</emphasis> our interceptor in <literal>web-beans.xml</literal>."
+msgstr "最后,我们需要在 <literal>web-beans.xml</literal> 配置文件中 <emphasis>激活</emphasis> 我们的拦截器。"
#. Tag: programlisting
#: interceptors.xml:93
@@ -237,40 +237,39 @@
" <tx:TransactionInterceptor/>\n"
"</Interceptors>]]>"
msgstr ""
+"<![CDATA[<Interceptors>\n"
+" <tx:TransactionInterceptor/>\n"
+"</Interceptors>]]>"
#. Tag: para
#: interceptors.xml:95
#, no-c-format
msgid "Whoah! Why the angle bracket stew?"
-msgstr ""
+msgstr "哇塞!为何使用尖括号?"
#. Tag: para
#: interceptors.xml:97
#, no-c-format
msgid "Well, the XML declaration solves two problems:"
-msgstr ""
+msgstr "好吧,XML声明解决了两个问题:"
#. Tag: para
#: interceptors.xml:101
#, no-c-format
-msgid ""
-"it enables us to specify a total ordering for all the interceptors in our "
-"system, ensuring deterministic behavior, and"
-msgstr ""
+msgid "it enables us to specify a total ordering for all the interceptors in our system, ensuring deterministic behavior, and"
+msgstr "它可以让我们在我们的系统中指定所有的拦截器顺序,确保这些行为具有确定性,并且"
#. Tag: para
#: interceptors.xml:105
#, no-c-format
msgid "it lets us enable or disable interceptor classes at deployment time."
-msgstr ""
+msgstr "它能够让我们在部署期间激活或者关闭拦截器类。"
#. Tag: para
#: interceptors.xml:109
#, no-c-format
-msgid ""
-"For example, we could specify that our security interceptor runs before our "
-"<literal>TransactionInterceptor</literal>."
-msgstr ""
+msgid "For example, we could specify that our security interceptor runs before our <literal>TransactionInterceptor</literal>."
+msgstr "例如,我们可以指定在 <literal>TransactionInterceptor</literal> 之前运行我们的安全拦截器。"
#. Tag: programlisting
#: interceptors.xml:112
@@ -281,26 +280,28 @@
" <tx:TransactionInterceptor/>\n"
"</Interceptors>]]>"
msgstr ""
+"<![CDATA[<Interceptors>\n"
+" <sx:SecurityInterceptor/>\n"
+" <tx:TransactionInterceptor/>\n"
+"</Interceptors>]]>"
#. Tag: para
#: interceptors.xml:114
#, no-c-format
msgid "Or we could turn them both off in our test environment!"
-msgstr ""
+msgstr "或者我们可以在测试环境中将它们都关闭!"
#. Tag: title
#: interceptors.xml:119
#, no-c-format
msgid "Interceptor bindings with members"
-msgstr ""
+msgstr "成员拦截器绑定"
#. Tag: para
#: interceptors.xml:121
#, no-c-format
-msgid ""
-"Suppose we want to add some extra information to our "
-"<literal>@Transactional</literal> annotation:"
-msgstr ""
+msgid "Suppose we want to add some extra information to our <literal>@Transactional</literal> annotation:"
+msgstr "假定我们想要往 <literal>@Transactional</literal> 注释中添加一些额外信息:"
#. Tag: programlisting
#: interceptors.xml:124
@@ -313,15 +314,18 @@
" boolean requiresNew() default false;\n"
"}]]>"
msgstr ""
+"<![CDATA[@InterceptorBindingType\n"
+"@Target({METHOD, TYPE})\n"
+"@Retention(RUNTIME)\n"
+"public @interface Transactional {\n"
+" boolean requiresNew() default false;\n"
+"}]]>"
#. Tag: para
#: interceptors.xml:126
#, no-c-format
-msgid ""
-"Web Beans will use the value of <literal>requiresNew</literal> to choose "
-"between two different interceptors, <literal>TransactionInterceptor</"
-"literal> and <literal>RequiresNewTransactionInterceptor</literal>."
-msgstr ""
+msgid "Web Beans will use the value of <literal>requiresNew</literal> to choose between two different interceptors, <literal>TransactionInterceptor</literal> and <literal>RequiresNewTransactionInterceptor</literal>."
+msgstr "Web Beans将使用 <literal>requiresNew</literal> 的值来决定在两种不同的拦截器 <literal>TransactionInterceptor</literal> 和 <literal>RequiresNewTransactionInterceptor</literal> 中选择哪一个。"
#. Tag: programlisting
#: interceptors.xml:130
@@ -329,18 +333,19 @@
msgid ""
"<![CDATA[@Transactional(requiresNew=true) @Interceptor\n"
"public class RequiresNewTransactionInterceptor {\n"
-" @AroundInvoke public Object manageTransaction(InvocationContext ctx) "
-"{ ... }\n"
+" @AroundInvoke public Object manageTransaction(InvocationContext ctx) { ... }\n"
"}]]>"
msgstr ""
+"<![CDATA[@Transactional(requiresNew=true) @Interceptor\n"
+"public class RequiresNewTransactionInterceptor {\n"
+" @AroundInvoke public Object manageTransaction(InvocationContext ctx) { ... }\n"
+"}]]>"
#. Tag: para
#: interceptors.xml:132
#, no-c-format
-msgid ""
-"Now we can use <literal>RequiresNewTransactionInterceptor</literal> like "
-"this:"
-msgstr ""
+msgid "Now we can use <literal>RequiresNewTransactionInterceptor</literal> like this:"
+msgstr "现在我们可以像这样使用 <literal>RequiresNewTransactionInterceptor</literal> :"
#. Tag: programlisting
#: interceptors.xml:134
@@ -349,15 +354,14 @@
"<![CDATA[@Transactional(requiresNew=true)\n"
"public class ShoppingCart { ... }]]>"
msgstr ""
+"<![CDATA[@Transactional(requiresNew=true)\n"
+"public class ShoppingCart { ... }]]>"
#. Tag: para
#: interceptors.xml:136
#, no-c-format
-msgid ""
-"But what if we only have one interceptor and we want the manager to ignore "
-"the value of <literal>requiresNew</literal> when binding interceptors? We "
-"can use the <literal>@NonBinding</literal> annotation:"
-msgstr ""
+msgid "But what if we only have one interceptor and we want the manager to ignore the value of <literal>requiresNew</literal> when binding interceptors? We can use the <literal>@NonBinding</literal> annotation:"
+msgstr "但是如果我们只有一个拦截器,并且我们希望管理器在绑定拦截器的时候忽略 <literal>requiresNew</literal> 的值,那该怎么办?我们可以使用 <literal>@NonBinding</literal> 注释:"
#. Tag: programlisting
#: interceptors.xml:140
@@ -370,22 +374,24 @@
" @NonBinding String[] rolesAllowed() default {};\n"
"}]]>"
msgstr ""
+"<![CDATA[@InterceptorBindingType\n"
+"@Target({METHOD, TYPE})\n"
+"@Retention(RUNTIME)\n"
+"public @interface Secure {\n"
+" @NonBinding String[] rolesAllowed() default {};\n"
+"}]]>"
#. Tag: title
#: interceptors.xml:145
#, no-c-format
msgid "Multiple interceptor binding annotations"
-msgstr ""
+msgstr "多个拦截器绑定注释"
#. Tag: para
#: interceptors.xml:147
#, no-c-format
-msgid ""
-"Usually we use combinations of interceptor bindings types to bind multiple "
-"interceptors to a Web Bean. For example, the following declaration would be "
-"used to bind <literal>TransactionInterceptor</literal> and "
-"<literal>SecurityInterceptor</literal> to the same Web Bean:"
-msgstr ""
+msgid "Usually we use combinations of interceptor bindings types to bind multiple interceptors to a Web Bean. For example, the following declaration would be used to bind <literal>TransactionInterceptor</literal> and <literal>SecurityInterceptor</literal> to the same Web Bean:"
+msgstr "通常我们可以组合拦截器绑定类型将多个拦截器绑定到一个Web Bean上。例如,下面的声明可以将 <literal>TransactionInterceptor</literal> 和 <literal>SecurityInterceptor</literal> 绑定到相同的Web Bean上:"
#. Tag: programlisting
#: interceptors.xml:152
@@ -394,14 +400,14 @@
"<![CDATA[@Secure(rolesAllowed=\"admin\") @Transactional\n"
"public class ShoppingCart { ... }]]>"
msgstr ""
+"<![CDATA[@Secure(rolesAllowed=\"admin\") @Transactional\n"
+"public class ShoppingCart { ... }]]>"
#. Tag: para
#: interceptors.xml:154
#, no-c-format
-msgid ""
-"However, in very complex cases, an interceptor itself may specify some "
-"combination of interceptor binding types:"
-msgstr ""
+msgid "However, in very complex cases, an interceptor itself may specify some combination of interceptor binding types:"
+msgstr "然而,在非常复杂的情况下,一个拦截器本身可以指定一些拦截器绑定类型的组合:"
#. Tag: programlisting
#: interceptors.xml:157
@@ -410,14 +416,14 @@
"<![CDATA[@Transactional @Secure @Interceptor\n"
"public class TransactionalSecureInterceptor { ... }]]>"
msgstr ""
+"<![CDATA[@Transactional @Secure @Interceptor\n"
+"public class TransactionalSecureInterceptor { ... }]]>"
#. Tag: para
#: interceptors.xml:159
#, no-c-format
-msgid ""
-"Then this interceptor could be bound to the <literal>checkout()</literal> "
-"method using any one of the following combinations:"
-msgstr ""
+msgid "Then this interceptor could be bound to the <literal>checkout()</literal> method using any one of the following combinations:"
+msgstr "然后,这个拦截器可以使用下面的任何一个组合来绑定到 <literal>checkout()</literal> 方法上:"
#. Tag: programlisting
#: interceptors.xml:162
@@ -427,6 +433,9 @@
" @Transactional @Secure public void checkout() { ... }\n"
"}]]>"
msgstr ""
+"<![CDATA[public class ShoppingCart {\n"
+" @Transactional @Secure public void checkout() { ... }\n"
+"}]]>"
#. Tag: programlisting
#: interceptors.xml:164
@@ -437,6 +446,10 @@
" @Transactional public void checkout() { ... }\n"
"}]]>"
msgstr ""
+"<![CDATA[@Secure\n"
+"public class ShoppingCart {\n"
+" @Transactional public void checkout() { ... }\n"
+"}]]>"
#. Tag: programlisting
#: interceptors.xml:166
@@ -447,6 +460,10 @@
" @Secure public void checkout() { ... }\n"
"}]]>"
msgstr ""
+"<![CDATA[@Transactionl\n"
+"public class ShoppingCart {\n"
+" @Secure public void checkout() { ... }\n"
+"}]]>"
#. Tag: programlisting
#: interceptors.xml:168
@@ -457,39 +474,34 @@
" public void checkout() { ... }\n"
"}]]>"
msgstr ""
+"<![CDATA[@Transactional @Secure\n"
+"public class ShoppingCart {\n"
+" public void checkout() { ... }\n"
+"}]]>"
#. Tag: title
#: interceptors.xml:173
#, no-c-format
msgid "Interceptor binding type inheritance"
-msgstr ""
+msgstr "拦截器绑定类型的继承"
#. Tag: para
#: interceptors.xml:175
#, no-c-format
-msgid ""
-"One limitation of the Java language support for annotations is the lack of "
-"annotation inheritance. Really, annotations should have reuse built in, to "
-"allow this kind of thing to work:"
-msgstr ""
+msgid "One limitation of the Java language support for annotations is the lack of annotation inheritance. Really, annotations should have reuse built in, to allow this kind of thing to work:"
+msgstr "Java语言对注释的支持有一个限制,那就是缺少注释的继承机制。实际上,注释应该可以重用内置,应该支持下列工作:"
#. Tag: programlisting
#: interceptors.xml:179
#, no-c-format
-msgid ""
-"<![CDATA[public @interface Action extends Transactional, Secure { ... }]]>"
-msgstr ""
+msgid "<![CDATA[public @interface Action extends Transactional, Secure { ... }]]>"
+msgstr "<![CDATA[public @interface Action extends Transactional, Secure { ... }]]>"
#. Tag: para
#: interceptors.xml:181
#, no-c-format
-msgid ""
-"Well, fortunately, Web Beans works around this missing feature of Java. We "
-"may annotate one interceptor binding type with other interceptor binding "
-"types. The interceptor bindings are transitive — any Web Bean with the "
-"first interceptor binding inherits the interceptor bindings declared as meta-"
-"annotations."
-msgstr ""
+msgid "Well, fortunately, Web Beans works around this missing feature of Java. We may annotate one interceptor binding type with other interceptor binding types. The interceptor bindings are transitive — any Web Bean with the first interceptor binding inherits the interceptor bindings declared as meta-annotations."
+msgstr "不过幸运的是,Web Beans能够解决这个Java缺失的特性。我们可以向一个拦截器绑定类型注释另一个拦截器绑定类型。拦截器绑定是具有传递性的 — 拥有第一个拦截器绑定的任何Web Bean都继承被声明为元注释的拦截器绑定。"
#. Tag: programlisting
#: interceptors.xml:186
@@ -501,72 +513,71 @@
"@Retention(RUNTIME)\n"
"public @interface Action { ... }]]>"
msgstr ""
+"<![CDATA[@Transactional @Secure\n"
+"@InterceptorBindingType\n"
+"@Target(TYPE)\n"
+"@Retention(RUNTIME)\n"
+"public @interface Action { ... }]]>"
#. Tag: para
#: interceptors.xml:188
#, no-c-format
-msgid ""
-"Any Web Bean annotated <literal>@Action</literal> will be bound to both "
-"<literal>TransactionInterceptor</literal> and <literal>SecurityInterceptor</"
-"literal>. (And even <literal>TransactionalSecureInterceptor</literal>, if it "
-"exists.)"
-msgstr ""
+msgid "Any Web Bean annotated <literal>@Action</literal> will be bound to both <literal>TransactionInterceptor</literal> and <literal>SecurityInterceptor</literal>. (And even <literal>TransactionalSecureInterceptor</literal>, if it exists.)"
+msgstr "任何使用 <literal>@Action</literal> 注释的Web Bean都被绑定到 <literal>TransactionInterceptor</literal> 和 <literal>SecurityInterceptor</literal> 。(如果存在 <literal>TransactionalSecureInterceptor</literal> 的话,甚至可以绑定到这个拦截器)"
#. Tag: title
#: interceptors.xml:195
#, no-c-format
msgid "Use of <literal>@Interceptors</literal>"
-msgstr ""
+msgstr " <literal>@Interceptors</literal> 的使用"
#. Tag: para
#: interceptors.xml:197
#, no-c-format
-msgid ""
-"The <literal>@Interceptors</literal> annotation defined by the EJB "
-"specification is supported for both enterprise and simple Web Beans, for "
-"example:"
-msgstr ""
+msgid "The <literal>@Interceptors</literal> annotation defined by the EJB specification is supported for both enterprise and simple Web Beans, for example:"
+msgstr "企业级和简单的Web Bean都支持EJB规范指定的 <literal>@Interceptors</literal> 注释,例如:"
#. Tag: programlisting
#: interceptors.xml:200
#, no-c-format
msgid ""
-"<![CDATA[(a)Interceptors({TransactionInterceptor.class, SecurityInterceptor."
-"class})\n"
+"<![CDATA[(a)Interceptors({TransactionInterceptor.class, SecurityInterceptor.class})\n"
"public class ShoppingCart {\n"
" public void checkout() { ... }\n"
"}]]>"
msgstr ""
+"<![CDATA[(a)Interceptors({TransactionInterceptor.class, SecurityInterceptor.class})\n"
+"public class ShoppingCart {\n"
+" public void checkout() { ... }\n"
+"}]]>"
#. Tag: para
#: interceptors.xml:202
#, no-c-format
msgid "However, this approach suffers the following drawbacks:"
-msgstr ""
+msgstr "然而,这种方法具有下列缺陷:"
#. Tag: para
#: interceptors.xml:206
#, no-c-format
msgid "the interceptor implementation is hardcoded in business code,"
-msgstr ""
+msgstr "拦截器实现被硬编码到在业务代码中,"
#. Tag: para
#: interceptors.xml:209
#, no-c-format
msgid "interceptors may not be easily disabled at deployment time, and"
-msgstr ""
+msgstr "拦截器可能无法轻松地在部署期间关闭,并且"
#. Tag: para
#: interceptors.xml:212
#, no-c-format
-msgid ""
-"the interceptor ordering is non-global — it is determined by the order in "
-"which interceptors are listed at the class level."
-msgstr ""
+msgid "the interceptor ordering is non-global — it is determined by the order in which interceptors are listed at the class level."
+msgstr "拦截器的顺序是非全局性的 — 它由在类级别上列出的拦截器的顺序决定。"
#. Tag: para
#: interceptors.xml:217
#, no-c-format
-msgid ""
-"Therefore, we recommend the use of Web Beans-style interceptor bindings."
-msgstr ""
+msgid "Therefore, we recommend the use of Web Beans-style interceptor bindings."
+msgstr "因此,我们建议使用Web Bean风格的拦截器绑定。"
+
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1951 - doc/trunk/reference/zh-CN.
by webbeans-commits@lists.jboss.org
Author: alartin
Date: 2009-03-12 22:09:48 -0400 (Thu, 12 Mar 2009)
New Revision: 1951
Modified:
doc/trunk/reference/zh-CN/injection.po
Log:
Simple Chinese translation of injection section is finished.
Modified: doc/trunk/reference/zh-CN/injection.po
===================================================================
--- doc/trunk/reference/zh-CN/injection.po 2009-03-12 23:38:44 UTC (rev 1950)
+++ doc/trunk/reference/zh-CN/injection.po 2009-03-13 02:09:48 UTC (rev 1951)
@@ -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-19 20:26+0000\n"
-"PO-Revision-Date: 2008-12-19 20:26+0000\n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2009-03-13 10:08+0800\n"
+"Last-Translator: Sean Wu <alartin(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,19 +17,19 @@
#: injection.xml:4
#, no-c-format
msgid "Dependency injection"
-msgstr ""
+msgstr "依赖注入"
#. Tag: para
#: injection.xml:6
#, no-c-format
msgid "Web Beans supports three primary mechanisms for dependency injection:"
-msgstr ""
+msgstr "Web Beans支持三种主要的依赖注入机制:"
#. Tag: para
#: injection.xml:8
#, no-c-format
msgid "Constructor parameter injection:"
-msgstr ""
+msgstr "构造器参数注入:"
#. Tag: programlisting
#: injection.xml:10
@@ -46,12 +46,22 @@
"\n"
"}]]>"
msgstr ""
+"<![CDATA[public class Checkout {\n"
+" \n"
+" private final ShoppingCart cart;\n"
+" \n"
+" @Initializer\n"
+" public Checkout(ShoppingCart cart) {\n"
+" this.cart = cart;\n"
+" }\n"
+"\n"
+"}]]>"
#. Tag: para
#: injection.xml:12
#, no-c-format
msgid "<emphasis>Initializer</emphasis> method parameter injection:"
-msgstr ""
+msgstr "<emphasis>初始化</emphasis> 方法参数注入:"
#. Tag: programlisting
#: injection.xml:14
@@ -68,12 +78,22 @@
" \n"
"}]]>"
msgstr ""
+"<![CDATA[public class Checkout {\n"
+" \n"
+" private ShoppingCart cart;\n"
+"\n"
+" @Initializer \n"
+" void setShoppingCart(ShoppingCart cart) {\n"
+" this.cart = cart;\n"
+" }\n"
+" \n"
+"}]]>"
#. Tag: para
#: injection.xml:16
#, no-c-format
msgid "And direct field injection:"
-msgstr ""
+msgstr "和直接的域注入:"
#. Tag: programlisting
#: injection.xml:18
@@ -85,69 +105,59 @@
" \n"
"}]]>"
msgstr ""
+"<![CDATA[public class Checkout {\n"
+"\n"
+" private @Current ShoppingCart cart;\n"
+" \n"
+"}]]>"
#. Tag: para
#: injection.xml:20
#, no-c-format
-msgid ""
-"Dependency injection always occurs when the Web Bean instance is first "
-"instantiated."
-msgstr ""
+msgid "Dependency injection always occurs when the Web Bean instance is first instantiated."
+msgstr "当Web Bean实例被首次初始化时,依赖注入总是随之发生。"
#. Tag: para
#: injection.xml:25
#, no-c-format
-msgid ""
-"First, the Web Bean manager calls the Web Bean constructor, to obtain an "
-"instance of the Web Bean."
-msgstr ""
+msgid "First, the Web Bean manager calls the Web Bean constructor, to obtain an instance of the Web Bean."
+msgstr "首先,Web Bean管理器调用Web Bean构造器来获得一个Web Bean的实例。"
#. Tag: para
#: injection.xml:29
#, no-c-format
-msgid ""
-"Next, the Web Bean manager initializes the values of all injected fields of "
-"the Web Bean."
-msgstr ""
+msgid "Next, the Web Bean manager initializes the values of all injected fields of the Web Bean."
+msgstr "接下来,Web Bean管理器初始化这个Web bean的所有注入域的值。"
#. Tag: para
#: injection.xml:33
#, no-c-format
msgid "Next, the Web Bean manager calls all initializer methods of Web Bean."
-msgstr ""
+msgstr "然后,Web Bean管理器调用这个Web Bean的初始化方法。"
#. Tag: para
#: injection.xml:37
#, no-c-format
-msgid ""
-"Finally, the <literal>@PostConstruct</literal> method of the Web Bean, if "
-"any, is called."
-msgstr ""
+msgid "Finally, the <literal>@PostConstruct</literal> method of the Web Bean, if any, is called."
+msgstr "最后, 如果有 <literal>@PostConstruct</literal> 方法的话,调用这个方法。"
#. Tag: para
#: injection.xml:42
#, no-c-format
-msgid ""
-"Constructor parameter injection is not supported for EJB beans, since the "
-"EJB is instantiated by the EJB container, not the Web Bean manager."
-msgstr ""
+msgid "Constructor parameter injection is not supported for EJB beans, since the EJB is instantiated by the EJB container, not the Web Bean manager."
+msgstr "EJB Beans不支持构造器参数注入,因为EJB是由EJB容器负责实例化,而不是Web Bean管理器负责。"
#. Tag: para
#: injection.xml:45
#, no-c-format
-msgid ""
-"Parameters of constructors and initializer methods need not be explicitly "
-"annotated when the default binding type <literal>@Current</literal> applies. "
-"Injected fields, however, <emphasis>must</emphasis> specify a binding type, "
-"even when the default binding type applies. If the field does not specify a "
-"binding type, it will not be injected."
-msgstr ""
+msgid "Parameters of constructors and initializer methods need not be explicitly annotated when the default binding type <literal>@Current</literal> applies. Injected fields, however, <emphasis>must</emphasis> specify a binding type, even when the default binding type applies. If the field does not specify a binding type, it will not be injected."
+msgstr "当应用默认绑定类型<literal>@Current</literal>时,构造器的参数和初始化方法需要显式地注释。然而,即使应用了默认的绑定类型,注入域 也<emphasis>必须</emphasis> 指定一个绑定类型。如果一个域没有指定绑定类型,这个域将不会有任何注入发生。"
#. Tag: para
#: injection.xml:51
#, no-c-format
msgid "Producer methods also support parameter injection:"
-msgstr ""
+msgstr "生产者方法也支持参数注入:"
#. Tag: programlisting
#: injection.xml:53
@@ -157,86 +167,63 @@
" return new Checkout(cart);\n"
"}]]>"
msgstr ""
+"<![CDATA[@Produces Checkout createCheckout(ShoppingCart cart) {\n"
+" return new Checkout(cart);\n"
+"}]]>"
#. Tag: para
#: injection.xml:55
#, no-c-format
-msgid ""
-"Finally, observer methods (which we'll meet in <xref linkend=\"events\"/>), "
-"disposal methods and destructor methods all support parameter injection."
-msgstr ""
+msgid "Finally, observer methods (which we'll meet in <xref linkend=\"events\"/>), disposal methods and destructor methods all support parameter injection."
+msgstr "最后,观察者方法(我们将在 <xref linkend=\"events\"/>一章中讨论),清除(disposal)方法和解构(destructor)方法都只支持参数注入。"
#. Tag: para
#: injection.xml:58
#, no-c-format
-msgid ""
-"The Web Beans specification defines a procedure, called the "
-"<emphasis>typesafe resolution algorithm</emphasis>, that the Web Bean "
-"manager follows when identifying the Web Bean to inject to an injection "
-"point. This algorithm looks complex at first, but once you understand it, "
-"it's really quite intuitive. Typesafe resolution is performed at system "
-"initialization time, which means that the manager will inform the user "
-"immediately if a Web Bean's dependencies cannot be satisfied, by throwing a "
-"<literal>UnsatisfiedDependencyException</literal> or "
-"<literal>AmbiguousDependencyException</literal>."
-msgstr ""
+msgid "The Web Beans specification defines a procedure, called the <emphasis>typesafe resolution algorithm</emphasis>, that the Web Bean manager follows when identifying the Web Bean to inject to an injection point. This algorithm looks complex at first, but once you understand it, it's really quite intuitive. Typesafe resolution is performed at system initialization time, which means that the manager will inform the user immediately if a Web Bean's dependencies cannot be satisfied, by throwing a <literal>UnsatisfiedDependencyException</literal> or <literal>AmbiguousDependencyException</literal>."
+msgstr "Web Beans规范定义了一个称为 <emphasis>类型安全解析算法</emphasis>的过程,当在注入点识别所注入的Web Bean时,Web Bean管理器会遵循这个过程。这个算法初看起来非常复杂,然而你一旦理解了它,它就相当直观。类型安全解析在系统初始化的时候执行,这意味着如果Web Bean的依赖无法被满足的时候,管理器将立刻通知用户,抛出一个 <literal>UnsatisfiedDependencyException</literal> 异常或者 <literal>AmbiguousDependencyException</literal> 异常。"
#. Tag: para
#: injection.xml:67
#, no-c-format
-msgid ""
-"The purpose of this algorithm is to allow multiple Web Beans to implement "
-"the same API type and either:"
-msgstr ""
+msgid "The purpose of this algorithm is to allow multiple Web Beans to implement the same API type and either:"
+msgstr "这个算法的目的是允许多个Web Beans实现相同的API类型,并且:"
#. Tag: para
#: injection.xml:72
#, no-c-format
-msgid ""
-"allow the client to select which implementation it requires using "
-"<emphasis>binding annotations</emphasis>,"
-msgstr ""
+msgid "allow the client to select which implementation it requires using <emphasis>binding annotations</emphasis>,"
+msgstr "允许客户通过 <emphasis>绑定注释</emphasis> 选择它需要的具体实现,"
#. Tag: para
#: injection.xml:77
#, no-c-format
-msgid ""
-"allow the application deployer to select which implementation is appropriate "
-"for a particular deployment, without changes to the client, by enabling or "
-"disabling <emphasis>deployment types</emphasis>, or"
-msgstr ""
+msgid "allow the application deployer to select which implementation is appropriate for a particular deployment, without changes to the client, by enabling or disabling <emphasis>deployment types</emphasis>, or"
+msgstr "允许应用部署者激活或者关闭 <emphasis>部署类型</emphasis> ,从而实现在特定的部署环境下选择适当的具体实现,而无需修改客户,或者"
#. Tag: para
#: injection.xml:82
#, no-c-format
-msgid ""
-"allow one implementation of an API to override another implementation of the "
-"same API at deployment time, without changes to the client, using "
-"<emphasis>deployment type precedence</emphasis>."
-msgstr ""
+msgid "allow one implementation of an API to override another implementation of the same API at deployment time, without changes to the client, using <emphasis>deployment type precedence</emphasis>."
+msgstr "使用<emphasis>部署类型优先级</emphasis> 来允许一个API的实现在部署时重载相同API的另一个实现,而无需修改客户。"
#. Tag: para
#: injection.xml:88
#, no-c-format
-msgid ""
-"Let's explore how the Web Beans manager determines a Web Bean to be injected."
-msgstr ""
+msgid "Let's explore how the Web Beans manager determines a Web Bean to be injected."
+msgstr "让我们看看Web Bean管理器如何决定注入哪个Web Bean。"
#. Tag: title
#: injection.xml:91
#, no-c-format
msgid "Binding annotations"
-msgstr ""
+msgstr "绑定注释"
#. Tag: para
#: injection.xml:93
#, no-c-format
-msgid ""
-"If we have more than one Web Bean that implements a particular API type, the "
-"injection point can specify exactly which Web Bean should be injected using "
-"a binding annotation. For example, there might be two implementations of "
-"<literal>PaymentProcessor</literal>:"
-msgstr ""
+msgid "If we have more than one Web Bean that implements a particular API type, the injection point can specify exactly which Web Bean should be injected using a binding annotation. For example, there might be two implementations of <literal>PaymentProcessor</literal>:"
+msgstr "如果我们拥有实现特定API类型的多个Web Bean,我们可以使用一个绑定注释来指定在注入点注入哪个Web Bean。例如,我们可能有两个 <literal>PaymentProcessor</literal> 的实现:"
#. Tag: programlisting
#: injection.xml:98
@@ -247,6 +234,10 @@
" public void process(Payment payment) { ... }\n"
"}]]>"
msgstr ""
+"<![CDATA[@PayByCheque\n"
+"public class ChequePaymentProcessor implements PaymentProcessor {\n"
+" public void process(Payment payment) { ... }\n"
+"}]]>"
#. Tag: programlisting
#: injection.xml:100
@@ -257,14 +248,16 @@
" public void process(Payment payment) { ... }\n"
"}]]>"
msgstr ""
+"<![CDATA[@PayByCreditCard\n"
+"public class CreditCardPaymentProcessor implements PaymentProcessor {\n"
+" public void process(Payment payment) { ... }\n"
+"}]]>"
#. Tag: para
#: injection.xml:102
#, no-c-format
-msgid ""
-"Where <literal>@PayByCheque</literal> and <literal>@PayByCreditCard</"
-"literal> are binding annotations:"
-msgstr ""
+msgid "Where <literal>@PayByCheque</literal> and <literal>@PayByCreditCard</literal> are binding annotations:"
+msgstr "其中 <literal>@PayByCheque</literal> 和 <literal>@PayByCreditCard</literal> 是绑定注释:"
#. Tag: programlisting
#: injection.xml:105
@@ -275,6 +268,10 @@
"@BindingType\n"
"public @interface PayByCheque {}]]>"
msgstr ""
+"<![CDATA[@Retention(RUNTIME)\n"
+"@Target({TYPE, METHOD, FIELD, PARAMETER})\n"
+"@BindingType\n"
+"public @interface PayByCheque {}]]>"
#. Tag: programlisting
#: injection.xml:107
@@ -285,20 +282,22 @@
"@BindingType\n"
"public @interface PayByCreditCard {}]]>"
msgstr ""
+"<![CDATA[@Retention(RUNTIME)\n"
+"@Target({TYPE, METHOD, FIELD, PARAMETER})\n"
+"@BindingType\n"
+"public @interface PayByCreditCard {}]]>"
#. Tag: para
#: injection.xml:109
#, no-c-format
-msgid ""
-"A client Web Bean developer uses the binding annotation to specify exactly "
-"which Web Bean should be injected."
-msgstr ""
+msgid "A client Web Bean developer uses the binding annotation to specify exactly which Web Bean should be injected."
+msgstr "一个客户Web Bean开发者使用绑定注释来指定到底哪个Web Bean应该被注入。"
#. Tag: para
#: injection.xml:112
#, no-c-format
msgid "Using field injection:"
-msgstr ""
+msgstr "使用域注入:"
#. Tag: programlisting
#: injection.xml:114
@@ -307,32 +306,38 @@
"<![CDATA[@PayByCheque PaymentProcessor chequePaymentProcessor;\n"
"@PayByCreditCard PaymentProcessor creditCardPaymentProcessor;]]>"
msgstr ""
+"<![CDATA[@PayByCheque PaymentProcessor chequePaymentProcessor;\n"
+"@PayByCreditCard PaymentProcessor creditCardPaymentProcessor;]]>"
#. Tag: para
#: injection.xml:116
#, no-c-format
msgid "Using initializer method injection:"
-msgstr ""
+msgstr "使用初始化方法注入:"
#. Tag: programlisting
#: injection.xml:118
#, no-c-format
msgid ""
"<![CDATA[@Initializer\n"
-"public void setPaymentProcessors(@PayByCheque PaymentProcessor "
-"chequePaymentProcessor, \n"
-" @PayByCreditCard PaymentProcessor "
-"creditCardPaymentProcessor) {\n"
+"public void setPaymentProcessors(@PayByCheque PaymentProcessor chequePaymentProcessor, \n"
+" @PayByCreditCard PaymentProcessor creditCardPaymentProcessor) {\n"
" this.chequePaymentProcessor = chequePaymentProcessor;\n"
" this.creditCardPaymentProcessor = creditCardPaymentProcessor;\n"
"}]]>"
msgstr ""
+"<![CDATA[@Initializer\n"
+"public void setPaymentProcessors(@PayByCheque PaymentProcessor chequePaymentProcessor, \n"
+" @PayByCreditCard PaymentProcessor creditCardPaymentProcessor) {\n"
+" this.chequePaymentProcessor = chequePaymentProcessor;\n"
+" this.creditCardPaymentProcessor = creditCardPaymentProcessor;\n"
+"}]]>"
#. Tag: para
#: injection.xml:120
#, no-c-format
msgid "Or using constructor injection:"
-msgstr ""
+msgstr "或者使用构造器注入:"
#. Tag: programlisting
#: injection.xml:122
@@ -340,24 +345,29 @@
msgid ""
"<![CDATA[@Initializer\n"
"public Checkout(@PayByCheque PaymentProcessor chequePaymentProcessor, \n"
-" @PayByCreditCard PaymentProcessor "
-"creditCardPaymentProcessor) {\n"
+" @PayByCreditCard PaymentProcessor creditCardPaymentProcessor) {\n"
" this.chequePaymentProcessor = chequePaymentProcessor;\n"
" this.creditCardPaymentProcessor = creditCardPaymentProcessor;\n"
"}]]>"
msgstr ""
+"<![CDATA[@Initializer\n"
+"public Checkout(@PayByCheque PaymentProcessor chequePaymentProcessor, \n"
+" @PayByCreditCard PaymentProcessor creditCardPaymentProcessor) {\n"
+" this.chequePaymentProcessor = chequePaymentProcessor;\n"
+" this.creditCardPaymentProcessor = creditCardPaymentProcessor;\n"
+"}]]>"
#. Tag: title
#: injection.xml:125
#, no-c-format
msgid "Binding annotations with members"
-msgstr ""
+msgstr "成员绑定注释"
#. Tag: para
#: injection.xml:127
#, no-c-format
msgid "Binding annotations may have members:"
-msgstr ""
+msgstr "绑定注释可以拥有成员:"
#. Tag: programlisting
#: injection.xml:129
@@ -370,12 +380,18 @@
" PaymentType value();\n"
"}]]>"
msgstr ""
+"<![CDATA[@Retention(RUNTIME)\n"
+"@Target({TYPE, METHOD, FIELD, PARAMETER})\n"
+"@BindingType\n"
+"public @interface PayBy {\n"
+" PaymentType value();\n"
+"}]]>"
#. Tag: para
#: injection.xml:131
#, no-c-format
msgid "In which case, the member value is significant:"
-msgstr ""
+msgstr "在这个例子,成员值是有意义的:"
#. Tag: programlisting
#: injection.xml:133
@@ -384,53 +400,50 @@
"<![CDATA[@PayBy(CHEQUE) PaymentProcessor chequePaymentProcessor;\n"
"@PayBy(CREDIT_CARD) PaymentProcessor creditCardPaymentProcessor;]]>"
msgstr ""
+"<![CDATA[@PayBy(CHEQUE) PaymentProcessor chequePaymentProcessor;\n"
+"@PayBy(CREDIT_CARD) PaymentProcessor creditCardPaymentProcessor;]]>"
#. Tag: para
#: injection.xml:135
#, no-c-format
-msgid ""
-"You can tell the Web Bean manager to ignore a member of a binding annotation "
-"type by annotating the member <literal>@NonBinding</literal>."
-msgstr ""
+msgid "You can tell the Web Bean manager to ignore a member of a binding annotation type by annotating the member <literal>@NonBinding</literal>."
+msgstr "你可以告诉Web Bean管理器忽略一个绑定注释的成员,只需在这个成员上使用 <literal>@NonBinding</literal> 注释。"
#. Tag: title
#: injection.xml:141
#, no-c-format
msgid "Combinations of binding annnotations"
-msgstr ""
+msgstr "绑定注释的组合"
#. Tag: para
#: injection.xml:143
#, no-c-format
msgid "An injection point may even specify multiple binding annotations:"
-msgstr ""
+msgstr "一个注入点甚至可以指定多个绑定注释:"
#. Tag: programlisting
#: injection.xml:145
#, no-c-format
-msgid ""
-"<![CDATA[@Asynchronous @PayByCheque PaymentProcessor paymentProcessor]]>"
-msgstr ""
+msgid "<![CDATA[@Asynchronous @PayByCheque PaymentProcessor paymentProcessor]]>"
+msgstr "<![CDATA[@Asynchronous @PayByCheque PaymentProcessor paymentProcessor]]>"
#. Tag: para
#: injection.xml:147
#, no-c-format
-msgid ""
-"In this case, only a Web Bean which has <emphasis>both</emphasis> binding "
-"annotations would be eligible for injection."
-msgstr ""
+msgid "In this case, only a Web Bean which has <emphasis>both</emphasis> binding annotations would be eligible for injection."
+msgstr "在这个情况下,只有<emphasis>拥有两个</emphasis>绑定注释的Web Bean才有资格被注入。"
#. Tag: title
#: injection.xml:153
#, no-c-format
msgid "Binding annotations and producer methods"
-msgstr ""
+msgstr "绑定注释和生产者方法"
#. Tag: para
#: injection.xml:155
#, no-c-format
msgid "Even producer methods may specify binding annotations:"
-msgstr ""
+msgstr "甚至生产者方法可以指定绑定注释:"
#. Tag: programlisting
#: injection.xml:157
@@ -438,74 +451,63 @@
msgid ""
"<![CDATA[@Produces \n"
"@Asynchronous @PayByCheque \n"
-"PaymentProcessor createAsyncPaymentProcessor(@PayByCheque PaymentProcessor "
-"processor) {\n"
+"PaymentProcessor createAsyncPaymentProcessor(@PayByCheque PaymentProcessor processor) {\n"
" return new AsynchronousPaymentProcessor(processor);\n"
"}]]>"
msgstr ""
+"<![CDATA[@Produces \n"
+"@Asynchronous @PayByCheque \n"
+"PaymentProcessor createAsyncPaymentProcessor(@PayByCheque PaymentProcessor processor) {\n"
+" return new AsynchronousPaymentProcessor(processor);\n"
+"}]]>"
#. Tag: title
#: injection.xml:162
#, no-c-format
msgid "The default binding type"
-msgstr ""
+msgstr "默认的绑定类型"
#. Tag: para
#: injection.xml:164
#, no-c-format
-msgid ""
-"Web Beans defines a binding type <literal>@Current</literal> that is the "
-"default binding type for any injection point or Web Bean that does not "
-"explicitly specify a binding type."
-msgstr ""
+msgid "Web Beans defines a binding type <literal>@Current</literal> that is the default binding type for any injection point or Web Bean that does not explicitly specify a binding type."
+msgstr "Web Beans定义了一个 <literal>@Current</literal> 绑定类型,这个绑定类型是任何注入点或者没有显式指定绑定类型的Web Bean的默认绑定类型。"
#. Tag: para
#: injection.xml:168
#, no-c-format
-msgid ""
-"There are two common circumstances in which it is necessary to explicitly "
-"specify <literal>@Current</literal>:"
-msgstr ""
+msgid "There are two common circumstances in which it is necessary to explicitly specify <literal>@Current</literal>:"
+msgstr "通常有两种环境需要我们显式地指定<literal>@Current</literal> :"
#. Tag: para
#: injection.xml:173
#, no-c-format
-msgid ""
-"on a field, in order to declare it as an injected field with the default "
-"binding type, and"
-msgstr ""
+msgid "on a field, in order to declare it as an injected field with the default binding type, and"
+msgstr "在一个域上指定,以便声明这是一个拥有默认绑定类型的注入域,以及"
#. Tag: para
#: injection.xml:177
#, no-c-format
-msgid ""
-"on a Web Bean which has another binding type in addition to the default "
-"binding type."
-msgstr ""
+msgid "on a Web Bean which has another binding type in addition to the default binding type."
+msgstr "在一个Web Bean上指定,这个Web Bean除了默认的绑定类型之外还拥有其他的绑定类型。"
#. Tag: title
#: injection.xml:187
#, no-c-format
msgid "Deployment types"
-msgstr ""
+msgstr "部署类型"
#. Tag: para
#: injection.xml:189
#, no-c-format
-msgid ""
-"All Web Beans have a <emphasis>deployment type</emphasis>. Each deployment "
-"type identifies a set of Web Beans that should be conditionally installed in "
-"some deployments of the system."
-msgstr ""
+msgid "All Web Beans have a <emphasis>deployment type</emphasis>. Each deployment type identifies a set of Web Beans that should be conditionally installed in some deployments of the system."
+msgstr "所有的Web Beans都有一个 <emphasis>部署类型</emphasis> 。每个部署类型标识一套Web Beans,这套Web Beans会有条件地在某些系统部署下面被安装。"
#. Tag: para
#: injection.xml:193
#, no-c-format
-msgid ""
-"For example, we could define a deployment type named <literal>@Mock</"
-"literal>, which would identify Web Beans that should only be installed when "
-"the system executes inside an integration testing environment:"
-msgstr ""
+msgid "For example, we could define a deployment type named <literal>@Mock</literal>, which would identify Web Beans that should only be installed when the system executes inside an integration testing environment:"
+msgstr "例如,我们可以定义一套为名为 <literal>@Mock</literal> 的部署类型,这种部署类型用来标识只应该在整合测试环境下才在系统中安装的Web Beans:"
#. Tag: programlisting
#: injection.xml:197
@@ -516,14 +518,16 @@
" @DeploymentType\n"
" public @interface Mock {}]]>"
msgstr ""
+"<![CDATA[@Retention(RUNTIME)\n"
+" @Target({TYPE, METHOD})\n"
+" @DeploymentType\n"
+" public @interface Mock {}]]>"
#. Tag: para
#: injection.xml:199
#, no-c-format
-msgid ""
-"Suppose we had some Web Bean that interacted with an external system to "
-"process payments:"
-msgstr ""
+msgid "Suppose we had some Web Bean that interacted with an external system to process payments:"
+msgstr "假定我们有一些和外部系统交互的Web Beans来处理付费:"
#. Tag: programlisting
#: injection.xml:202
@@ -537,22 +541,25 @@
" \n"
"}]]>"
msgstr ""
+"<![CDATA[public class ExternalPaymentProcessor {\n"
+" \n"
+" public void process(Payment p) {\n"
+" ...\n"
+" }\n"
+" \n"
+"}]]>"
#. Tag: para
#: injection.xml:204
#, no-c-format
-msgid ""
-"Since this Web Bean does not explicitly specify a deployment type, it has "
-"the default deployment type <literal>@Production</literal>."
-msgstr ""
+msgid "Since this Web Bean does not explicitly specify a deployment type, it has the default deployment type <literal>@Production</literal>."
+msgstr "因为这个Web Bean并不显式地指定一个部署类型,因此它有一个默认的 <literal>@Production</literal> 部署类型。"
#. Tag: para
#: injection.xml:207
#, no-c-format
-msgid ""
-"For integration or unit testing, the external system is slow or unavailable. "
-"So we would create a mock object:"
-msgstr ""
+msgid "For integration or unit testing, the external system is slow or unavailable. So we would create a mock object:"
+msgstr "在整合测试或者单元测试期间,外部系统可能会很慢或者无法获得,所以我们可能会创建一个模拟对象:"
#. Tag: programlisting
#: injection.xml:210
@@ -568,39 +575,39 @@
"\n"
"}]]>"
msgstr ""
+"<![CDATA[@Mock \n"
+"public class MockPaymentProcessor implements PaymentProcessor {\n"
+"\n"
+" @Override\n"
+" public void process(Payment p) {\n"
+" p.setSuccessful(true);\n"
+" }\n"
+"\n"
+"}]]>"
#. Tag: para
#: injection.xml:212
#, no-c-format
-msgid ""
-"But how does the Web Bean manager determine which implementation to use in a "
-"particular deployment?"
-msgstr ""
+msgid "But how does the Web Bean manager determine which implementation to use in a particular deployment?"
+msgstr "但是Web Bean管理器如何决定在一个特定部署中使用哪一个实现?"
#. Tag: title
#: injection.xml:216
#, no-c-format
msgid "Enabling deployment types"
-msgstr ""
+msgstr "激活部署类型"
#. Tag: para
#: injection.xml:218
#, no-c-format
-msgid ""
-"Web Beans defines two built-in deployment types: <literal>@Production</"
-"literal> and <literal>@Standard</literal>. By default, only Web Beans with "
-"the built-in deployment types are enabled when the system is deployed. We "
-"can identify additional deployment types to be enabled in a particular "
-"deployment by listing them in <literal>web-beans.xml</literal>."
-msgstr ""
+msgid "Web Beans defines two built-in deployment types: <literal>@Production</literal> and <literal>@Standard</literal>. By default, only Web Beans with the built-in deployment types are enabled when the system is deployed. We can identify additional deployment types to be enabled in a particular deployment by listing them in <literal>web-beans.xml</literal>."
+msgstr "Web Beans定义了两个内置的部署类型: <literal>@Production</literal> 和 <literal>@Standard</literal>。默认情况下,当系统被部署时,只有使用内置部署类型的Web Beans才被激活。我们可以在 <literal>web-beans.xml</literal> 文件中列出其他的部署类型以便在某个特定的部署中激活它们。"
#. Tag: para
#: injection.xml:224
#, no-c-format
-msgid ""
-"Going back to our example, when we deploy our integration tests, we want all "
-"our <literal>@Mock</literal> objects to be installed:"
-msgstr ""
+msgid "Going back to our example, when we deploy our integration tests, we want all our <literal>@Mock</literal> objects to be installed:"
+msgstr "回到我们的例子中,当我们部署我们的整合测试时,我们希望我们标识的所有的 <literal>@Mock</literal> 对象被安装:"
#. Tag: programlisting
#: injection.xml:227
@@ -614,368 +621,269 @@
" </Deploy>\n"
"</WebBeans>]]>"
msgstr ""
+"<![CDATA[<WebBeans>\n"
+" <Deploy>\n"
+" <Standard/>\n"
+" <Production/>\n"
+" <test:Mock/>\n"
+" </Deploy>\n"
+"</WebBeans>]]>"
#. Tag: para
#: injection.xml:229
#, no-c-format
-msgid ""
-"Now the Web Bean manager will identify and install all Web Beans annotated "
-"<literal>@Production</literal>, <literal>@Standard</literal> or "
-"<literal>@Mock</literal> at deployment time."
-msgstr ""
+msgid "Now the Web Bean manager will identify and install all Web Beans annotated <literal>@Production</literal>, <literal>@Standard</literal> or <literal>@Mock</literal> at deployment time."
+msgstr "现在,Web Bean管理器可以识别并且在部署期间安装所有拥有 <literal>@Production</literal>, <literal>@Standard</literal> 和 <literal>@Mock</literal> 注释的Web Beans。"
#. Tag: para
#: injection.xml:233
#, no-c-format
-msgid ""
-"The deployment type <literal>@Standard</literal> is used only for certain "
-"special Web Beans defined by the Web Beans specification. We can't use it "
-"for our own Web Beans, and we can't disable it."
-msgstr ""
+msgid "The deployment type <literal>@Standard</literal> is used only for certain special Web Beans defined by the Web Beans specification. We can't use it for our own Web Beans, and we can't disable it."
+msgstr " <literal>@Standard</literal> 只是Web Beans规范中为特定的Web Bean使用的部署类型。我们无法在我们自己的Web Bean中使用它,并且我们不能关闭它。"
#. Tag: para
#: injection.xml:237
#, no-c-format
-msgid ""
-"The deployment type <literal>@Production</literal> is the default deployment "
-"type for Web Beans which don't explicitly declare a deployment type, and may "
-"be disabled."
-msgstr ""
+msgid "The deployment type <literal>@Production</literal> is the default deployment type for Web Beans which don't explicitly declare a deployment type, and may be disabled."
+msgstr " <literal>@Production</literal> 是没有显式声明部署类型的Web Beans的默认部署类型,它可以被关闭。"
#. Tag: title
#: injection.xml:244
#, no-c-format
msgid "Deployment type precedence"
-msgstr ""
+msgstr "部署类型优先级"
#. Tag: para
#: injection.xml:246
#, no-c-format
-msgid ""
-"If you've been paying attention, you're probably wondering how the Web Bean "
-"manager decides which implementation — <literal>ExternalPaymentProcessor</"
-"literal> or <literal>MockPaymentProcessor</literal> — to choose. Consider "
-"what happens when the manager encounters this injection point:"
-msgstr ""
+msgid "If you've been paying attention, you're probably wondering how the Web Bean manager decides which implementation — <literal>ExternalPaymentProcessor</literal> or <literal>MockPaymentProcessor</literal> — to choose. Consider what happens when the manager encounters this injection point:"
+msgstr "如果你注意的话,你可能想知道Web Bean如何决定使用哪个实现— <literal>ExternalPaymentProcessor</literal> 还是 <literal>MockPaymentProcessor</literal> —。思考一下当管理器遇到这个注入点时会发生什么:"
#. Tag: programlisting
#: injection.xml:251
#, no-c-format
msgid "<![CDATA[@Current PaymentProcessor paymentProcessor]]>"
-msgstr ""
+msgstr "<![CDATA[@Current PaymentProcessor paymentProcessor]]>"
#. Tag: para
#: injection.xml:253
#, no-c-format
-msgid ""
-"There are now two Web Beans which satisfy the <literal>PaymentProcessor</"
-"literal> contract. Of course, we can't use a binding annotation to "
-"disambiguate, since binding annotations are hard-coded into the source at "
-"the injection point, and we want the manager to be able to decide at "
-"deployment time!"
-msgstr ""
+msgid "There are now two Web Beans which satisfy the <literal>PaymentProcessor</literal> contract. Of course, we can't use a binding annotation to disambiguate, since binding annotations are hard-coded into the source at the injection point, and we want the manager to be able to decide at deployment time!"
+msgstr "现在有两个Web Bean满足 <literal>PaymentProcessor</literal> 合约。当然,我们无法使用一个绑定注释来消除这个歧义,因为绑定注释在注入点被硬编码到了源代码中,并且我们希望管理器在部署时能够决定注入哪一个Web Bean!"
#. Tag: para
#: injection.xml:258
#, no-c-format
-msgid ""
-"The solution to this problem is that each deployment type has a different "
-"<emphasis>precedence</emphasis>. The precedence of the deployment types is "
-"determined by the order in which they appear in <literal>web-beans.xml</"
-"literal>. In our example, <literal>@Mock</literal> appears later than "
-"<literal>@Production</literal> so it has a higher precedence."
-msgstr ""
+msgid "The solution to this problem is that each deployment type has a different <emphasis>precedence</emphasis>. The precedence of the deployment types is determined by the order in which they appear in <literal>web-beans.xml</literal>. In our example, <literal>@Mock</literal> appears later than <literal>@Production</literal> so it has a higher precedence."
+msgstr "这个问题的解决方案是每个不同的部署类型都拥有不同的 <emphasis>优先级</emphasis> 。部署类型的优先级由它们在 <literal>web-beans.xml</literal> 中出现的顺序决定。在我们这个例子中, <literal>@Mock</literal> 比 <literal>@Production</literal> 出现的晚,所以它拥有更高的优先级。"
#. Tag: para
#: injection.xml:264
#, no-c-format
-msgid ""
-"Whenever the manager discovers that more than one Web Bean could satisfy the "
-"contract (API type plus binding annotations) specified by an injection "
-"point, it considers the relative precedence of the Web Beans. If one has a "
-"higher precedence than the others, it chooses the higher precedence Web Bean "
-"to inject. So, in our example, the Web Bean manager will inject "
-"<literal>MockPaymentProcessor</literal> when executing in our integration "
-"testing environment (which is exactly what we want)."
-msgstr ""
+msgid "Whenever the manager discovers that more than one Web Bean could satisfy the contract (API type plus binding annotations) specified by an injection point, it considers the relative precedence of the Web Beans. If one has a higher precedence than the others, it chooses the higher precedence Web Bean to inject. So, in our example, the Web Bean manager will inject <literal>MockPaymentProcessor</literal> when executing in our integration testing environment (which is exactly what we want)."
+msgstr "无论何时管理器发现有多个Web Bean能够满足一个注入点指定的合约(API类型加上绑定注释),它都会考虑Web Beans的相对优先级。它将注入拥有更高优先级的Web Bean。在我们这个例子中,当系统运行在整合测试环境中(这是我们想要的),Web Bean管理器将注入 <literal>MockPaymentProcessor</literal> 对象。"
#. Tag: para
#: injection.xml:271
#, no-c-format
-msgid ""
-"It's interesting to compare this facility to today's popular manager "
-"architectures. Various \"lightweight\" containers also allow conditional "
-"deployment of classes that exist in the classpath, but the classes that are "
-"to be deployed must be explicity, individually, listed in configuration code "
-"or in some XML configuration file. Web Beans does support Web Bean "
-"definition and configuration via XML, but in the common case where no "
-"complex configuration is required, deployment types allow a whole set of Web "
-"Beans to be enabled with a single line of XML. Meanwhile, a developer "
-"browsing the code can easily identify what deployment scenarios the Web Bean "
-"will be used in."
-msgstr ""
+msgid "It's interesting to compare this facility to today's popular manager architectures. Various \"lightweight\" containers also allow conditional deployment of classes that exist in the classpath, but the classes that are to be deployed must be explicity, individually, listed in configuration code or in some XML configuration file. Web Beans does support Web Bean definition and configuration via XML, but in the common case where no complex configuration is required, deployment types allow a whole set of Web Beans to be enabled with a single line of XML. Meanwhile, a developer browsing the code can easily identify what deployment scenarios the Web Bean will be used in."
+msgstr "将其和当今流行的管理器体系比较是很有意思的。各种 \"轻量级\"的容器也许也可以支持条件化部署在类路径中的类,但是这些需要部署的类必须显式地,逐个地列在配置代码或某个XML配置文件中。Web Bean当然支持通过XML来定义和配置Web Bean,但是多数情况下,只要不需要复杂的配置,部署类型可以使用一行XML就能配置一整套Web Beans。同时,浏览代码的开发者可以很容易识别这些Web Bean应该部署在哪些场景中。"
#. Tag: title
#: injection.xml:284
#, no-c-format
msgid "Example deployment types"
-msgstr ""
+msgstr "部署类型样例"
#. Tag: para
#: injection.xml:286
#, no-c-format
-msgid ""
-"Deployment types are useful for all kinds of things, here's some examples:"
-msgstr ""
+msgid "Deployment types are useful for all kinds of things, here's some examples:"
+msgstr "部署类型对所有事情都很有用,这是一些例子:"
#. Tag: para
#: injection.xml:290
#, no-c-format
-msgid ""
-"<literal>@Mock</literal> and <literal>@Staging</literal> deployment types "
-"for testing"
-msgstr ""
+msgid "<literal>@Mock</literal> and <literal>@Staging</literal> deployment types for testing"
+msgstr "<literal>@Mock</literal> 和 <literal>@Staging</literal> 是为测试准备的部署类型"
#. Tag: para
#: injection.xml:294
#, no-c-format
msgid "<literal>@AustralianTaxLaw</literal> for site-specific Web Beans"
-msgstr ""
+msgstr "<literal>@AustralianTaxLaw</literal> 是为特殊站点的Web Beans提供的部署类型"
#. Tag: para
#: injection.xml:297
#, no-c-format
-msgid ""
-"<literal>@SeamFramework</literal>, <literal>@Guice</literal> for third-party "
-"frameworks which build on Web Beans"
-msgstr ""
+msgid "<literal>@SeamFramework</literal>, <literal>@Guice</literal> for third-party frameworks which build on Web Beans"
+msgstr "<literal>@SeamFramework</literal>, <literal>@Guice</literal> 是为构建在Web Bean之上的第三方框架提供的部署类型"
#. Tag: para
#: injection.xml:301
#, no-c-format
-msgid ""
-"<literal>@Standard</literal> for standard Web Beans defined by the Web Beans "
-"specification"
-msgstr ""
+msgid "<literal>@Standard</literal> for standard Web Beans defined by the Web Beans specification"
+msgstr "<literal>@Standard</literal> 是为Web Bean规范定义的标准Web Bean提供的部署类型"
#. Tag: para
#: injection.xml:306
#, no-c-format
msgid "I'm sure you can think of more applications..."
-msgstr ""
+msgstr "我确信你可以想到更多的应用..."
#. Tag: title
#: injection.xml:313
#, no-c-format
msgid "Fixing unsatisfied dependencies"
-msgstr ""
+msgstr "修正没有满足条件的依赖"
#. Tag: para
#: injection.xml:315
#, no-c-format
-msgid ""
-"The typesafe resolution algorithm fails when, after considering the binding "
-"annotations and and deployment types of all Web Beans that implement the API "
-"type of an injection point, the Web Bean manager is unable to identify "
-"exactly one Web Bean to inject."
-msgstr ""
+msgid "The typesafe resolution algorithm fails when, after considering the binding annotations and and deployment types of all Web Beans that implement the API type of an injection point, the Web Bean manager is unable to identify exactly one Web Bean to inject."
+msgstr "考虑到所有实现一个注入点API类型的Web Bean的绑定注释和部署类型类型,如果解析算法失败,那么Web Bean管理器无法识别究竟应该注入哪个Web Bean。"
#. Tag: para
#: injection.xml:320
#, no-c-format
-msgid ""
-"It's usually easy to fix an <literal>UnsatisfiedDependencyException</"
-"literal> or <literal>AmbiguousDependencyException</literal>."
-msgstr ""
+msgid "It's usually easy to fix an <literal>UnsatisfiedDependencyException</literal> or <literal>AmbiguousDependencyException</literal>."
+msgstr "通常我们很容易修正一个<literal>UnsatisfiedDependencyException</literal> 或者 <literal>AmbiguousDependencyException</literal>。"
#. Tag: para
#: injection.xml:323
#, no-c-format
-msgid ""
-"To fix an <literal>UnsatisfiedDependencyException</literal>, simply provide "
-"a Web Bean which implements the API type and has the binding types of the "
-"injection point — or enable the deployment type of a Web Bean that "
-"already implements the API type and has the binding types."
-msgstr ""
+msgid "To fix an <literal>UnsatisfiedDependencyException</literal>, simply provide a Web Bean which implements the API type and has the binding types of the injection point — or enable the deployment type of a Web Bean that already implements the API type and has the binding types."
+msgstr "要修正一个 <literal>UnsatisfiedDependencyException</literal>,只须简单的提供一个实现API类型的Web Bean并且拥有注入点的绑定类型 — 或者激活一个已经实现API类型并且拥有绑定类型的Web Bean的部署类型。"
#. Tag: para
#: injection.xml:328
#, no-c-format
-msgid ""
-"To fix an <literal>AmbiguousDependencyException</literal>, introduce a "
-"binding type to distinguish between the two implementations of the API type, "
-"or change the deployment type of one of the implementations so that the Web "
-"Bean manager can use deployment type precedence to choose between them. An "
-"<literal>AmbiguousDependencyException</literal> can only occur if two Web "
-"Beans share a binding type and have exactly the same deployment type."
-msgstr ""
+msgid "To fix an <literal>AmbiguousDependencyException</literal>, introduce a binding type to distinguish between the two implementations of the API type, or change the deployment type of one of the implementations so that the Web Bean manager can use deployment type precedence to choose between them. An <literal>AmbiguousDependencyException</literal> can only occur if two Web Beans share a binding type and have exactly the same deployment type."
+msgstr "要修正一个 <literal>AmbiguousDependencyException</literal>,我们需要引入一个绑定类型来区分API类型的两个不同的实现,或者改变其中一个实现的部署类型以便Web Bean管理器可以使用部署类型优先级来决定究竟部署哪一个实现。只有两个Web Bean共享一个绑定类型并且拥有相同部署类型的时候才会抛出 <literal>AmbiguousDependencyException</literal> 。"
#. Tag: para
#: injection.xml:335
#, no-c-format
-msgid ""
-"There's one more issue you need to be aware of when using dependency "
-"injection in Web Beans."
-msgstr ""
+msgid "There's one more issue you need to be aware of when using dependency injection in Web Beans."
+msgstr "使用Web Bean依赖注入的时候还需要注意一个问题。"
#. Tag: title
#: injection.xml:341
#, no-c-format
msgid "Client proxies"
-msgstr ""
+msgstr "客户代理"
#. Tag: para
#: injection.xml:343
#, no-c-format
-msgid ""
-"Clients of an injected Web Bean do not usually hold a direct reference to a "
-"Web Bean instance."
-msgstr ""
+msgid "Clients of an injected Web Bean do not usually hold a direct reference to a Web Bean instance."
+msgstr "注入的Web Bean的客户通常不会直接拥有这个Web bean实例的引用。"
#. Tag: para
#: injection.xml:346
#, no-c-format
-msgid ""
-"Imagine that a Web Bean bound to the application scope held a direct "
-"reference to a Web Bean bound to the request scope. The application scoped "
-"Web Bean is shared between many different requests. However, each request "
-"should see a different instance of the request scoped Web bean!"
-msgstr ""
+msgid "Imagine that a Web Bean bound to the application scope held a direct reference to a Web Bean bound to the request scope. The application scoped Web Bean is shared between many different requests. However, each request should see a different instance of the request scoped Web bean!"
+msgstr "想象一下如果一个应用范围的Web Bean能够拥有一个请求范围的Web Bean的直接引用。应用范围的Web Bean是被很多不同的请求共享的。但是不同的请求应该看到不同的请求范围的Web Bean实例!"
#. Tag: para
#: injection.xml:351
#, no-c-format
-msgid ""
-"Now imagine that a Web Bean bound to the session scope held a direct "
-"reference to a Web Bean bound to the application scope. From time to time, "
-"the session context is serialized to disk in order to use memory more "
-"efficiently. However, the application scoped Web Bean instance should not be "
-"serialized along with the session scoped Web Bean!"
-msgstr ""
+msgid "Now imagine that a Web Bean bound to the session scope held a direct reference to a Web Bean bound to the application scope. From time to time, the session context is serialized to disk in order to use memory more efficiently. However, the application scoped Web Bean instance should not be serialized along with the session scoped Web Bean!"
+msgstr "现在再想象一个会话范围的Web Bean拥有一个应用范围的Web Bean的直接引用,会话上下文常常被序列化到硬盘以便更高效的使用内存。但是,应用范围的Web Bean实例不能和会话范围的Web Bean一起被序列化!"
#. Tag: para
#: injection.xml:357
#, no-c-format
-msgid ""
-"Therefore, unless a Web Bean has the default scope <literal>@Dependent</"
-"literal>, the Web Bean manager must indirect all injected references to the "
-"Web Bean through a proxy object. This <emphasis>client proxy</emphasis> is "
-"responsible for ensuring that the Web Bean instance that receives a method "
-"invocation is the instance that is associated with the current context. The "
-"client proxy also allows Web Beans bound to contexts such as the session "
-"context to be serialized to disk without recursively serializing other "
-"injected Web Beans."
-msgstr ""
+msgid "Therefore, unless a Web Bean has the default scope <literal>@Dependent</literal>, the Web Bean manager must indirect all injected references to the Web Bean through a proxy object. This <emphasis>client proxy</emphasis> is responsible for ensuring that the Web Bean instance that receives a method invocation is the instance that is associated with the current context. The client proxy also allows Web Beans bound to contexts such as the session context to be serialized to disk without recursively serializing other injected Web Beans."
+msgstr "因此,除非Web Bean使用默认的 <literal>@Dependent</literal> 的范围,Web Bean管理器必须通过一个代理对象来间接地拥有所有注入的Web Bean引用。这个 <emphasis>客户代理</emphasis> 负责确保收到方法调用的Web Bean实例就是当前上下文相关联的实例。客户代理也允许诸如绑定到会话上下文的Web Bean可以序列化到硬盘中,而无需递归地序列化注入到这个Web Bean中的其他的Web Bean。"
#. Tag: para
#: injection.xml:365
#, no-c-format
-msgid ""
-"Unfortunately, due to limitations of the Java language, some Java types "
-"cannot be proxied by the Web Bean manager. Therefore, the Web Bean manager "
-"throws an <literal>UnproxyableDependencyException</literal> if the type of "
-"an injection point cannot be proxied."
-msgstr ""
+msgid "Unfortunately, due to limitations of the Java language, some Java types cannot be proxied by the Web Bean manager. Therefore, the Web Bean manager throws an <literal>UnproxyableDependencyException</literal> if the type of an injection point cannot be proxied."
+msgstr "不幸的是,由于Java语言的限制,一些Java类型无法被Web Bean管理器代理。因此,如果注入点的类型无法被代理的话,Web Bean管理器会抛出一个 <literal>UnproxyableDependencyException</literal> 异常。"
#. Tag: para
#: injection.xml:370
#, no-c-format
msgid "The following Java types cannot be proxied by the Web Bean manager:"
-msgstr ""
+msgstr "下面的Java类型无法被Web Bean管理器代理:"
#. Tag: para
#: injection.xml:374
#, no-c-format
-msgid ""
-"classes which are declared <literal>final</literal> or have a "
-"<literal>final</literal> method,"
-msgstr ""
+msgid "classes which are declared <literal>final</literal> or have a <literal>final</literal> method,"
+msgstr "声明为 <literal>final</literal> 的类或者拥有 <literal>final</literal> 方法的类,"
#. Tag: para
#: injection.xml:378
#, no-c-format
msgid "classes which have no non-private constructor with no parameters, and"
-msgstr ""
+msgstr "没有无参非私有构造器的类,以及"
#. Tag: para
#: injection.xml:381
#, no-c-format
msgid "arrays and primitive types."
-msgstr ""
+msgstr "数组和原始类型。"
#. Tag: para
#: injection.xml:385
#, no-c-format
-msgid ""
-"It's usually very easy to fix an <literal>UnproxyableDependencyException</"
-"literal>. Simply add a constructor with no parameters to the injected class, "
-"introduce an interface, or change the scope of the injected Web Bean to "
-"<literal>@Dependent</literal>."
-msgstr ""
+msgid "It's usually very easy to fix an <literal>UnproxyableDependencyException</literal>. Simply add a constructor with no parameters to the injected class, introduce an interface, or change the scope of the injected Web Bean to <literal>@Dependent</literal>."
+msgstr "修正 <literal>UnproxyableDependencyException</literal> 很容易。只需简单的想注入类添加一个无参构造器,引入一个接口或者将注入的Web Bean的范围 <literal>@Dependent</literal> 即可。"
#. Tag: title
#: injection.xml:392
#, no-c-format
msgid "Obtaining a Web Bean by programatic lookup"
-msgstr ""
+msgstr "通过编程查找获得一个Web Bean"
#. Tag: para
#: injection.xml:394
#, no-c-format
-msgid ""
-"The application may obtain an instance of the interface <literal>Manager</"
-"literal> by injection:"
-msgstr ""
+msgid "The application may obtain an instance of the interface <literal>Manager</literal> by injection:"
+msgstr "应用可以通过注入获得一个 <literal>Manager</literal> 接口实例:"
#. Tag: programlisting
#: injection.xml:397
#, no-c-format
msgid "<![CDATA[@Current Manager manager;]]>"
-msgstr ""
+msgstr "<![CDATA[@Current Manager manager;]]>"
#. Tag: para
#: injection.xml:399
#, no-c-format
-msgid ""
-"The <literal>Manager</literal> object provides a set of methods for "
-"obtaining a Web Bean instance programatically."
-msgstr ""
+msgid "The <literal>Manager</literal> object provides a set of methods for obtaining a Web Bean instance programatically."
+msgstr " <literal>Manager</literal> 对象提供一套通过编程获得一个Web Bean实例的方法。"
#. Tag: programlisting
#: injection.xml:402
#, no-c-format
-msgid ""
-"<![CDATA[PaymentProcessor p = manager.getInstanceByType(PaymentProcessor."
-"class);]]>"
-msgstr ""
+msgid "<![CDATA[PaymentProcessor p = manager.getInstanceByType(PaymentProcessor.class);]]>"
+msgstr "<![CDATA[PaymentProcessor p = manager.getInstanceByType(PaymentProcessor.class);]]>"
#. Tag: para
#: injection.xml:404
#, no-c-format
-msgid ""
-"Binding annotations may be specified by subclassing the helper class "
-"<literal>AnnotationLiteral</literal>, since it is otherwise difficult to "
-"instantiate an annotation type in Java."
-msgstr ""
+msgid "Binding annotations may be specified by subclassing the helper class <literal>AnnotationLiteral</literal>, since it is otherwise difficult to instantiate an annotation type in Java."
+msgstr "绑定注释可以通过编写一个帮助类 <literal>AnnotationLiteral</literal> 的子类来指定,否则很难在Java中实例化一个注释类型。"
#. Tag: programlisting
#: injection.xml:408
#, no-c-format
msgid ""
-"<![CDATA[PaymentProcessor p = manager.getInstanceByType(PaymentProcessor."
-"class, \n"
-" new "
-"AnnotationLiteral<CreditCard>(){});]]>"
+"<![CDATA[PaymentProcessor p = manager.getInstanceByType(PaymentProcessor.class, \n"
+" new AnnotationLiteral<CreditCard>(){});]]>"
msgstr ""
+"<![CDATA[PaymentProcessor p = manager.getInstanceByType(PaymentProcessor.class, \n"
+" new AnnotationLiteral<CreditCard>(){});]]>"
#. Tag: para
#: injection.xml:410
#, no-c-format
-msgid ""
-"If the binding type has an annotation member, we can't use an anonymous "
-"subclass of <literal>AnnotationLiteral</literal> — instead we'll need to "
-"create a named subclass:"
-msgstr ""
+msgid "If the binding type has an annotation member, we can't use an anonymous subclass of <literal>AnnotationLiteral</literal> — instead we'll need to create a named subclass:"
+msgstr "如果绑定类型拥有一个注释成员,我们无法使用 <literal>AnnotationLiteral</literal> 的匿名子类— 相反,我们需要创建一个具名子类:"
#. Tag: programlisting
#: injection.xml:413
@@ -985,134 +893,107 @@
" extends AnnotationLiteral<CreditCard> \n"
" implements CreditCard {}]]>"
msgstr ""
+"<![CDATA[abstract class CreditCardBinding \n"
+" extends AnnotationLiteral<CreditCard> \n"
+" implements CreditCard {}]]>"
#. Tag: programlisting
#: injection.xml:415
#, no-c-format
msgid ""
-"<![CDATA[PaymentProcessor p = manager.getInstanceByType(PaymentProcessor."
-"class, \n"
+"<![CDATA[PaymentProcessor p = manager.getInstanceByType(PaymentProcessor.class, \n"
" new CreditCardBinding() { \n"
-" public void value() "
-"{ return paymentType; } \n"
+" public void value() { return paymentType; } \n"
" } );]]>"
msgstr ""
+"<![CDATA[PaymentProcessor p = manager.getInstanceByType(PaymentProcessor.class, \n"
+" new CreditCardBinding() { \n"
+" public void value() { return paymentType; } \n"
+" } );]]>"
#. Tag: title
#: injection.xml:419
#, no-c-format
-msgid ""
-"Lifecycle callbacks, <literal>@Resource</literal>, <literal>@EJB</literal> "
-"and <literal>@PersistenceContext</literal>"
-msgstr ""
+msgid "Lifecycle callbacks, <literal>@Resource</literal>, <literal>@EJB</literal> and <literal>@PersistenceContext</literal>"
+msgstr "生命周期回调方法,<literal>@Resource</literal>, <literal>@EJB</literal> 和 <literal>@PersistenceContext</literal>"
#. Tag: para
#: injection.xml:422
#, no-c-format
-msgid ""
-"Enterprise Web Beans support all the lifecycle callbacks defined by the EJB "
-"specification: <literal>@PostConstruct</literal>, <literal>@PreDestroy</"
-"literal>, <literal>@PrePassivate</literal> and <literal>@PostActivate</"
-"literal>."
-msgstr ""
+msgid "Enterprise Web Beans support all the lifecycle callbacks defined by the EJB specification: <literal>@PostConstruct</literal>, <literal>@PreDestroy</literal>, <literal>@PrePassivate</literal> and <literal>@PostActivate</literal>."
+msgstr "企业级Web Beans支持所有EJB规范定义的生命周期回调方法:<literal>@PostConstruct</literal>, <literal>@PreDestroy</literal>, <literal>@PrePassivate</literal> 和 <literal>@PostActivate</literal>。"
#. Tag: para
#: injection.xml:426
#, no-c-format
-msgid ""
-"Simple Web Beans support only the <literal>@PostConstruct</literal> and "
-"<literal>@PreDestroy</literal> callbacks."
-msgstr ""
+msgid "Simple Web Beans support only the <literal>@PostConstruct</literal> and <literal>@PreDestroy</literal> callbacks."
+msgstr "简单的Web Bean只支持 <literal>@PostConstruct</literal> 和 <literal>@PreDestroy</literal> 回调。"
#. Tag: para
#: injection.xml:429
#, no-c-format
-msgid ""
-"Both enterprise and simple Web Beans support the use of <literal>@Resource</"
-"literal>, <literal>@EJB</literal> and <literal>@PersistenceContext</literal> "
-"for injection of Java EE resources, EJBs and JPA persistence contexts, "
-"respectively. Simple Web Beans do not support the use of "
-"<literal>@PersistenceContext(type=EXTENDED)</literal>."
-msgstr ""
+msgid "Both enterprise and simple Web Beans support the use of <literal>@Resource</literal>, <literal>@EJB</literal> and <literal>@PersistenceContext</literal> for injection of Java EE resources, EJBs and JPA persistence contexts, respectively. Simple Web Beans do not support the use of <literal>@PersistenceContext(type=EXTENDED)</literal>."
+msgstr "企业级和简单的Web Bean都支持使用f <literal>@Resource</literal>, <literal>@EJB</literal> 和 <literal>@PersistenceContext</literal> 来分别注入Java EE资源,EJB和JPA持久化上下文。简单的Web Bean不支持使用 <literal>@PersistenceContext(type=EXTENDED)</literal> 。"
#. Tag: para
#: injection.xml:434
#, no-c-format
-msgid ""
-"The <literal>@PostConstruct</literal> callback always occurs after all "
-"dependencies have been injected."
-msgstr ""
+msgid "The <literal>@PostConstruct</literal> callback always occurs after all dependencies have been injected."
+msgstr " <literal>@PostConstruct</literal> 调用总是在所有依赖注入之后发生。"
#. Tag: title
#: injection.xml:440
#, no-c-format
msgid "The <literal>InjectionPoint</literal> object"
-msgstr ""
+msgstr " <literal>InjectionPoint</literal> 对象"
#. Tag: para
#: injection.xml:442
#, no-c-format
-msgid ""
-"There are certain kinds of dependent objects — Web Beans with scope "
-"<literal>@Dependent</literal> — that need to know something about the "
-"object or injection point into which they are injected in order to be able "
-"to do what they do. For example:"
-msgstr ""
+msgid "There are certain kinds of dependent objects — Web Beans with scope <literal>@Dependent</literal> — that need to know something about the object or injection point into which they are injected in order to be able to do what they do. For example:"
+msgstr "我们有一些依赖对象— <literal>@Dependent</literal> 范围的Web Bean — 需要知道它们所注入的对象或者注入点的信息,以便能够实现其功能。例如:"
#. Tag: para
#: injection.xml:448
#, no-c-format
-msgid ""
-"The log category for a <literal>Logger</literal> depends upon the class of "
-"the object that owns it."
-msgstr ""
+msgid "The log category for a <literal>Logger</literal> depends upon the class of the object that owns it."
+msgstr " <literal>Logger</literal>的日志分类取决于拥有它的类。"
#. Tag: para
#: injection.xml:452
#, no-c-format
-msgid ""
-"Injection of a HTTP parameter or header value depends upon what parameter or "
-"header name was specified at the injection point."
-msgstr ""
+msgid "Injection of a HTTP parameter or header value depends upon what parameter or header name was specified at the injection point."
+msgstr "一个HTTP参数和报头值的注入取决于注入点指定的参数或者报头名称。"
#. Tag: para
#: injection.xml:456
#, no-c-format
-msgid ""
-"Injection of the result of an EL expression evaluation depends upon the "
-"expression that was specified at the injection point."
-msgstr ""
+msgid "Injection of the result of an EL expression evaluation depends upon the expression that was specified at the injection point."
+msgstr "表达式运算结果的注入取决于在注入点指定的表达式。"
#. Tag: para
#: injection.xml:461
#, no-c-format
-msgid ""
-"A Web Bean with scope <literal>@Dependent</literal> may inject an instance "
-"of <literal>InjectionPoint</literal> and access metadata relating to the "
-"injection point to which it belongs."
-msgstr ""
+msgid "A Web Bean with scope <literal>@Dependent</literal> may inject an instance of <literal>InjectionPoint</literal> and access metadata relating to the injection point to which it belongs."
+msgstr "一个 <literal>@Dependent</literal> 范围的Web Bean可以注入一个 <literal>InjectionPoint</literal> 实例并且访问这个注入点相关的元数据。"
#. Tag: para
#: injection.xml:465
#, no-c-format
-msgid ""
-"Let's look at an example. The following code is verbose, and vulnerable to "
-"refactoring problems:"
-msgstr ""
+msgid "Let's look at an example. The following code is verbose, and vulnerable to refactoring problems:"
+msgstr "我们看一个例子。下面的代码很冗长脆弱,有重构问题:"
#. Tag: programlisting
#: injection.xml:468
#, no-c-format
msgid "<![CDATA[Logger log = Logger.getLogger(MyClass.class.getName());]]>"
-msgstr ""
+msgstr "<![CDATA[Logger log = Logger.getLogger(MyClass.class.getName());]]>"
#. Tag: para
#: injection.xml:470
#, no-c-format
-msgid ""
-"This clever little producer method lets you inject a JDK <literal>Logger</"
-"literal> without explicitly specifying the log category:"
-msgstr ""
+msgid "This clever little producer method lets you inject a JDK <literal>Logger</literal> without explicitly specifying the log category:"
+msgstr "这个生产者方法允许你注入一个JDK的 <literal>Logger</literal> ,没有显式的指定一个日志分类:"
#. Tag: programlisting
#: injection.xml:473
@@ -1121,32 +1002,36 @@
"<![CDATA[class LogFactory {\n"
"\n"
" @Produces Logger createLogger(InjectionPoint injectionPoint) { \n"
-" return Logger.getLogger(injectionPoint.getMember().getDeclaringClass()."
-"getName()); \n"
+" return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName()); \n"
" }\n"
"\n"
"}]]>"
msgstr ""
+"<![CDATA[class LogFactory {\n"
+"\n"
+" @Produces Logger createLogger(InjectionPoint injectionPoint) { \n"
+" return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName()); \n"
+" }\n"
+"\n"
+"}]]>"
#. Tag: para
#: injection.xml:475
#, no-c-format
msgid "We can now write:"
-msgstr ""
+msgstr "我们现在可以编写:"
#. Tag: programlisting
#: injection.xml:477
#, no-c-format
msgid "<![CDATA[@Current Logger log;]]>"
-msgstr ""
+msgstr "<![CDATA[@Current Logger log;]]>"
#. Tag: para
#: injection.xml:479
#, no-c-format
-msgid ""
-"Not convinced? Then here's a second example. To inject HTTP parameters, we "
-"need to define a binding type:"
-msgstr ""
+msgid "Not convinced? Then here's a second example. To inject HTTP parameters, we need to define a binding type:"
+msgstr "没被说服?我们还有第二个例子。要注入HTTP参数,我们需要定一个绑定类型:"
#. Tag: programlisting
#: injection.xml:482
@@ -1159,12 +1044,18 @@
" @NonBinding public String value();\n"
"}]]>"
msgstr ""
+"<![CDATA[@BindingType\n"
+"@Retention(RUNTIME)\n"
+"@Target({TYPE, METHOD, FIELD, PARAMETER})\n"
+"public @interface HttpParam {\n"
+" @NonBinding public String value();\n"
+"}]]>"
#. Tag: para
#: injection.xml:484
#, no-c-format
msgid "We would use this binding type at injection points as follows:"
-msgstr ""
+msgstr "我们可以在注入点使用这个绑定类型:"
#. Tag: programlisting
#: injection.xml:486
@@ -1173,12 +1064,14 @@
"<![CDATA[@HttpParam(\"username\") String username;\n"
"@HttpParam(\"password\") String password;]]>"
msgstr ""
+"<![CDATA[@HttpParam(\"username\") String username;\n"
+"@HttpParam(\"password\") String password;]]>"
#. Tag: para
#: injection.xml:488
#, no-c-format
msgid "The following producer method does the work:"
-msgstr ""
+msgstr "下面的生产方法能够完成这个工作:"
#. Tag: programlisting
#: injection.xml:490
@@ -1188,29 +1081,31 @@
"\n"
" @Produces @HttpParam(\"\")\n"
" String getParamValue(ServletRequest request, InjectionPoint ip) {\n"
-" return request.getParameter(ip.getAnnotation(HttpParam.class).value"
-"());\n"
+" return request.getParameter(ip.getAnnotation(HttpParam.class).value());\n"
" }\n"
"\n"
"}]]>"
msgstr ""
+"<![CDATA[class HttpParams\n"
+"\n"
+" @Produces @HttpParam(\"\")\n"
+" String getParamValue(ServletRequest request, InjectionPoint ip) {\n"
+" return request.getParameter(ip.getAnnotation(HttpParam.class).value());\n"
+" }\n"
+"\n"
+"}]]>"
#. Tag: para
#: injection.xml:492
#, no-c-format
-msgid ""
-"(Note that the <literal>value()</literal> member of the <literal>HttpParam</"
-"literal> annotation is ignored by the Web Bean manager since it is annotated "
-"<literal>@NonBinding.</literal>)"
-msgstr ""
+msgid "(Note that the <literal>value()</literal> member of the <literal>HttpParam</literal> annotation is ignored by the Web Bean manager since it is annotated <literal>@NonBinding.</literal>)"
+msgstr "(注意 <literal>HttpParam</literal> 注释的成员 <literal>value()</literal> 将被Web Bean管理器忽略,因为它拥有 <literal>@NonBinding.</literal> 注释)"
#. Tag: para
#: injection.xml:495
#, no-c-format
-msgid ""
-"The Web Bean manager provides a built-in Web Bean that implements the "
-"<literal>InjectionPoint</literal> interface:"
-msgstr ""
+msgid "The Web Bean manager provides a built-in Web Bean that implements the <literal>InjectionPoint</literal> interface:"
+msgstr "Web Bean管理器提供一个内置的实现 <literal>InjectionPoint</literal> 接口的Web Bean:"
#. Tag: programlisting
#: injection.xml:498
@@ -1224,3 +1119,11 @@
" public Set<T extends Annotation> getAnnotations(); \n"
"}]]>"
msgstr ""
+"<![CDATA[public interface InjectionPoint { \n"
+" public Object getInstance(); \n"
+" public Bean<?> getBean(); \n"
+" public Member getMember(): \n"
+" public <T extends Annotation> T getAnnotation(Class<T> annotation); \n"
+" public Set<T extends Annotation> getAnnotations(); \n"
+"}]]>"
+
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1950 - ri/trunk/version-matrix.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-12 19:38:44 -0400 (Thu, 12 Mar 2009)
New Revision: 1950
Modified:
ri/trunk/version-matrix/pom.xml
Log:
switch to snapshots of deployer
Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml 2009-03-12 22:18:47 UTC (rev 1949)
+++ ri/trunk/version-matrix/pom.xml 2009-03-12 23:38:44 UTC (rev 1950)
@@ -231,6 +231,12 @@
<version>${jsr299.tck.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+
<!-- <dependency>-->
<!-- <groupId>org.jboss.naming</groupId>-->
<!-- <artifactId>jnp-client</artifactId>-->
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1949 - tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-03-12 18:18:47 -0400 (Thu, 12 Mar 2009)
New Revision: 1949
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/AlteStadt.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/GutenbergMuseum.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Mainz.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/RoemerPassage.java
Modified:
ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java
tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
Log:
Added a couple more lifecycle tests for EJBs and added new operation to Beans in TCK API.
Modified: ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java
===================================================================
--- ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java 2009-03-12 17:32:50 UTC (rev 1948)
+++ ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java 2009-03-12 22:18:47 UTC (rev 1949)
@@ -2,6 +2,7 @@
import org.jboss.jsr299.tck.spi.Beans;
import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.ejb.spi.BusinessInterfaceDescriptor;
import org.jboss.webbeans.ejb.spi.EjbDescriptor;
import org.jboss.webbeans.util.Reflections;
@@ -71,4 +72,25 @@
return Reflections.isProxy(instance);
}
+ public <T> T getEnterpriseBean(Class<? extends T> beanType, Class<T> localInterface)
+ {
+ T enterpriseBean = null;
+ if (CurrentManager.rootManager().getEjbDescriptorCache().containsKey(beanType))
+ {
+ EjbDescriptor<?> ejbDescriptor = CurrentManager.rootManager().getEjbDescriptorCache().get(beanType).iterator().next();
+ String jndiName = null;
+ for (BusinessInterfaceDescriptor<?> businessInterface : ejbDescriptor.getLocalBusinessInterfaces())
+ {
+ if (businessInterface.getInterface().equals(localInterface))
+ {
+ jndiName = businessInterface.getJndiName();
+ }
+ }
+ if (jndiName == null)
+ throw new NullPointerException("No JNDI name found for interface " + localInterface.getName() + " on bean " + beanType.getName());
+ enterpriseBean = CurrentManager.rootManager().getNaming().lookup(jndiName, localInterface);
+ }
+ return enterpriseBean;
+ }
+
}
Modified: tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java 2009-03-12 17:32:50 UTC (rev 1948)
+++ tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java 2009-03-12 22:18:47 UTC (rev 1949)
@@ -52,6 +52,22 @@
*/
public boolean isEntityBean(Class<?> clazz);
+ /**
+ * Determines if the object instance is actually a proxy object.
+ *
+ * @param instance The object which might be a proxy
+ * @return true if the object is a proxy
+ */
public boolean isProxy(Object instance);
+ /**
+ * Retrieves the EJB which implements the local interface provided.
+ *
+ * @param <T> The local interface type
+ * @param beanType The class of the EJB implementing bean
+ * @param localInterface The business interface of the bean proxy to return
+ * @return the EJB proxy from the container
+ */
+ public <T> T getEnterpriseBean(Class<? extends T> beanType, Class<T> localInterface);
+
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/AlteStadt.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/AlteStadt.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/AlteStadt.java 2009-03-12 22:18:47 UTC (rev 1949)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+import javax.ejb.Local;
+
+@Local
+public interface AlteStadt
+{
+ public String getPlaceOfInterest();
+
+ public void performPostConstructChecks();
+
+ public void initializeBean(GutenbergMuseum pointOfInterest);
+
+ public GutenbergMuseum getAnotherPlaceOfInterest();
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/AlteStadt.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-03-12 17:32:50 UTC (rev 1948)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-03-12 22:18:47 UTC (rev 1949)
@@ -120,11 +120,13 @@
assert interfaces.contains(GeschichtslosStadt.class);
}
- @Test(groups = { "enterpriseBeans", "lifecycle", "integration", "stub" })
+ @Test(groups = { "enterpriseBeans", "lifecycle", "integration" })
@SpecAssertion(section = "6.11", id = "a")
public void testFieldInjectionsOnNonContextualEjbs()
{
- assert false;
+ AlteStadt alteStadt = this.getCurrentConfiguration().getBeans().getEnterpriseBean(Mainz.class, AlteStadt.class);
+ assert alteStadt != null : "Could not find the AlteStadt EJB";
+ assert alteStadt.getPlaceOfInterest().equals(RoemerPassage.name);
}
@Test(groups = { "enterpriseBeans", "lifecycle", "integration", "stub" })
@@ -134,11 +136,13 @@
assert false;
}
- @Test(groups = { "enterpriseBeans", "lifecycle", "integration", "stub" })
+ @Test(groups = { "enterpriseBeans", "lifecycle", "integration" })
@SpecAssertion(section = "6.11", id = "c")
public void testInitializerMethodsCalledWithCurrentParameterValues()
{
- assert false;
+ AlteStadt alteStadt = this.getCurrentConfiguration().getBeans().getEnterpriseBean(Mainz.class, AlteStadt.class);
+ assert alteStadt != null : "Could not find the AlteStadt EJB";
+ assert alteStadt.getAnotherPlaceOfInterest() != null;
}
@Test(groups = { "enterpriseBeans", "lifecycle", "interceptors", "stub" })
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/GutenbergMuseum.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/GutenbergMuseum.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/GutenbergMuseum.java 2009-03-12 22:18:47 UTC (rev 1949)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+public class GutenbergMuseum
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/GutenbergMuseum.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Mainz.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Mainz.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Mainz.java 2009-03-12 22:18:47 UTC (rev 1949)
@@ -0,0 +1,40 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+import javax.annotation.PostConstruct;
+import javax.ejb.Stateless;
+import javax.inject.Current;
+import javax.inject.Initializer;
+
+@Stateless
+public class Mainz implements AlteStadt
+{
+ @Current
+ private RoemerPassage placeOfInterest;
+
+ private GutenbergMuseum anotherPlaceOfInterest;
+
+ private String name;
+
+ public String getPlaceOfInterest()
+ {
+ return name;
+ }
+
+ @PostConstruct
+ public void performPostConstructChecks()
+ {
+ assert placeOfInterest != null : "Injected field is missing";
+ name = placeOfInterest.getName();
+ }
+
+ @Initializer
+ public void initializeBean(@Current GutenbergMuseum pointOfInterest)
+ {
+ this.anotherPlaceOfInterest = pointOfInterest;
+ }
+
+ public GutenbergMuseum getAnotherPlaceOfInterest()
+ {
+ return anotherPlaceOfInterest;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Mainz.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/RoemerPassage.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/RoemerPassage.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/RoemerPassage.java 2009-03-12 22:18:47 UTC (rev 1949)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+class RoemerPassage
+{
+ public final static String name = "RoemerPassage";
+
+ public String getName()
+ {
+ return name;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/RoemerPassage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1948 - ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-12 13:32:50 -0400 (Thu, 12 Mar 2009)
New Revision: 1948
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/InternalEjbDescriptor.java
Log:
WBRI-179
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/InternalEjbDescriptor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/InternalEjbDescriptor.java 2009-03-12 17:19:47 UTC (rev 1947)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/InternalEjbDescriptor.java 2009-03-12 17:32:50 UTC (rev 1948)
@@ -21,6 +21,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -53,7 +54,11 @@
// Internally, Object.class is added to the type hierachy of an
// EnterpriseBean, so we need to represent that here. We can just use any
// of the local business interfaces
- localBusinessInterfacesJndiNames.put(Object.class, ejbDescriptor.getLocalBusinessInterfaces().iterator().next().getJndiName());
+ Iterator<BusinessInterfaceDescriptor<?>> it = ejbDescriptor.getLocalBusinessInterfaces().iterator();
+ if (it.hasNext())
+ {
+ localBusinessInterfacesJndiNames.put(Object.class, it.next().getJndiName());
+ }
removeMethods = new ArrayList<Method>();
for (Method removeMethod : ejbDescriptor.getRemoveMethods())
{
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1947 - tck/trunk.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-12 13:19:47 -0400 (Thu, 12 Mar 2009)
New Revision: 1947
Modified:
tck/trunk/pom.xml
Log:
switch back to test-harness snapshot
Modified: tck/trunk/pom.xml
===================================================================
--- tck/trunk/pom.xml 2009-03-12 17:18:50 UTC (rev 1946)
+++ tck/trunk/pom.xml 2009-03-12 17:19:47 UTC (rev 1947)
@@ -143,7 +143,7 @@
<dependency>
<groupId>org.jboss.test-harness</groupId>
<artifactId>jboss-test-harness-api</artifactId>
- <version>1.0.0.BETA1</version>
+ <version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jboss.test-harness</groupId>
15 years, 10 months