001: /*
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.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: Manager.java 9917 2007-01-12 09:56:24Z durieuxp $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas.jtests.beans.bank;
027:
028: import java.rmi.RemoteException;
029:
030: import javax.ejb.CreateException;
031: import javax.ejb.RemoveException;
032: import javax.ejb.EJBObject;
033:
034: /**
035: * Manager remote interface
036: * @author Philippe Durieux
037: */
038: public interface Manager extends EJBObject {
039:
040: /**
041: * create a set of Accounts
042: * @param nb nb of Accounts created.
043: */
044: public void createAll(int nb) throws RemoteException,
045: CreateException;
046:
047: /**
048: * create an account, and set rollback only
049: */
050: public void createRollbackOnly(int i) throws RemoteException,
051: CreateException;
052:
053: /**
054: * reinit all created accounts to their initial value.
055: */
056: public void reinitAll() throws RemoteException;
057:
058: /**
059: * Remove an Account
060: * @param d1 num of the Account.
061: */
062: public void delAccount(int d1) throws RemoteException,
063: RemoveException;
064:
065: /**
066: * Check all existing Accounts
067: * @return true if all are OK.
068: */
069: public boolean checkAll() throws RemoteException;
070:
071: /**
072: * Check an existing Account
073: * @param a num of the Account.
074: * @return true if OK.
075: */
076: public boolean checkAccount(int a) throws RemoteException;
077:
078: /**
079: * read balance for this Account
080: * @param a num of the Account.
081: * @return balance
082: */
083: public int readBalance(int a) throws RemoteException;
084:
085: /**
086: * read balance for last accessed Account
087: * @return balance
088: */
089: public int readBalance() throws RemoteException;
090:
091: /**
092: * read balance for this Account, in a transaction.
093: * @param a num of the Account.
094: * @return balance
095: */
096: public int readBalanceTx(int a) throws RemoteException;
097:
098: /**
099: * move form an Account to another one.
100: * @param d num of the debit Account.
101: * @param c num of the credit Account.
102: * @param v value to be moved
103: * @param d delay in second for the operation.
104: */
105: public void move(int d, int c, int v, int delay)
106: throws RemoteException;
107: }
|