Path: blob/master/src/java.naming/share/classes/javax/naming/StringRefAddr.java
41152 views
/*1* Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.naming;2627/**28* This class represents the string form of the address of29* a communications end-point.30* It consists of a type that describes the communication mechanism31* and a string contents specific to that communication mechanism.32* The format and interpretation of33* the address type and the contents of the address are based on34* the agreement of three parties: the client that uses the address,35* the object/server that can be reached using the address, and the36* administrator or program that creates the address.37*38* <p> An example of a string reference address is a host name.39* Another example of a string reference address is a URL.40*41* <p> A string reference address is immutable:42* once created, it cannot be changed. Multithreaded access to43* a single StringRefAddr need not be synchronized.44*45* @author Rosanna Lee46* @author Scott Seligman47*48* @see RefAddr49* @see BinaryRefAddr50* @since 1.351*/5253public class StringRefAddr extends RefAddr {54/**55* Contains the contents of this address.56* Can be null.57* @serial58*/59private String contents;60/**61* Constructs a new instance of StringRefAddr using its address type62* and contents.63*64* @param addrType A non-null string describing the type of the address.65* @param addr The possibly null contents of the address in the form of a string.66*/67public StringRefAddr(String addrType, String addr) {68super(addrType);69contents = addr;70}7172/**73* Retrieves the contents of this address. The result is a string.74*75* @return The possibly null address contents.76*/77public Object getContent() {78return contents;79}8081/**82* Use serialVersionUID from JNDI 1.1.1 for interoperability83*/84private static final long serialVersionUID = -8913762495138505527L;85}868788