KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jts > CosTransactions > Messages


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved.
26  * Use is subject to license terms.
27  */

28
29 //----------------------------------------------------------------------------
30
//
31
// Module: Messages.java
32
//
33
// Description: JTS messages, default.
34
//
35
// Product: com.sun.jts.CosTransactions
36
//
37
// Author: Simon Holdsworth
38
//
39
// Date: March, 1997
40
//
41
// Copyright (c): 1995-1997 IBM Corp.
42
//
43
// The source code for this program is not published or otherwise divested
44
// of its trade secrets, irrespective of what has been deposited with the
45
// U.S. Copyright Office.
46
//
47
// This software contains confidential and proprietary information of
48
// IBM Corp.
49
//----------------------------------------------------------------------------
50

51 package com.sun.jts.CosTransactions;
52
53 import java.util.*;
54 import java.text.*;
55
56 /**
57  * This class provides a ListResourceBundle which contains the message formats
58  * for messages produced by the JTS.
59  *
60  * @version 0.01
61  *
62  * @author Simon Holdsworth, IBM Corporation
63  *
64  * @see
65  */

66
67 //----------------------------------------------------------------------------
68
// CHANGE HISTORY
69
//
70
// Version By Change Description
71
// 0.01 SAJH Initial implementation.
72
//----------------------------------------------------------------------------
73

