All Examples  All Cluster Examples  This Example  This Package
  Class examples.cluster.ejb.account.AccountBean
java.lang.Object
   |
   +----examples.cluster.ejb.account.AccountBean
  -  public class AccountBean
  -  extends Object
  -  implements EntityBean
AccountBean is an EntityBean. This EJBean illustrates:
 -  Container-managed JDBC persistence and transactions; 
      the code in this file never directly accesses the data storage.
 
-  Application-defined exceptions.
 
  -  Author:
  
-  Copyright (c) 1999 by BEA WebXpress, Inc. All Rights Reserved.
   
  -   accountId accountId
-  
  
-   balance balance
-  
   
  -   AccountBean() AccountBean()
-  
   
  -   balance() balance()
-   Returns current balance.
  
-   deposit(double) deposit(double)
-   Adds amount to balance.
  
-   ejbActivate() ejbActivate()
-   This method is required by the EJB Specification,
 but is not used by this example.
  
-   ejbCreate(String, double) ejbCreate(String, double)
-   This method corresponds to the create method in the home interface
 "AccountHome.java".
  
-   ejbLoad() ejbLoad()
-   This method is required by the EJB Specification,
 but is not used by this example.
  
-   ejbPassivate() ejbPassivate()
-   This method is required by the EJB Specification,
 but is not used by this example.
  
-   ejbPostCreate(String, double) ejbPostCreate(String, double)
-   This method is required by the EJB Specification,
 but is not used by this example.
  
-   ejbRemove() ejbRemove()
-   This method is required by the EJB Specification,
 but is not used by this example.
  
-   ejbStore() ejbStore()
-   This method is required by the EJB Specification,
 but is not used by this example.
  
-   id() id()
-   Returns the Primary Key identifying this EJBean.
  
-   setEntityContext(EntityContext) setEntityContext(EntityContext)
-   Sets the EntityContext and the server name for the EJBean.
  
-   unsetEntityContext() unsetEntityContext()
-   Unsets the EntityContext for the EJBean.
  
-   withdraw(double) withdraw(double)
-   Subtracts amount from balance.
   
 accountId
accountId
 public String accountId
 balance
balance
 public double balance
   
 AccountBean
AccountBean
 public AccountBean()
   
 id
id
 public String id()
  -  Returns the Primary Key identifying this EJBean.
   
- 
    -  Returns:
    
-  String Identification
  
 
 ejbActivate
ejbActivate
 public void ejbActivate() throws RemoteException
  -  This method is required by the EJB Specification,
 but is not used by this example.
   
- 
    -  Throws: RemoteException
    
-  if there is a communications or systems failure
  
 
 ejbPassivate
ejbPassivate
 public void ejbPassivate() throws RemoteException
  -  This method is required by the EJB Specification,
 but is not used by this example.
   
- 
    -  Throws: RemoteException
    
-  if there is a communications or systems failure
  
 
 setEntityContext
setEntityContext
 public void setEntityContext(EntityContext ctx) throws RemoteException
  -  Sets the EntityContext and the server name for the EJBean.
   
- 
    -  Parameters:
    
-  ctx - EntityContext
    
-  Throws: RemoteException
    
-  if there is a communications or systems failure
  
 
 unsetEntityContext
unsetEntityContext
 public void unsetEntityContext() throws RemoteException
  -  Unsets the EntityContext for the EJBean.
   
- 
    -  Throws: RemoteException
    
-  if there is a communications or systems failure
  
 
 ejbLoad
ejbLoad
 public void ejbLoad() throws RemoteException
  -  This method is required by the EJB Specification,
 but is not used by this example.
   
- 
    -  Throws: RemoteException
    
-  if there is a communications or systems failure
  
 
 ejbStore
ejbStore
 public void ejbStore() throws RemoteException
  -  This method is required by the EJB Specification,
 but is not used by this example.
   
- 
    -  Throws: RemoteException
    
-  if there is a communications or systems failure
  
 
 ejbRemove
ejbRemove
 public void ejbRemove() throws RemoteException
  -  This method is required by the EJB Specification,
 but is not used by this example.
   
- 
    -  Throws: RemoteException
    
-  if there is a communications or systems failure
  
 
 ejbCreate
ejbCreate
 public void ejbCreate(String accountId,
                       double initialBalance)
  -  This method corresponds to the create method in the home interface
 "AccountHome.java". 
 The parameter sets of the two methods are identical.  When the client calls
 AccountHome.create(), the container (which in WebLogic EJB is
 also the home) allocates an instance of this EJBean and
 callsAccountBean.ejbCreate().
 For container-managed persistence, ejbCreate()returns 
 a void, unlike the case of bean-managed
 persistence, where it returns a primary key.
 
   
- 
    -  Parameters:
    
-  accountId - String Account ID
    -  initialBalance - double Initial Balance
  
 
 ejbPostCreate
ejbPostCreate
 public void ejbPostCreate(String accountId,
                           double initialBalance)
  -  This method is required by the EJB Specification,
 but is not used by this example.
   
- 
    -  Parameters:
    
-  accountId - String Account ID
    -  initialBalance - double Initial Balance
  
 
 balance
balance
 public AccountResult balance()
  -  Returns current balance.
   
- 
    -  Returns:
    
-  AccountResult
  
 
 deposit
deposit
 public AccountResult deposit(double amount)
  -  Adds amount to balance.
   
- 
    -  Parameters:
    
-  amount - double Amount
    
-  Returns:
    
-  AccountResult
  
 
 withdraw
withdraw
 public AccountResult withdraw(double amount) throws AccountException
  -  Subtracts amount from balance.
   
- 
    -  Parameters:
    
-  amount - double Amount
    
-  Returns:
    
-  AccountResult
    
-  Throws: AccountException
    
-  if Amount > Balance
  
 
All Examples  All Cluster Examples  This Example  This Package