001 /*
002 * jDTAUS Core API
003 * Copyright (c) 2005 Christian Schulte
004 *
005 * Christian Schulte, Haldener Strasse 72, 58095 Hagen, Germany
006 * <schulte2005@users.sourceforge.net> (+49 2331 3543887)
007 *
008 * This library is free software; you can redistribute it and/or
009 * modify it under the terms of the GNU Lesser General Public
010 * License as published by the Free Software Foundation; either
011 * version 2.1 of the License, or any later version.
012 *
013 * This library is distributed in the hope that it will be useful,
014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
016 * Lesser General Public License for more details.
017 *
018 * You should have received a copy of the GNU Lesser General Public
019 * License along with this library; if not, write to the Free Software
020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
021 *
022 */
023 package org.jdtaus.core.container;
024
025 import java.util.Locale;
026
027 /**
028 * Unrecoverable error thrown if no working {@code Container} is available in
029 * the system.
030 *
031 * @author <a href="mailto:schulte2005@users.sourceforge.net">Christian Schulte</a>
032 * @version $Id: ContainerError.java 8044 2009-07-02 01:29:05Z schulte2005 $
033 */
034 public class ContainerError extends Error
035 {
036 //--Constants---------------------------------------------------------------
037
038 /** Serial version UID for backwards compatibility with 1.0.x classes. */
039 private static final long serialVersionUID = -2788327766813465243L;
040
041 //---------------------------------------------------------------Constants--
042 //--Constructors------------------------------------------------------------
043
044 /**
045 * Creates a new instance of {@code ContainerError} taking a causing
046 * {@code Throwable}.
047 *
048 * @param cause the causing throwable.
049 */
050 public ContainerError( final Throwable cause )
051 {
052 super( ContainerErrorBundle.getInstance().
053 getContainerErrorMessage( Locale.getDefault(),
054 cause != null
055 ? cause.getMessage()
056 : null ), cause );
057
058 }
059
060 /**
061 * Creates a new instance of {@code ContainerError} taking a message.
062 *
063 * @param msg the message describing the error.
064 */
065 public ContainerError( final String msg )
066 {
067 super( ContainerErrorBundle.getInstance().
068 getContainerErrorMessage( Locale.getDefault(), msg ) );
069
070 }
071
072 //------------------------------------------------------------Constructors--
073 }