| java.lang.Object org.ow2.easybeans.examples.statefulbean.StatefulBean
StatefulBean | public class StatefulBean implements SessionSynchronization,StatefulRemote(Code) | | Simple stateful bean.
author: Florent Benoit |
Constructor Summary | |
public | StatefulBean() Initialize the amounts for with and without Tx. |
Method Summary | |
public void | afterBegin() The afterBegin method notifies a session Bean instance that a new
transaction has started, and that the subsequent business methods on the
instance will be invoked in the context of the transaction. | public void | afterCompletion(boolean committed) The afterCompletion method notifies a session Bean instance that a
transaction commit protocol has completed, and tells the instance whether
the transaction has been committed or rolled back. | public void | beforeCompletion() The beforeCompletion method notifies a session Bean instance that a
transaction is about to be committed. | public void | buy(int s) Business method implementation. | public int | read() Business method implementation. |
StatefulBean | public StatefulBean()(Code) | | Initialize the amounts for with and without Tx.
|
afterBegin | public void afterBegin() throws RemoteException(Code) | | The afterBegin method notifies a session Bean instance that a new
transaction has started, and that the subsequent business methods on the
instance will be invoked in the context of the transaction. The instance
can use this method, for example, to read data from a database and cache
the data in the instance fields. This method executes in the proper
transaction context.
throws: java.rmi.RemoteException - - This exception is defined in themethod signature to provide backward compatibility for enterprisebeans written for the EJB 1.0 specification. Enterprise beanswritten for the EJB 1.1 and higher specifications should throwthe javax.ejb.EJBException instead of this exception. Enterprisebeans written for the EJB 2.0 and higher specifications must notthrow the java.rmi.RemoteException. |
afterCompletion | public void afterCompletion(boolean committed) throws RemoteException(Code) | | The afterCompletion method notifies a session Bean instance that a
transaction commit protocol has completed, and tells the instance whether
the transaction has been committed or rolled back. This method executes
with no transaction context.
Parameters: committed - - True if the transaction has been committed, false ifis has been rolled back. throws: java.rmi.RemoteException - - This exception is defined in themethod signature to provide backward compatibility for enterprisebeans written for the EJB 1.0 specification. Enterprise beanswritten for the EJB 1.1 and higher specifications should throwthe javax.ejb.EJBException instead of this exception. Enterprisebeans written for the EJB 2.0 and higher specifications must notthrow the java.rmi.RemoteException. |
beforeCompletion | public void beforeCompletion() throws RemoteException(Code) | | The beforeCompletion method notifies a session Bean instance that a
transaction is about to be committed. The instance can use this method,
for example, to write any cached data to a database. This method executes
in the proper transaction context. Note: The instance may still
cause the container to rollback the transaction by invoking the
setRollbackOnly() method on the instance context, or by throwing an
exception.
throws: java.rmi.RemoteException - - This exception is defined in themethod signature to provide backward compatibility for enterprisebeans written for the EJB 1.0 specification. Enterprise beanswritten for the EJB 1.1 and higher specifications should throwthe javax.ejb.EJBException instead of this exception. Enterprisebeans written for the EJB 2.0 and higher specifications must notthrow the java.rmi.RemoteException. |
buy | public void buy(int s)(Code) | | Business method implementation.
Parameters: s - nb of shares to be bought |
read | public int read()(Code) | | Business method implementation.
the nb of shares bought |
|
|