| java.lang.Object org.objectweb.jonas.stests.manac.ManagerSF
ManagerSF | public class ManagerSF implements SessionBean,SessionSynchronization(Code) | | Manager Implementation
author: Philippe Durieux |
Method Summary | |
public void | afterBegin() | public void | afterCompletion(boolean committed) | public void | beforeCompletion() | public boolean | checkAccount(int a) | public boolean | checkAll() | public void | createAll(int nb) Initializes the database by creating a set of accounts. | public void | delAccount(int d1) Find an account and create it if not found. | public void | ejbActivate() A container invokes this method when the instance is taken out of
the pool of available instances to become associated with a specific
EJB object. | public void | ejbCreate(int ival) Create a session. | public void | ejbPassivate() A container invokes this method on an instance before the instance
becomes disassociated with a specific EJB object. | public void | ejbRemove() A container invokes this method before it ends the life of the session object. | public void | getAccount(int c1) Find an account and create it if not found. | public void | movement() Do the movement. | public int | readBalances() This is a read operation, executed outside transaction. | public void | reinitAll() Reinit the balances for each created account to its initial value. | public void | setAccounts(int d1, int d2, int c1, int c2) Each operation debits 2 accounts and credits 2 accounts. | public void | setDelay(int d) Set a delay value, in seconds, for the transaction. | public void | setSessionContext(SessionContext ctx) Set the associated session context. | public void | setValue(int v) Set the value to withdraw. | public void | sleep(int seconds) | public void | withdraw(int wd, int wc, int wv) Simple withdraw operation, on existing accounts only. |
ejbContext | SessionContext ejbContext(Code) | | |
history | protected static Logger history(Code) | | |
initialValue | int initialValue(Code) | | |
logger | protected static Logger logger(Code) | | |
afterBegin | public void afterBegin()(Code) | | |
afterCompletion | public void afterCompletion(boolean committed)(Code) | | |
beforeCompletion | public void beforeCompletion()(Code) | | |
createAll | public void createAll(int nb) throws RemoteException(Code) | | Initializes the database by creating a set of accounts.
Parameters: nb - number of account created. |
delAccount | public void delAccount(int d1) throws RemoteException, RemoveException(Code) | | Find an account and create it if not found.
Then, remove it.
Parameters: d1 - account number |
ejbActivate | public void ejbActivate()(Code) | | A container invokes this method when the instance is taken out of
the pool of available instances to become associated with a specific
EJB object.
|
ejbCreate | public void ejbCreate(int ival) throws CreateException(Code) | | Create a session.
Parameters: ival - initial balance value for new accounts. throws: CreateException - Failure to create a session EJB object. |
ejbPassivate | public void ejbPassivate()(Code) | | A container invokes this method on an instance before the instance
becomes disassociated with a specific EJB object.
|
ejbRemove | public void ejbRemove()(Code) | | A container invokes this method before it ends the life of the session object.
This happens as a result of a client's invoking a remove operation, or when a
container decides to terminate the session object after a timeout.
This method is called with no transaction context.
throws: EJBException - Thrown by the method to indicate a failure caused bya system-level error. |
getAccount | public void getAccount(int c1) throws RemoteException(Code) | | Find an account and create it if not found.
Parameters: c1 - account number |
readBalances | public int readBalances() throws RemoteException(Code) | | This is a read operation, executed outside transaction.
|
reinitAll | public void reinitAll() throws RemoteException(Code) | | Reinit the balances for each created account to its initial value.
|
setAccounts | public void setAccounts(int d1, int d2, int c1, int c2) throws RemoteException(Code) | | Each operation debits 2 accounts and credits 2 accounts.
Lookup all accounts and create them if they not exist yet
Parameters: d1 - first account to credit Parameters: d2 - second account to credit Parameters: c1 - first account to debit Parameters: c2 - second account to debit throws: RemoteException - |
setDelay | public void setDelay(int d) throws RemoteException(Code) | | Set a delay value, in seconds, for the transaction.
|
setSessionContext | public void setSessionContext(SessionContext ctx)(Code) | | Set the associated session context. The container calls this method
after the instance creation.
The enterprise Bean instance should store the reference to the context
object in an instance variable.
This method is called with no transaction context.
Parameters: ctx - A SessionContext interface for the instance. throws: EJBException - Thrown by the method to indicate a failure caused bya system-level error. |
setValue | public void setValue(int v) throws RemoteException(Code) | | Set the value to withdraw.
Parameters: v - value to withdraw. |
sleep | public void sleep(int seconds)(Code) | | |
withdraw | public void withdraw(int wd, int wc, int wv) throws RemoteException(Code) | | Simple withdraw operation, on existing accounts only.
|
|
|