[jboss-svn-commits] JBL Code SVN: r25190 - labs/jbosstm/enterprise/tags/EAP_4_3_0/JBoss_TS_Programmers_Guide/pt-BR.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Feb 10 01:42:44 EST 2009


Author: ldelima at redhat.com
Date: 2009-02-10 01:42:44 -0500 (Tue, 10 Feb 2009)
New Revision: 25190

Modified:
   labs/jbosstm/enterprise/tags/EAP_4_3_0/JBoss_TS_Programmers_Guide/pt-BR/Chapter_06.po
Log:
translation completed

Modified: labs/jbosstm/enterprise/tags/EAP_4_3_0/JBoss_TS_Programmers_Guide/pt-BR/Chapter_06.po
===================================================================
--- labs/jbosstm/enterprise/tags/EAP_4_3_0/JBoss_TS_Programmers_Guide/pt-BR/Chapter_06.po	2009-02-10 06:39:38 UTC (rev 25189)
+++ labs/jbosstm/enterprise/tags/EAP_4_3_0/JBoss_TS_Programmers_Guide/pt-BR/Chapter_06.po	2009-02-10 06:42:44 UTC (rev 25190)
@@ -1,6 +1,25 @@
+# translation of Chapter_06.po to Brazilian Portuguese
+# Header entry was created by KBabel!
+#
 #. Tag: title
 #: Chapter_06.xml:6
 #, no-c-format
+# Leticia de Lima <ldelima at redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Mime-Version: 1.0"
+"Last-Translator: Leticia de Lima <ldelima at redhat.com>\n"
+"PO-Revision-Date: 2009-02-10 16:42+1000\n"
+"Project-Id-Version: Chapter_06\n"
+"Language-Team: Brazilian Portuguese <en at li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+
+#. Tag: title
+#: Chapter_06.xml:6
+#, no-c-format
 msgid "Constructing a Transactional objects for Java application"
 msgstr ""
 
@@ -13,8 +32,7 @@
 #. Tag: para
 #: Chapter_06.xml:10
 #, no-c-format
-msgid ""
-"There are two distinct phases to the development of a TxCore application:"
+msgid "There are two distinct phases to the development of a TxCore application:"
 msgstr ""
 
 #. Tag: para
@@ -28,8 +46,7 @@
 #. Tag: para
 #: Chapter_06.xml:20
 #, no-c-format
-msgid ""
-"Developing the application(s) that make use of the new classes of objects."
+msgid "Developing the application(s) that make use of the new classes of objects."
 msgstr ""
 
 #. Tag: para
@@ -92,8 +109,7 @@
 #. Tag: para
 #: Chapter_06.xml:40
 #, no-c-format
-msgid ""
-"The Java interface definition of this simple queue class is given below:"
+msgid "The Java interface definition of this simple queue class is given below:"
 msgstr ""
 
 #. Tag: screen
@@ -128,6 +144,26 @@
 "        private int numberOfElements;\n"
 "};"
 msgstr ""
+"        QueueError, Conflict;\n"
+"        public int dequeue  () throws OverFlow, UnderFlow,\n"
+"        QueueError, Conflict;\n"
+"        \n"
+"        public int queueSize ();\n"
+"        public int inspectValue (int i) throws OverFlow,\n"
+"        UnderFlow, QueueError, Conflict;\n"
+"        public void setValue (int i, int v) throws OverFlow,\n"
+"        UnderFlow, QueueError, Conflict;\n"
+"        \n"
+"        public boolean save_state (OutputObjectState os, int ObjectType);\n"
+"        public boolean restore_state (InputObjectState os, int ObjectType);\n"
+"        public String type ();\n"
+"        \n"
+"        public static final int QUEUE_SIZE = 40; // maximum size of the "
+"queue\n"
+"        \n"
+"        private int[QUEUE_SIZE] elements;\n"
+"        private int numberOfElements;\n"
+"};"
 
 #. Tag: title
 #: Chapter_06.xml:45
@@ -156,6 +192,12 @@
 "        numberOfElements = 0;\n"
 "}"
 msgstr ""
+"public TransactionalQueue (Uid u)\n"
+"{\n"
+"        super(u);\n"
+"        \n"
+"        numberOfElements = 0;\n"
+"}"
 
 #. Tag: para
 #: Chapter_06.xml:51
@@ -197,6 +239,35 @@
 "        }\n"
 "}"
 msgstr ""
