001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.test.testbyvalue.bean;
023:
024: import java.rmi.*;
025: import javax.ejb.*;
026: import javax.naming.Context;
027: import javax.sql.DataSource;
028: import javax.naming.InitialContext;
029: import java.sql.Connection;
030: import org.jboss.test.testbean.interfaces.StatelessSession;
031: import org.jboss.test.testbean.interfaces.StatelessSessionHome;
032: import java.util.Collection;
033: import java.util.Collections;
034: import java.util.Vector;
035: import java.util.Enumeration;
036:
037: public class ByValueEntityBean implements EntityBean {
038: private EntityContext entityContext;
039: public String name;
040:
041: public String ejbCreate() throws RemoteException, CreateException {
042:
043: name = "nothing";
044: return name;
045:
046: }
047:
048: public String ejbCreate(String name) throws RemoteException,
049: CreateException {
050: this .name = name;
051: return name;
052: }
053:
054: public String ejbFindByPrimaryKey(String name)
055: throws RemoteException, FinderException {
056: return name;
057: }
058:
059: public void ejbPostCreate() throws RemoteException, CreateException {
060: }
061:
062: public void ejbPostCreate(String name) throws RemoteException,
063: CreateException {
064: }
065:
066: public void ejbActivate() throws RemoteException {
067: }
068:
069: public void ejbLoad() throws RemoteException {
070: }
071:
072: public void ejbPassivate() throws RemoteException {
073: }
074:
075: public void ejbRemove() throws RemoteException, RemoveException {
076: }
077:
078: public void ejbStore() throws RemoteException {
079: }
080:
081: public void setEntityContext(EntityContext context)
082: throws RemoteException {
083: entityContext = context;
084: }
085:
086: public void unsetEntityContext() throws EJBException,
087: RemoteException {
088: this .entityContext = null;
089: }
090:
091: public String getName() {
092: return name;
093: }
094:
095: public void setName(String name) {
096: this .name = name;
097: }
098:
099: public void doByValueTest(ClassWithProperty property) {
100: property.setX(property.getX() + 1000);
101: }
102:
103: }
|