001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id$
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.common.ejbs.stateful.containermanaged.sbinterface;
025:
026: import java.rmi.RemoteException;
027:
028: import javax.annotation.PreDestroy;
029: import javax.ejb.EJBException;
030: import javax.ejb.PostActivate;
031: import javax.ejb.PrePassivate;
032: import javax.ejb.Remote;
033: import javax.ejb.Remove;
034: import javax.ejb.SessionBean;
035: import javax.ejb.SessionContext;
036: import javax.ejb.Stateful;
037:
038: import org.ow2.easybeans.tests.common.ejbs.base.ItfCheck01;
039: import org.ow2.easybeans.tests.common.ejbs.base.ItfCheck02;
040: import org.ow2.easybeans.tests.common.ejbs.entity.callbacklogger.CallbackType;
041: import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.callbacklogger.BaseInsertCallbackEvent;
042:
043: /**
044: * This class is used as base to test the sessionbean interface.
045: * @author Eduardo Studzinski Estima de Castro
046: * @author Gisele Pinheiro Souza
047: */
048: @Stateful(name="SFSBSessionBeanItfWithAnnotation")
049: @Remote(ItfCheck02.class)
050: public class SFSBSessionBeanItfWithAnnotation extends
051: BaseInsertCallbackEvent implements SessionBean, ItfCheck02 {
052:
053: /**
054: * ID.
055: */
056: private static final long serialVersionUID = 1L;
057:
058: /**
059: * ejbActivate method.
060: * @throws EJBException if a problem occurs.
061: * @throws RemoteException if a problem occurs.
062: */
063: @PostActivate
064: public void ejbActivate() throws EJBException, RemoteException {
065: //TODO: test case
066: super .log(SFSBSessionBeanItfWithAnnotation.class.getName(),
067: CallbackType.POST_ACTIVATE,
068: SFSBSessionBeanItfWithAnnotation.class.getName());
069: }
070:
071: /**
072: * ejbPassivate method.
073: * @throws EJBException if a problem occurs.
074: * @throws RemoteException if a problem occurs.
075: */
076: @PrePassivate
077: public void ejbPassivate() throws EJBException, RemoteException {
078: //TODO: test case
079: super .log(SFSBSessionBeanItfWithAnnotation.class.getName(),
080: CallbackType.PRE_PASSIVATE,
081: SFSBSessionBeanItfWithAnnotation.class.getName());
082: }
083:
084: /**
085: * ejbRemove method.
086: * @throws EJBException if a problem occurs.
087: * @throws RemoteException if a problem occurs.
088: */
089: @PreDestroy
090: public void ejbRemove() throws EJBException, RemoteException {
091: super .log(SFSBSessionBeanItfWithAnnotation.class.getName(),
092: CallbackType.PRE_DESTROY,
093: SFSBSessionBeanItfWithAnnotation.class.getName());
094: }
095:
096: /**
097: * Sets the SessionContext.
098: * @param ctx SessionContext
099: * @throws EJBException if a problem occurs.
100: * @throws RemoteException if a problem occurs.
101: */
102: public void setSessionContext(final SessionContext ctx)
103: throws EJBException, RemoteException {
104: }
105:
106: /**
107: * Does nothing.
108: * @throws Exception if a problem occurs.
109: */
110: public void check() throws Exception {
111: }
112:
113: /**
114: * Bean remove.
115: */
116: @Remove
117: public void remove() {
118: }
119:
120: }
|