+"public TransactionalQueue ()\n"
+"{\n"
+"        super(ObjectType.ANDPERSISTENT);\n"
+"        \n"
+"        numberOfElements = 0;\n"
+"        \n"
+"        try\n"
+"        {\n"
+"                AtomicAction A = new AtomicAction();\n"
+"        \n"
+"                A.begin(0);        // Try to start atomic action\n"
+"        \n"
+"                // Try to set lock\n"
+"        \n"
+"                        if (setlock(new Lock(LockMode.WRITE), 0) == "
+"LockResult.GRANTED)\n"
+"                        {\n"
+"                                A.commit(true);        // Commit\n"
+"                        }\n"
+"                        else         // Lock refused so abort the atomic "
+"action\n"
+"                                A.rollback();\n"
+"                        }\n"
+"        catch (Exception e)\n"
+"        {\n"
+"                System.err.println(Object construction error: +e);\n"
+"                System.exit(1);\n"
+"        }\n"
+"}"
 
 #. Tag: para
 #: Chapter_06.xml:55
@@ -231,6 +302,10 @@
 "        super.terminate();\n"
 "}"
 msgstr ""
+"public void finalize ()\n"
+"{\n"
+"        super.terminate();\n"
+"}"
 
 #. Tag: title
 #: Chapter_06.xml:63
@@ -296,6 +371,51 @@
 "        }\n"
 "}"
 msgstr ""
+"public boolean save_state (OutputObjectState os, int ObjectType)\n"
+"{\n"
+"        if (!super.save_state(os, ObjectType))\n"
+"        return false;\n"
+"        \n"
+"        try\n"
+"        {\n"
+"                os.packInt(numberOfElements);\n"
+"        \n"
+"                if (numberOfElements &gt; 0)\n"
+"                {\n"
+"                        for (int i = 0; i &lt; numberOfElements; i++)\n"
+"                            os.packInt(elements[i]);\n"
+"                }\n"
+"                            \n"
+"                return true;\n"
+"        }\n"
+"        catch (IOException e)\n"
+"        {\n"
+"                return false;\n"
+"        }\n"
+"}\n"
+"\n"
+"public boolean restore_state (InputObjectState os, int ObjectType)\n"
+"{\n"
+"        if (!super.restore_state(os, ObjectType))\n"
+"                return false;\n"
+"                    \n"
+"        try\n"
+"        {\n"
+"                numberOfElements = os.unpackInt();\n"
+"                    \n"
+"                if (numberOfElements &gt; 0)\n"
+"                {\n"
+"                        for (int i = 0; i &lt; numberOfElements; i++)\n"
+"                                    elements[i] = os.unpackInt();\n"
+"                }\n"
+"                    \n"
+"                return true;\n"
+"        }\n"
+"        catch (IOException e)\n"
+"        {\n"
+"                return false;\n"
+"        }\n"
+"}"
 
 #. Tag: para
 #: Chapter_06.xml:69
@@ -314,6 +434,10 @@
 "        return \"/StateManager/LockManager/TransactionalQueue\";\n"
 "}"
 msgstr ""
+"public String type ()\n"
+"{\n"
+"        return \"/StateManager/LockManager/TransactionalQueue\";\n"
+"}"
 
 #. Tag: title
 #: Chapter_06.xml:74
@@ -374,18 +498,56 @@
 "        }\n"
 "}"
 msgstr ""
+"public void enqueue (int v) throws OverFlow, UnderFlow, QueueError\n"
+"{\n"
+"        AtomicAction A = new AtomicAction();\n"
+"        boolean res = false;\n"
+"        \n"
+"        try\n"
+"        {\n"
+"                A.begin(0);\n"
+"        \n"
+"                if (setlock(new Lock(LockMode.WRITE), 0) == LockResult."
+"GRANTED)\n"
+"                {\n"
+"                        if (numberOfElements &lt; QUEUE_SIZE)\n"
+"                               {\n"
+"                                               elements[numberOfElements] = "
+"v;\n"
+"                                               numberOfElements++;\n"
+"                                               res = true;\n"
+"                               }\n"
+"                               else\n"
+"                               {\n"
+"                                               A.rollback();\n"
+"                                              throw new UnderFlow();\n"
+"                               }\n"
+"                }\n"
+"                               \n"
+"                if (res)\n"
+"                         A.commit(true);\n"
+"                else\n"
+"                {\n"
+"                         A.rollback();\n"
+"                                               throw new Conflict();\n"
+"                }\n"
+"        }\n"
+"        catch (Exception e1)\n"
+"        {\n"
+"                throw new QueueError();\n"
+"        }\n"
+"}"
 
 #. Tag: title
 #: Chapter_06.xml:81
 #, no-c-format
 msgid "queueSize"