74 public class Messages extends ListResourceBundle {
75
76     // These message numbers are needed for the error messages
77
// produced by code in this file.
78

79     private static final int UNKNOWN_MESSAGE = 0;
80     private static final int INVALID_FORMAT = 1;
81
82     // Application-specific message numbers.
83

84     /**
85      * The ORB is not running.
86      */

87     public static final int ORBD_NOT_RUNNING = 2;
88
89     /**
90      * The JTS instance is not persistent.
91      */

92     public static final int NON_PERSISTENT = 3;
93
94     /**
95      * The Naming service failed.
96      */

97     public static final int NAME_SERVICE_FAILED = 4;
98
99     /**
100      * Log initialisation failed.
101      */

102     public static final int LOG_INIT_FAILED = 5;
103
104     /**
105      * Log open failed.
106      */

107     public static final int LOG_OPEN_FAILED = 6;
108
109     /**
110      * Object reference creation failed.
111      */

112     public static final int OBJREF_CREATE_FAILED = 7;
113
114     /**
115      * Object reference destruction failed.
116      */

117     public static final int OBJREF_DESTROY_FAILED = 8;
118
119     /**
120      * JTS is already identified to the Comms Manager.
121      */

122     public static final int ALREADY_IDENTIFIED = 9;
123
124     /**
125      * JTS cannot identify itself to the Comms Manager.
126      */

127     public static final int IDENTIFY_UNAVAILABLE = 10;
128
129     /**
130      * Could not create a subordinate Coordinator.
131      */

132     public static final int SUBORDINATE_CREATE_FAILED = 11;
133
134     /**
135      * Could not recover a Coordinator from the log.
136      */

137     public static final int RECOVER_COORD_FAILED = 12;
138
139     /**
140      * Exception occurred while performing resync.
141      */

142     public static final int RESYNC_OP_EXCEPTION = 13;
143
144     /**
145      * Exception occurred while calling a Resource object.
146      */

147     public static final int RESOURCE_OP_EXCEPTION = 14;
148
149     /**
150      * Commit/rollback/forget operation retry limit exceeded.
151      */

152     public static final int RETRY_LIMIT_EXCEEDED = 15;
153
154     /**
155      * Exception occurred while calling a Synchronization object.
156      */

157     public static final int SYNC_OP_EXCEPTION = 16;
158
159     /**
160      * Timeout thread stopped abnormally.
161      */

162     public static final int TIMEOUT_STOPPED = 17;
163
164     /**
165      * Invalid log path specification.
166      */

167     public static final int INVALID_LOG_PATH = 18;
168
169     /**
170      * Default log path does not exist.
171      */

172     public static final int INVALID_DEFAULT_LOG_PATH = 19;
173
174     /**
175      * Error accessing JTS repository.
176      */

177     public static final int SERVER_INFO_ERROR = 20;
178
179     /**
180      * Error accessing JTS repository.
181      */

182     public static final int GLOBAL_INFO_ERROR = 21;
183
184     /**
185      * Log error occurred.
186      */

187     public static final int LOG_ERROR = 23;
188
189     /**
190      * Trace using current directory.
191      */

192     public static final int TRACE_CURRENT = 24;
193
194     /**
195      * Invalid repository path specification.
196      */

197     public static final int INVALID_REPOSITORY_PATH = 25;
198
199     /**
200      * Default repository path does not exist.
201      */

202     public static final int INVALID_DEFAULT_REPOSITORY_PATH = 26;
203
204     /**
205      * Failed to access repository file.
206      */

207     public static final int REPOSITORY_FAILED = 27;
208
209     /**
210      * Could not locate object servant.
211      */

212     public static final int SERVANT_LOCATE_FAILED = 28;
213
214     /**
215      * Heuristic exception caught in resync could not be reported.
216      */

217     public static final int UNREPORTABLE_HEURISTIC = 29;
218
219     /**
220      * Wait for resync complete interrupted.
221      */

222     public static final int RESYNC_WAIT_INTERRUPTED = 30;
223
224     /**
225      * Transaction in wrong state for operation.
226      */

227     public static final int WRONG_STATE = 31;
228
229     /**
230      * Failed to store information in repository.
231      */

232     public static final int RESTART_WRITE_FAILED = 32;
233
234     /**
235      * Failed to close database during recovery.
236      */

237     public static final int RECOVERY_CLOSE_FAILED = 33;
238
239     /**
240      * Failed to reconstruct XA information.
241      */

242     public static final int XA_RECONSTRUCT_FAILED = 34;
243
244     /**
245      * XA resource manager string invalid.
246      */

247     public static final int INVALID_XA_RM_STRING = 35;
248
249     /**
250      * XA server initialisation failed.
251      */

252     public static final int XA_SERVER_INIT_FAILED = 36;
253
254     /**
255      * XA open/close operation failed.
256      */

257     public static final int XA_OPENCLOSE_ERROR = 37;
258
259     /**
260      * XA operation failed.
261      */

262     public static final int XA_ERROR = 38;
263
264     /**
265      * Database context is incorrect for the operation.
266      */

267     public static final int INCORRECT_CONTEXT = 39;
268
269     /**
270      * SQL error.
271      */

272     public static final int SQL_ERROR = 40;
273
274     /**
275      * XA switch load file load failed.
276      */

277     public static final int XA_SWITCH_LOAD_FAILED = 41;
278
279     /**
280      * SQL ALLOCATE failed.
281      */

282     public static final int SQL_ALLOCATE_FAILED = 42;
283
284     /**
285      * Could not create JDBC driver.
286      */

287     public static final int JDBC_DRIVER_CREATE_FAILED = 43;
288
289     /**
290      * JDBC security check failed.
291      */

292     public static final int JDBC_SECURITY_CHECK_FAILED = 44;
293
294     /**
295      * JDBC instance creation failed.
296      */

297     public static final int JDBC_INSTANCE_CREATE_FAILED = 45;
298
299     /**
300      * JDBC Driver Manager registration failed.
301      */

302     public static final int JDBC_DM_REGISTER_FAILED = 46;
303
304     /**
305      * JDBC driver load failed.
306      */

307     public static final int JDBC_DRIVER_LOAD_FAILED = 47;
308
309     /**
310      * Error loading native XA class.
311      */

312     public static final int NATIVEXA_CLASS_LOAD_ERROR = 48;
313
314     /**
315      * Log exists for transient process.
316      */

317     public static final int LOG_EXISTS_FOR_TRANSIENT = 49;
318
319     /**
320      * Invalid data in log record.
321      */

322     public static final int INVALID_LOG_RECORD_DATA = 50;
323
324     /**
325      * ODBC database definition does not exist.
326      */

327     public static final int NO_ODBC_DATABASE_DEFINITION = 51;
328
329     /**
330      * ODBC driver not supported for database.
331      */

332     public static final int UNSUPPORTED_ODBC_DRIVER_FOR_DATABASE = 52;
333
334     /**
335      * Recovery of object reference failed.
336      */

337     public static final int RECOVER_OBJECT_REF = 53;
338
339     /**
340      * Superior Top Coordinator not reachable on reply completion.
341      */

342     public static final int REPLAY_COMP_UNKNOWN = 54;
343
344     /**
345      * Transaction id is already in use.
346      */

347     public static final int ERR_TID_ALREADY_USED = 55;
348
349     /**
350      * Invalid state change.
351      */

352     public static final int ERR_INVALID_STATE_CHANGE = 56;
353
354     /**
355      * No coordinator available.
356      */

357     public static final int ERR_NO_COORDINATOR = 57;
358
359     /**
360      * XAException during recovery.
361      */

362     public static final int ERR_XA_RECOVERY = 58;
363
364     /**
365      * Standard message during startup regarding server id and mode.
366      */

367     public static final int MSG_STARTUP = 59;
368
369     /**
370      * No server name.
371      */

372     public static final int MSG_NO_SERVERNAME = 60;
373
374     /**
375      * Invalid default log path.
376      */

377     public static final int LOG_FILE_WRITE_ERROR = 61;
378
379     /**
380      * JTS error message.
381      */

382     public static final int MSG_JTS_ERROR = 62;
383
384     /**
385      * JTS warning message.
386      */

387     public static final int MSG_JTS_WARNING = 63;
388
389     /**
390      * JTS info message.
391      */

392     public static final int MSG_JTS_INFO = 64;
393
394     /**
395      * JTS log message.
396      */

397     public static final int LOG_MESSAGE = 65;
398
399     /**
400      * JTS error message.
401      */

402     public static final int INVALID_TIMEOUT = 66;
403
404     /**
405      * Return the contents of the ResourceBundle.
406      */

407     protected Object JavaDoc[][] getContents() { return contents; }
408
409     /**
410      * Return a formatted message.
411      */

412     final String JavaDoc getMessage(int messageNum, Object JavaDoc[] inserts) {
413         Object JavaDoc[][] contents = getContents();
414         if (messageNum > contents.length) {
415             messageNum = UNKNOWN_MESSAGE;
416             inserts = new Object JavaDoc[] { new Integer JavaDoc(messageNum) };
417         } else if (!(contents[messageNum][1] instanceof String JavaDoc)) {
418             messageNum = INVALID_FORMAT;
419             inserts = new Object JavaDoc[] { new Integer JavaDoc(messageNum) };
420         }
421
422         return MessageFormat.format((String JavaDoc) contents[messageNum][1], inserts);
423     }
424
425     /**
426      * Get a message number.
427      */

428     final String JavaDoc getMessageNumber(int messageNum) {
429
430         Object JavaDoc[][] contents = getContents();
431
432         if (messageNum > contents.length) {
433             return null;
434         }
435
436         return contents[messageNum][0].toString();
437     }
438
439     /**
440      * Get an unformatted message.
441      *
442      * @param messageNum the message number.
443      * @return unformatted message (value part of the resource bundle).
444      */

445     final String JavaDoc getMessage(int messageNum) {
446
447         Object JavaDoc[][] contents = getContents();
448
449         if (messageNum > contents.length) {
450             return null;
451         }
452
453         return contents[messageNum][1].toString();
454     }
455
456     /**
457      * The message formats.
458      */

459     private static final Object JavaDoc[][] contents = {
460
461         // Required messages.
462

463         { "", "Unknown message number {0}." },
464         { "", "Invalid message format for message number {0}." },
465
466         // Application messages.
467

468         { "000", "The ORB daemon, ORBD, is not running." },
469         { "001", "This is a non-persistent server. Transactions will not " +
470                  "be recoverable." },
471         { "002", "Cannot register {0} instance with the ORB." },
472         { "003", "Cannot initialise log." },
473         { "004", "Cannot open log file for server {0}." },
474         { "005", "Cannot create {0} object reference." },
475         { "006", "Cannot destroy {0} object reference." },
476         { "007", "Already identified to communications manager." },
477         { "008", "Unable to identify to communications manager." },
478         { "009", "Unable to create a subordinate Coordinator." },
479         { "010", "Exception {0} recovering an in-doubt Coordinator." },
480         { "011", "Exception {0} on {1} operation during resync." },
481         { "012", "Exception {0} on Resource {1} operation." },
482         { "013", "Retry limit of {0} {1} operations exceeded." },
483         { "014", "Exception {0} on {1} synchronization operation." },
484         { "015", "Timeout thread stopped." },
485         { "016", "Error: Invalid log path. Using {0}." },
486         { "017", "Error: Invalid default log path. Using current directory." },
487         { "018", "Cannot access server information for server {0}." },
488         { "019", "Cannot access global information." },
489         { "020", "" },
490         { "021", "Unexpected exception {0} from log." },
491         { "022", "Defaulting to current directory for trace." },
492         { "023", "Invalid repository path. Using {0}." },
493         { "024", "Invalid default repository path. Using current directory." },
494         { "025", "Cannot read repository file." },
495         { "026", "Cannot locate {0} servant." },
496         { "027", "Heuristic exception {0} cannot be reported to superior " +
497                  "in resync." },
498         { "028", "Wait for resync complete interrupted." },
499         { "029", "Transaction in the wrong state for {0} operation." },
500         { "030", "Unable to write restart record." },
501         { "031", "xa_close operation failed during recovery." },
502         { "032", "Could not reconstruct XA information during recovery." },
503         { "033", "XA Resource Manager string {0} is invalid." },
504         { "034", "XA Resource Manager {1} initialisation failed." },
505         { "035", "{0} with string {1} returned {2} for " +
506                  "Resource Manager {3}." },
507         { "036", "{0} operation returned {1} for Resource Manager {2}." },
508         { "037", "Incorrect {0} context during transaction start " +
509                  "association." },
510         { "038", "SQL error: {0} returned rc {1}, SQLCODE {2}." },
511         { "039", "Unexpected exception ''{0}'' while loading XA switch " +
512                  "class {1}." },
513         { "040", "Cannot allocate SQL environment." },
514         { "041", "Unable to create new JDBC-ODBC Driver." },
515         { "042", "Security check failed, reason string is {0}." },
516         { "043", "Unable to create new JdbcOdbc instance." },
517         { "044", "Unable to register with the JDBC Driver Manager." },
518         { "045", "Unable to load JDBC-ODBC Driver class." },
519         { "046", "Unexpected exception ''{0}'' while loading class {1}." },
520         { "047", "Log file exists for transient server {0}." },
521         { "048", "Invalid log record data in section {0}." },
522         { "049", "No entry found for database ''{0}'' in the ODBC " +
523                  "configuration." },
524         { "050", "ODBC Driver ''{0}'' for database ''{1}'' not supported " +
525                  "for transactional connection." },
526         { "051", "Unable to convert object reference to string in recovery." },
527         { "052", "Transaction resynchronization from originator failed, " +
528                  "retrying...." },
529         { "053", "Transaction id is already in use." },
530         { "054", "Invalid transaction state change." },
531         { "055", "No coordinator available." },
532         { "056", "XAException occured during recovery of XAResource objects." },
533         { "057", "Recoverable JTS instance, serverId = {0}." },
534         { "058", "No server name." },
535         { "059", "Error: Unable to write to error log file." },
536         { "060", "JTS Error: {0}." },
537         { "061", "JTS Warning: {0}." },
538         { "062", "JTS Info: {0}." },
539         { "063", "{0} : {1} : JTS{2}{3} {4}\n" },
540         { "064", "Invalid timeout value. Negative values are illegal." },
541     };
542 }
543
Popular Tags