001: /***************************************************************
002: * This file is part of the [fleXive](R) project.
003: *
004: * Copyright (c) 1999-2008
005: * UCS - unique computing solutions gmbh (http://www.ucs.at)
006: * All rights reserved
007: *
008: * The [fleXive](R) project is free software; you can redistribute
009: * it and/or modify it under the terms of the GNU General Public
010: * License as published by the Free Software Foundation;
011: * either version 2 of the License, or (at your option) any
012: * later version.
013: *
014: * The GNU General Public License can be found at
015: * http://www.gnu.org/copyleft/gpl.html.
016: * A copy is found in the textfile GPL.txt and important notices to the
017: * license from the author are found in LICENSE.txt distributed with
018: * these libraries.
019: *
020: * This library is distributed in the hope that it will be useful,
021: * but WITHOUT ANY WARRANTY; without even the implied warranty of
022: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
023: * GNU General Public License for more details.
024: *
025: * For further information about UCS - unique computing solutions gmbh,
026: * please see the company website: http://www.ucs.at
027: *
028: * For further information about [fleXive](R), please see the
029: * project website: http://www.flexive.org
030: *
031: *
032: * This copyright notice MUST APPEAR in all copies of the file!
033: ***************************************************************/package com.flexive.shared.exceptions;
034:
035: import com.flexive.shared.FxLanguage;
036: import com.flexive.shared.security.UserTicket;
037:
038: /**
039: * Runtime exception base class, wrapping a checked flexive exception.
040: *
041: * @author Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
042: */
043: public class FxRuntimeException extends RuntimeException implements
044: FxLocalizedException {
045: private static final long serialVersionUID = -5446816760325991049L;
046:
047: protected FxApplicationException converted;
048: /**
049: * was the message logged?
050: */
051: private boolean messageLogged = false;
052:
053: /**
054: * Localized exception constructor. Package-protected -
055: * use {@link FxApplicationException#asRuntimeException()} for creating
056: * run-time exceptions.
057: *
058: * @param converted the message to convert
059: */
060: FxRuntimeException(FxApplicationException converted) {
061: super (converted.message.getKey());
062: this .converted = converted;
063: }
064:
065: /**
066: * Has the message been logged?
067: *
068: * @return message logged
069: */
070: protected boolean messageLogged() {
071: return this .messageLogged;
072: }
073:
074: /** {@inheritDoc} */
075: @Override
076: public String getMessage() {
077: return converted.getMessage();
078: }
079:
080: /** {@inheritDoc} */
081: public String getMessage(FxLanguage locale) {
082: return converted.getMessage(locale);
083: }
084:
085: /** {@inheritDoc} */
086: public String getMessage(long localeId) {
087: return converted.getMessage(localeId);
088: }
089:
090: /** {@inheritDoc} */
091: public String getMessage(UserTicket ticket) {
092: return converted.getMessage(ticket);
093: }
094:
095: /** {@inheritDoc} */
096: public FxExceptionMessage getExceptionMessage() {
097: return converted.getExceptionMessage();
098: }
099:
100: public FxApplicationException getConverted() {
101: return this.converted;
102: }
103: }
|