aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r1154516 - in /aries/trunk/transaction/transaction-wrappers/src/main: java/org/apache/aries/transaction/jdbc/ resources/ resources/org/ resources/org/apache/ resources/org/apache/aries/ resources/org/apache/aries/transaction/ resources/org/...
Date Sat, 06 Aug 2011 13:24:27 GMT
Author: not
Date: Sat Aug  6 13:24:26 2011
New Revision: 1154516

URL: http://svn.apache.org/viewvc?rev=1154516&view=rev
Log:
ARIES-467 NLS enable log and exception messages.

Added:
    aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/NLS.java
  (with props)
    aries/trunk/transaction/transaction-wrappers/src/main/resources/
    aries/trunk/transaction/transaction-wrappers/src/main/resources/org/
    aries/trunk/transaction/transaction-wrappers/src/main/resources/org/apache/
    aries/trunk/transaction/transaction-wrappers/src/main/resources/org/apache/aries/
    aries/trunk/transaction/transaction-wrappers/src/main/resources/org/apache/aries/transaction/
    aries/trunk/transaction/transaction-wrappers/src/main/resources/org/apache/aries/transaction/jdbc/
    aries/trunk/transaction/transaction-wrappers/src/main/resources/org/apache/aries/transaction/jdbc/jdbcWrappers.properties
  (with props)
Modified:
    aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/ConnectionWrapper.java
    aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/XADatasourceEnlistingWrapper.java

Modified: aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/ConnectionWrapper.java
URL: http://svn.apache.org/viewvc/aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/ConnectionWrapper.java?rev=1154516&r1=1154515&r2=1154516&view=diff
==============================================================================
--- aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/ConnectionWrapper.java
(original)
+++ aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/ConnectionWrapper.java
Sat Aug  6 13:24:26 2011
@@ -75,35 +75,35 @@ public class ConnectionWrapper implement
     
     public void commit() throws SQLException {
         if (enlisted) {
-            throw new SQLException("Cannot commit while enrolled in a transaction");
+            throw new SQLException(NLS.MESSAGES.getMessage("datasource.enlised.commit"));
         }
         connection.commit();
     }
 
     public void rollback() throws SQLException {
         if (enlisted) {
-            throw new SQLException("Cannot rollback while enrolled in a transaction");
+            throw new SQLException(NLS.MESSAGES.getMessage("datasource.enlised.rollback"));
         }
         connection.rollback();
     }
 
     public void rollback(Savepoint savepoint) throws SQLException {
         if (enlisted) {
-            throw new SQLException("Cannot rollback while enrolled in a transaction");
+            throw new SQLException(NLS.MESSAGES.getMessage("datasource.enlised.rollback"));
         }
         connection.rollback(savepoint);
     }
     
     public Savepoint setSavepoint() throws SQLException {
         if (enlisted) {
-            throw new SQLException("Cannot set savepoint while enrolled in a transaction");
+            throw new SQLException(NLS.MESSAGES.getMessage("datasource.enlised.savepoint"));
         }
         return connection.setSavepoint();
     }
 
     public Savepoint setSavepoint(String name) throws SQLException {
         if (enlisted) {
-            throw new SQLException("Cannot set savepoint while enrolled in a transaction");
+            throw new SQLException(NLS.MESSAGES.getMessage("datasource.enlised.savepoint"));
         }
         return connection.setSavepoint(name);
     }

Added: aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/NLS.java
URL: http://svn.apache.org/viewvc/aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/NLS.java?rev=1154516&view=auto
==============================================================================
--- aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/NLS.java
(added)
+++ aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/NLS.java
Sat Aug  6 13:24:26 2011
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIESOR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.aries.transaction.jdbc;
+
+import org.apache.aries.util.nls.MessageUtil;
+
+public class NLS
+{
+  public static final MessageUtil MESSAGES = MessageUtil.createMessageUtil(NLS.class, "org.apache.aries.transaction.jdbc.jdbcWrappers");
+}

Propchange: aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/NLS.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/XADatasourceEnlistingWrapper.java
URL: http://svn.apache.org/viewvc/aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/XADatasourceEnlistingWrapper.java?rev=1154516&r1=1154515&r2=1154516&view=diff
==============================================================================
--- aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/XADatasourceEnlistingWrapper.java
(original)
+++ aries/trunk/transaction/transaction-wrappers/src/main/java/org/apache/aries/transaction/jdbc/XADatasourceEnlistingWrapper.java
Sat Aug  6 13:24:26 2011
@@ -92,7 +92,7 @@ public class XADatasourceEnlistingWrappe
         try {
             return (tm.getStatus() == Status.STATUS_ACTIVE) ? tm.getTransaction() : null;
         } catch (SystemException e) {
-            throw new SQLException("Error getting transaction");
+            throw new SQLException(NLS.MESSAGES.getMessage("unable.to.get.tx"), e);
         }
     }
     

Added: aries/trunk/transaction/transaction-wrappers/src/main/resources/org/apache/aries/transaction/jdbc/jdbcWrappers.properties
URL: http://svn.apache.org/viewvc/aries/trunk/transaction/transaction-wrappers/src/main/resources/org/apache/aries/transaction/jdbc/jdbcWrappers.properties?rev=1154516&view=auto
==============================================================================
--- aries/trunk/transaction/transaction-wrappers/src/main/resources/org/apache/aries/transaction/jdbc/jdbcWrappers.properties
(added)
+++ aries/trunk/transaction/transaction-wrappers/src/main/resources/org/apache/aries/transaction/jdbc/jdbcWrappers.properties
Sat Aug  6 13:24:26 2011
@@ -0,0 +1,28 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+datasource.enlised.commit=This datasource is enrolled in a JTA transaction and can only be
committed by the JTA transaction manager.
+datasource.enlised.rollback=This datasource is enrolled in a JTA transaction and can only
be rolledback by the JTA transaction manager.
+datasource.enlised.savepoint=This datasource is enrolled in a JTA transaction and does not
support savepoint.
+unable.to.get.tx=An error occurred while getting the current transaction.
+
+
+
+
+

Propchange: aries/trunk/transaction/transaction-wrappers/src/main/resources/org/apache/aries/transaction/jdbc/jdbcWrappers.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message