001: /*
002: * HA-JDBC: High-Availability JDBC
003: * Copyright (c) 2004-2007 Paul Ferraro
004: *
005: * This library is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU Lesser General Public License as published by the
007: * Free Software Foundation; either version 2.1 of the License, or (at your
008: * option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful, but WITHOUT
011: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
012: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
013: * for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public License
016: * along with this library; if not, write to the Free Software Foundation,
017: * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: *
019: * Contact: ferraro@users.sourceforge.net
020: */
021: package net.sf.hajdbc;
022:
023: import java.text.MessageFormat;
024: import java.util.ResourceBundle;
025:
026: /**
027: * Provides localized access to log/error messages.
028: *
029: * @author Paul Ferraro
030: * @version $Revision: 1908 $
031: * @since 1.0
032: */
033: @SuppressWarnings("nls")
034: public final class Messages {
035: public static final String CLUSTER_NOT_ACTIVE = "cluster-not-active";
036: public static final String CLUSTER_PANIC_DETECTED = "cluster-panic-detected";
037: public static final String CLUSTER_START_FAILED = "cluster-start-failed";
038: public static final String CLUSTER_STATE_LOAD_FAILED = "cluster-state-load-failed";
039: public static final String CLUSTER_STATE_STORE_FAILED = "cluster-state-store-failed";
040: public static final String COMMAND_RECEIVED = "command-received";
041: public static final String CONFIG_LOAD_FAILED = "config-load-failed";
042: public static final String CONFIG_STORE_FAILED = "config-store-failed";
043: public static final String CONFIG_NOT_FOUND = "config-not-found";
044: public static final String DATABASE_ACTIVATE_FAILED = "database-activate-failed";
045: public static final String DATABASE_ACTIVATED = "database-activated";
046: public static final String DATABASE_ALREADY_EXISTS = "database-already-exists";
047: public static final String DATABASE_DEACTIVATED = "database-deactivated";
048: public static final String DATABASE_NOT_ACTIVE = "database-not-active";
049: public static final String DATABASE_NOT_ALIVE = "database-not-alive";
050: public static final String DATABASE_STILL_ACTIVE = "database-still-active";
051: public static final String DATABASE_SYNC_END = "database-sync-end";
052: public static final String DATABASE_SYNC_START = "database-sync-start";
053: public static final String DELETE_COUNT = "delete-count";
054: public static final String DRIVER_NOT_FOUND = "driver-not-found";
055: public static final String DRIVER_REGISTER_FAILED = "driver-register-failed";
056: public static final String GROUP_MEMBER_JOINED = "group-member-joined";
057: public static final String GROUP_MEMBER_LEFT = "group-member-left";
058: public static final String HA_JDBC_INIT = "ha-jdbc-init";
059: public static final String INITIAL_CLUSTER_STATE_LOCAL = "initial-cluster-state-local";
060: public static final String INITIAL_CLUSTER_STATE_NONE = "initial-cluster-state-none";
061: public static final String INITIAL_CLUSTER_STATE_REMOTE = "initial-cluster-state-remote";
062: public static final String INSERT_COUNT = "insert-count";
063: public static final String INVALID_BALANCER = "invalid-balancer";
064: public static final String INVALID_DATABASE = "invalid-database";
065: public static final String INVALID_DATABASE_CLUSTER = "invalid-database-cluster";
066: public static final String INVALID_META_DATA_CACHE = "invalid-meta-data-cache";
067: public static final String INVALID_PROPERTY = "invalid-property";
068: public static final String INVALID_PROPERTY_VALUE = "invalid-property-value";
069: public static final String INVALID_SYNC_STRATEGY = "invalid-sync-strategy";
070: public static final String JDBC_URL_REJECTED = "jdbc-url-rejected";
071: public static final String JNDI_LOOKUP_FAILED = "jndi-lookup-failed";
072: public static final String MBEAN_SERVER_NOT_FOUND = "mbean-server-not-found";
073: public static final String NO_ACTIVE_DATABASES = "no-active-databases";
074: public static final String PRIMARY_KEY_REQUIRED = "primary-key-required";
075: public static final String SCHEMA_LOOKUP_FAILED = "schema-lookup-failed";
076: public static final String SEQUENCE_OUT_OF_SYNC = "sequence-out-of-sync";
077: public static final String SHUT_DOWN = "shut-down";
078: public static final String SQL_OBJECT_INIT_FAILED = "sql-object-init-failed";
079: public static final String STATEMENT_FAILED = "statement-failed";
080: public static final String TABLE_LOCK_ACQUIRE = "table-lock-acquire";
081: public static final String TABLE_LOCK_RELEASE = "table-lock-release";
082: public static final String UPDATE_COUNT = "update-count";
083: public static final String WRITE_LOCK_FAILED = "write-lock-failed";
084:
085: private static ResourceBundle resource = ResourceBundle
086: .getBundle(Messages.class.getName());
087:
088: /**
089: * Returns the localized message using the specified resource key and potential arguments.
090: * @param key a resource key
091: * @param args a variable number of arguments
092: * @return a localized message
093: */
094: public static String getMessage(String key, Object... args) {
095: String message = resource.getString(key);
096:
097: return (args.length == 0) ? message : MessageFormat.format(
098: message, args);
099: }
100:
101: private Messages() {
102: // Hide constructor
103: }
104: }
|