/*
 * JBoss, Home of Professional Open Source.
 * Copyright 2006, Red Hat Middleware LLC, and individual contributors
 * as indicated by the @author tags. See the copyright.txt file in the
 * distribution for a full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package javax.resource.cci;

import javax.resource.ResourceException;

/**
 * ResourceWarning provides information on warnings generated by the underlying
 * resource. They are chained to an Interaction object for later retrieval.
 */
public class ResourceWarning extends ResourceException
{
   /**
    * Create a warning
    */
   public ResourceWarning()
   {
      super();
   }

   /**
	 * Create a warning with a reason.
	 */
   public ResourceWarning(String reason)
   {
      super(reason);
   }

   /**
	 * Create a warning with a reason and an errorCode.
	 */
   public ResourceWarning(String reason, String errorCode)
   {
      super(reason, errorCode);
   }

   /**
    * Create a warning with a reason and an error.
    * 
    * @param reason the reason
    * @param throwable the error
    */
   public ResourceWarning(String reason, Throwable throwable)
   {
      super(reason, throwable);
   }

   /**
    * Create a warning with an error.
    * 
    * @param throwable the error
    */
   public ResourceWarning(Throwable throwable)
   {
      super(throwable);
   }
   
   /**
	 * Set a linked warning.
    * 
    * @deprecated use initCause()
	 */
   public void setLinkedWarning(ResourceWarning linkedWarning)
   {
      setLinkedException(linkedWarning);
   }

   /**
	 * Get any linked warning.
    * 
    * @deprecated use getCause()
	 */
   public ResourceWarning getLinkedWarning()
   {
      return (ResourceWarning) getLinkedException();
   }
}