-msgstr ""
+msgstr "queueSize"
 
 #. Tag: para
 #: Chapter_06.xml:82
 #, no-c-format
-msgid ""
-"The implementation of <methodname>queueSize</methodname> is shown below:"
+msgid "The implementation of <methodname>queueSize</methodname> is shown below:"
 msgstr ""
 
 #. Tag: screen
@@ -422,6 +584,35 @@
 "        return size;\n"
 "}"
 msgstr ""
+"public int queueSize () throws QueueError, Conflict\n"
+"{\n"
+"        AtomicAction A = new AtomicAction();\n"
+"        int size = -1;\n"
+"        \n"
+"        try\n"
+"        {\n"
+"                A.begin(0);\n"
+"        \n"
+"                if (setlock(new Lock(LockMode.READ), 0) == LockResult."
+"GRANTED)\n"
+"                        size = numberOfElements;\n"
+"        \n"
+"                if (size != -1)\n"
+"                        A.commit(true);\n"
+"                else\n"
+"                {\n"
+"                        A.rollback();\n"
+"        \n"
+"                        throw new Conflict();\n"
+"                }\n"
+"        }\n"
+"        catch (Exception e1)\n"
+"        {\n"
+"                throw new QueueError();\n"
+"        }\n"
+"        \n"
+"        return size;\n"
+"}"
 
 #. Tag: title
 #: Chapter_06.xml:86
@@ -493,6 +684,57 @@
 "        return val;\n"
 "}"
 msgstr ""
+"public int inspectValue (int index) throws UnderFlow,\n"
+"        OverFlow, Conflict, QueueError\n"
+"{\n"
+"        AtomicAction A = new AtomicAction();\n"
+"        boolean res = false;\n"
+"        int val = -1;\n"
+"        \n"
+"        try\n"
+"        {\n"
+"                A.begin();\n"
+"        \n"
+"                if (setlock(new Lock(LockMode.READ), 0) == LockResult."
+"GRANTED)\n"
+"                {\n"
+"                        if (index &lt; 0)\n"
+"                            {\n"
+"                                    A.rollback();\n"
+"                                    throw new UnderFlow();\n"
+"                            }\n"
+"                else\n"
+"                {\n"
+"                    // array is 0 - numberOfElements -1\n"
+"                    \n"
+"                    if (index &gt; numberOfElements -1)\n"
+"                {\n"
+"                        A.rollback();\n"
+"                        throw new OverFlow();\n"
+"                }\n"
+"                else\n"
+"                {\n"
+"                        val = elements[index];\n"
+"                        res = true;\n"
+"                }\n"
+"                }\n"
+"                }\n"
+"                \n"
+"                if (res)\n"
+"                        A.commit(true);\n"
+"                else\n"
+"                {\n"
+"                        A.rollback();\n"
+"                        throw new Conflict();\n"
+"                }\n"
+"        }\n"
+"        catch (Exception e1)\n"
+"        {\n"
+"                throw new QueueError();\n"
+"        }\n"
+"                \n"
+"        return val;\n"
+"}"
 
 #. Tag: title
 #: Chapter_06.xml:93
@@ -518,6 +760,9 @@
 "{\n"
 "TransactionalQueue myQueue = new TransactionalQueue();"
 msgstr ""
+"public static void main (String[] args)\n"
+"{\n"
+"TransactionalQueue myQueue = new TransactionalQueue();"
 
 #. Tag: para
 #: Chapter_06.xml:99
@@ -560,6 +805,34 @@
 "        System.err.println(Caught unexpected exception!);\n"
 "}"
 msgstr ""
+"AtomicAction A = new AtomicAction();\n"
+"int size = 0;\n"
+"        \n"
+"try\n"
+"{\n"
+"        A.begin(0);\n"
+"s\n"
+"        try\n"
+"        {\n"
+"                size = queue.queueSize();\n"
+"        }\n"
+"        catch (Exception e)\n"
+"        {\n"
+"        }\n"
+"        \n"
+"        if (size &gt;= 0)\n"
+"        {\n"
+"                A.commit(true);\n"
+"        \n"
+"                System.out.println(Size of queue: +size);\n"
+"        }\n"
+"        else\n"
+"                A.rollback();\n"
+"}\n"
+"catch (Exception e)\n"
+"{\n"
+"        System.err.println(Caught unexpected exception!);\n"
+"}"
 
 #. Tag: title
 #: Chapter_06.xml:104
@@ -586,3 +859,4 @@
 "different elements in the queue. In the next section we address some of "
 "these issues."
 msgstr ""
+




More information about the jboss-svn-commits mailing list