KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > bankiiop > ejb > CustomerBean


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.test.bankiiop.ejb;
23
24 import java.util.*;
25
26 import org.jboss.test.util.ejb.EntitySupport;
27 import org.jboss.test.bankiiop.interfaces.*;
28
29 /**
30  *
31  * @see <related>
32  * @author $Author: starksm $
33  * @version $Revision: 37406 $
34  */

35 public class CustomerBean
36    extends EntitySupport
37 {
38    // Constants -----------------------------------------------------
39

40    // Attributes ----------------------------------------------------
41
public String JavaDoc id;
42    public String JavaDoc name;
43    public Collection accounts;
44    
45    // Static --------------------------------------------------------
46

47    // Constructors --------------------------------------------------
48

49    // Public --------------------------------------------------------
50
public String JavaDoc getId()
51    {
52       return id;
53    }
54    
55    public void setId(String JavaDoc id)
56    {
57       this.id = id;
58    }
59    
60    public String JavaDoc getName()
61    {
62       return name;
63    }
64    
65    public void setName(String JavaDoc name)
66    {
67       this.name = name;
68    }
69    
70    public Collection getAccounts()
71    {
72         return accounts;
73    }
74    
75    public void addAccount(Account acct)
76    {
77         accounts.add(acct);
78    }
79    
80    public void removeAccount(Account acct)
81    {
82         accounts.remove(acct);
83    }
84    
85    // EntityHome implementation -------------------------------------
86
public CustomerPK ejbCreate(String JavaDoc id, String JavaDoc name)
87    {
88       setId(id);
89       setName(name);
90       accounts = new ArrayList();
91       
92       CustomerPK pk = new CustomerPK();
93       pk.id = id;
94       pk.name = name;
95
96       return pk;
97    }
98    
99    public void ejbPostCreate(String JavaDoc id, String JavaDoc name)
100    {
101    }
102 }
103
104 /*
105  * $Id: CustomerBean.java 37406 2005-10-29 23:41:24Z starksm $
106  * Currently locked by:$Locker$
107  * Revision:
108  * $Log$
109  * Revision 1.3 2005/10/29 23:41:18 starksm
110  * Update the jboss LGPL headers
111  *
112  * Revision 1.2 2002/05/27 22:41:49 reverbel
113  * Making the bankiiop test work with the multiple invokers code:
114  * - The test client uses the CosNaming jndi provider.
115  * - Beans use ejb-refs to find each other.
116  * - These refs are properly set up for IIOP (in jboss.xml).
117  *
118  * Revision 1.1 2002/03/15 22:36:28 reverbel
119  * Initial version of the bank test for JBoss/IIOP.
120  *
121  * Revision 1.4 2001/01/20 16:32:51 osh
122  * More cleanup to avoid verifier warnings.
123  *
124  * Revision 1.3 2001/01/07 23:14:34 peter
125  * Trying to get JAAS to work within test suite.
126  *
127  * Revision 1.2 2000/09/30 01:00:54 fleury
128  * Updated bank tests to work with new jBoss version
129  *
130  * Revision 1.1.1.1 2000/06/21 15:52:37 oberg
131  * Initial import of jBoss test. This module contains CTS tests, some simple examples, and small bean suites.
132  *
133  *
134  *
135  */

136
Popular Tags