KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb3 > test > servicedependency > AccountBean


1 package org.jboss.ejb3.test.servicedependency;
2
3 import javax.ejb.Remote JavaDoc;
4 import javax.ejb.Stateless JavaDoc;
5
6 import org.jboss.annotation.ejb.Depends;
7
8 import org.jboss.logging.Logger;
9
10 /**
11  * AccountBean
12  *
13  * @author <a HREF="galder.zamarreno@jboss.com">Galder Zamarreno</a>
14  * @version $$Revision: 44487 $$
15  */

16 @Stateless JavaDoc
17 @Remote JavaDoc(Account.class)
18 public class AccountBean implements Account {
19
20    private static final Logger log = Logger.getLogger(AccountBean.class);
21    
22    @Depends ("acme:service=uniqueid")
23    private UniqueIdMBean uniqueId;
24    
25    public void debit(String JavaDoc account, int amount)
26    {
27       log.info("debiting " + amount + " swiss francs from account " + account);
28       log.info("transaction id: " + uniqueId.generate());
29    }
30 }
31
Popular Tags