/*
* JBoss, the OpenSource J2EE webOS
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.test.webservice.exception;

import org.jboss.logging.Logger;

import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import java.rmi.RemoteException;

/** A SLSB that throws custom exceptions
 */
public class ExceptionBeanImpl implements SessionBean
{
   public void throwException() throws UserException
   {
      throw new UserException();
   }

   public void throwExceptionWithMessage(String message) throws UserMessageException
   {
      throw new UserMessageException(message);
   }

   public void throwComplexUserException(String message, int code) throws ComplexUserException
   {
      throw new ComplexUserException(message, code);
   }

   public void throwComplexUserArrayException(String message, int[] codes) throws ComplexUserArrayException
   {
      ComplexUserArrayException arrEx = new ComplexUserArrayException(message, codes);
      throw arrEx;
   }

   // EJB life cycle methods *******************************************************************************************

   public void ejbCreate()
   {
   }

   public void ejbRemove()
   {
   }

   public void ejbActivate()
   {
   }

   public void ejbPassivate()
   {
   }

   public void setSessionContext(SessionContext sc)
   {
   }
}
