/*
 * 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
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.objectweb.jonas.jtests.beans.message;

import java.rmi.RemoteException;
import javax.ejb.EJBObject;

/**
 * Sender1_2 remote interface
 */
public interface Sender1_2 extends EJBObject {

    /**
     * send messages on destination
     * the transaction is demarcated before the session creation
     * @param dest destination (topic or queue JNDI name)
     * @param val value set in messages
     * @param nb number of messages sent
     * @param boolean commit transaction if true
     */
    void sendOnDestinationWithTxBeforeSession(String dest, 
                                              int val, 
                                              int nb, 
                                              boolean commit) throws RemoteException;

    /**
     * send messages on destination
     * the transaction is demarcated after the session creation
     * @param dest destination (topic or queue JNDI name)
     * @param val value set in messages
     * @param nb nb of messages sent
     * @param boolean commit transaction if true
     */

    void sendOnDestinationWithTxAfterSession(String dest, 
                                              int val, 
                                              int nb, 
                                              boolean commit) throws RemoteException;
    /**
     * Check messages received.
     * @param val value looked in messages received
     * @param nb nb of messages that could be received
     * @param sec nb of seconds max to wait for all messages
     * @return actual nb of messages received
     */
    int check(int val, int nb, int sec) throws RemoteException;

    /**
     * Clean all entity beans for this value
     * @param val value looked in messages
     */
    void clean(int val) throws RemoteException;
}
