KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > testbyvalue > bean > ByValueEntityBean


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.testbyvalue.bean;
23
24
25 import java.rmi.*;
26 import javax.ejb.*;
27 import javax.naming.Context JavaDoc;
28 import javax.sql.DataSource JavaDoc;
29 import javax.naming.InitialContext JavaDoc;
30 import java.sql.Connection JavaDoc;
31 import org.jboss.test.testbean.interfaces.StatelessSession;
32 import org.jboss.test.testbean.interfaces.StatelessSessionHome;
33 import java.util.Collection JavaDoc;
34 import java.util.Collections JavaDoc;
35 import java.util.Vector JavaDoc;
36 import java.util.Enumeration JavaDoc;
37
38 public class ByValueEntityBean implements EntityBean {
39   private EntityContext entityContext;
40   public String JavaDoc name;
41
42   public String JavaDoc ejbCreate() throws RemoteException, CreateException {
43
44        name="nothing";
45        return name;
46   
47       
48   }
49   public String JavaDoc ejbCreate(String JavaDoc name) throws RemoteException, CreateException {
50       this.name=name;
51       return name;
52   }
53
54
55   public String JavaDoc ejbFindByPrimaryKey(String JavaDoc name) throws RemoteException, FinderException {
56       return name;
57   }
58
59
60   public void ejbPostCreate() throws RemoteException, CreateException {
61   }
62   
63   public void ejbPostCreate(String JavaDoc name) throws RemoteException, CreateException {
64   }
65   
66
67   public void ejbActivate() throws RemoteException {
68   }
69
70   public void ejbLoad() throws RemoteException {
71   }
72
73   public void ejbPassivate() throws RemoteException {
74   }
75
76   public void ejbRemove() throws RemoteException, RemoveException {
77   }
78
79   public void ejbStore() throws RemoteException {
80   }
81
82
83   public void setEntityContext(EntityContext context) throws RemoteException {
84      entityContext = context;
85     }
86
87    public void unsetEntityContext() throws EJBException, RemoteException
88    {
89        this.entityContext=null;
90    }
91
92    public String JavaDoc getName()
93    {
94        return name;
95    }
96
97    public void setName(String JavaDoc name)
98    {
99        this.name=name;
100    }
101
102    public void doByValueTest(ClassWithProperty property)
103    {
104        property.setX(property.getX()+1000);
105    }
106
107 }
108
Popular Tags