KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > carol > jtests > conform > basic > server > BasicObjectRef


1 /**
2  * Copyright (C) 2002,2005 - INRIA (www.inria.fr)
3  *
4  * CAROL: Common Architecture for RMI ObjectWeb Layer
5  *
6  * This library is developed inside the ObjectWeb Consortium,
7  * http://www.objectweb.org
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22  * USA
23  *
24  * --------------------------------------------------------------------------
25  * $Id: BasicObjectRef.java,v 1.5 2005/02/11 11:02:51 benoitf Exp $
26  * --------------------------------------------------------------------------
27  */

28 package org.objectweb.carol.jtests.conform.basic.server;
29
30 import java.io.Serializable JavaDoc;
31
32 import javax.naming.Reference JavaDoc;
33 import javax.naming.Referenceable JavaDoc;
34 import javax.naming.StringRefAddr JavaDoc;
35
36 /**
37  * Class <code>BasicObjectRef</code> is a Basic referenceable (and
38  * serializable) class for testing
39  * @author Guillaume Riviere (Guillaume.Riviere@inrialpes.fr)
40  */

41 public class BasicObjectRef implements Referenceable JavaDoc, Serializable JavaDoc {
42
43     /**
44      * String object content
45      */

46     private String JavaDoc content = "string";
47
48     /**
49      * Constructor
50      * @param content given content
51      */

52     public BasicObjectRef(String JavaDoc content) {
53         this.content = content;
54     }
55
56     /**
57      * @return a Object reference
58      */

59     public Reference JavaDoc getReference() {
60         return new Reference JavaDoc(BasicObjectRef.class.getName(), new StringRefAddr JavaDoc("content", "string2"),
61                 BasicObjectRefFactory.class.getName(), null);
62     }
63
64     /**
65      * to String method
66      * @return String content
67      */

68     public String JavaDoc toString() {
69         return content;
70     }
71
72 }
Popular Tags