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

// Sender.java

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

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

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

    /**
     * send a message on topic
     * @param String destination
     * @param int value set in message
     * @param int nb of messages sent
     */
    public void sendOnTopic(String dest, int val, int nb) throws RemoteException;

    /**
     * send messages on topic (transacted)
     * @param String destination
     * @param int value set in message
     * @param int nb of messages sent
     */
    public void sendOnTopicTx(String dest, int val, int nb) throws RemoteException;

    /**
     * send a message on queue
     * @param String destination
     * @param int value set in message
     * @param int nb of messages sent
     */
    public void sendOnQueue(String dest, int val, int nb) throws RemoteException;

    /**
     * send a message on queue (transacted)
     * @param String destination
     * @param int value set in message
     * @param int nb of messages sent
     */
    public void sendOnQueueTx(String dest, int val, int nb) throws RemoteException;

    /**
     * Checking send methods
     * When the correct number of messages has been retrieved, the records
     * are cleaned up in the database, for further tries.
     * @param int value looked in messages received
     * @param int nb of messages that could be received
     * @param int nb of seconds max to wait for all messages
     * @return actual nb of messages received
     */
    public int check(int val, int nb, int sec) throws RemoteException;

    /**
     * Clean all entity beans for this value
     */
    public void clean(int val) throws RemoteException;
}
