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