/*
 * JOnAS: Java(TM) Open Application Server
 * Copyright (C) 1999 Bull S.A.
 * Contact: jonas-team@objectweb.org
 * 
 * This library 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 any later version.
 * 
 * This library 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 library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * Initial developer(s): ____________________________________.
 * Contributor(s): Lutris Technologies Inc http://www.lutris.com
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
*/

package org.objectweb.jonas_ejb.deployment.api;

import org.objectweb.jonas_ejb.deployment.xml.Session;
import org.objectweb.jonas_ejb.deployment.xml.AssemblyDescriptor;
import org.objectweb.jonas_ejb.deployment.xml.JonasSession;

/**
 * Marker class for stateless session bean
 * @author Christophe Ney
 */
public class SessionStatelessDesc extends SessionDesc {

    /**
     * package protected constructor used by API
     */
    SessionStatelessDesc(ClassLoader classLoader,Session ses, AssemblyDescriptor asd, JonasSession jSes)
            throws DeploymentDescException {    
        super(classLoader,ses,asd,jSes);
    }
    
    /**
     * Check that the bean descriptor is valid
     * @exception DeploymentDescException thrown for non-valid bean
     */
    public void check() throws DeploymentDescException {
        super.check();
        // ejbClass should not implement javax.ejb.SessionSynchronization
        if (javax.ejb.SessionSynchronization.class.isAssignableFrom(ejbClass))
            throw new DeploymentDescException(ejbClass.getName()+" should NOT implement javax.ejb.SessionSynchronization");
    }
    
}
