KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > naming > StringRefAddr


1 /*
2  * @(#)StringRefAddr.java 1.7 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.naming;
9
10 /**
11  * This class represents the string form of the address of
12  * a communications end-point.
13  * It consists of a type that describes the communication mechanism
14  * and a string contents specific to that communication mechanism.
15  * The format and interpretation of
16  * the address type and the contents of the address are based on
17  * the agreement of three parties: the client that uses the address,
18  * the object/server that can be reached using the address, and the
19  * administrator or program that creates the address.
20  *
21  * <p> An example of a string reference address is a host name.
22  * Another example of a string reference address is a URL.
23  *
24  * <p> A string reference address is immutable:
25  * once created, it cannot be changed. Multithreaded access to
26  * a single StringRefAddr need not be synchronized.
27  *
28  * @author Rosanna Lee
29  * @author Scott Seligman
30  * @version 1.7 03/12/19
31  *
32  * @see RefAddr
33  * @see BinaryRefAddr
34  * @since 1.3
35  */

36
37 public class StringRefAddr extends RefAddr JavaDoc {
38     /**
39      * Contains the contents of this address.
40      * Can be null.
41      * @serial
42      */

43     private String JavaDoc contents;
44     /**
45       * Constructs a new instance of StringRefAddr using its address type
46       * and contents.
47       *
48       * @param addrType A non-null string describing the type of the address.
49       * @param addr The possibly null contents of the address in the form of a string.
50       */

51     public StringRefAddr(String JavaDoc addrType, String JavaDoc addr) {
52     super(addrType);
53     contents = addr;
54     }
55
56     /**
57       * Retrieves the contents of this address. The result is a string.
58       *
59       * @return The possibly null address contents.
60       */

61     public Object JavaDoc getContent() {
62     return contents;
63     }
64
65     /**
66      * Use serialVersionUID from JNDI 1.1.1 for interoperability
67      */

68     private static final long serialVersionUID = -8913762495138505527L;
69 }
70
Popular Tags