Spec-Zone.ru › OpenJDK 25

Class LinkRef

java.lang.Object
javax.naming.Reference
javax.naming.LinkRef
All Implemented Interfaces:
Serializable, Cloneable
public class LinkRef extends Reference
This class represents a Reference whose contents is a name, called the link name, that is bound to an atomic name in a context.

The name is a URL, or a name to be resolved relative to the initial context, or if the first character of the name is ".", the name is relative to the context in which the link is bound.

Normal resolution of names in context operations always follow links. Resolution of the link name itself may cause resolution to pass through other links. This gives rise to the possibility of a cycle of links whose resolution could not terminate normally. As a simple means to avoid such non-terminating resolutions, service providers may define limits on the number of links that may be involved in any single operation invoked by the caller.

A LinkRef contains a single StringRefAddr, whose type is "LinkAddress", and whose contents is the link name. The class name field of the Reference is that of this (LinkRef) class.

LinkRef is bound to a name using the normal Context.bind()/rebind(), and DirContext.bind()/rebind(). Context.lookupLink() is used to retrieve the link itself if the terminal atomic name is bound to a link.

Many naming systems support a native notion of link that may be used within the naming system itself. JNDI does not specify whether there is any relationship between such native links and JNDI links.

A LinkRef instance is not synchronized against concurrent access by multiple threads. Threads that need to access a LinkRef instance concurrently should synchronize amongst themselves and provide the necessary locking.

Since:
1.3
See Also:
  • LinkException
  • LinkLoopException
  • MalformedLinkException
  • Context.lookupLink(Name)
  • Serialized Form

Field Summary

Fields declared in class Reference

addrs, classFactory, classFactoryLocation, className

Constructor Summary

Constructor Description
LinkRef(String linkName)
Constructs a LinkRef for a string name.
LinkRef(Name linkName)
Constructs a LinkRef for a name.

Method Summary

Modifier and Type Method Description
String getLinkName()
Retrieves the name of this link.

Methods declared in class Reference

add, add, clear, clone, equals, get, get, getAll, getClassName, getFactoryClassLocation, getFactoryClassName, hashCode, remove, size, toString

Methods declared in class Object

finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Details

LinkRef

public LinkRef(Name linkName)
Constructs a LinkRef for a name.
Parameters:
linkName - The non-null name for which to create this link.

LinkRef

public LinkRef(String linkName)
Constructs a LinkRef for a string name.
Parameters:
linkName - The non-null name for which to create this link.

Method Details

getLinkName

public String getLinkName() throws NamingException
Retrieves the name of this link.
Returns:
The non-null name of this link.
Throws:
MalformedLinkException - If a link name could not be extracted
NamingException - If a naming exception was encountered.

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2025, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/25/docs/api/java.naming/javax/naming/LinkRef.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API