APIdia Launch Partner
Top Description Fields Constructors Methods
javax.naming

public Class LinkException

extends NamingException
Class Inheritance
Known Direct Subclasses
javax.naming.LinkLoopException, javax.naming.MalformedLinkException

This exception is used to describe problems encountered while resolving links. Additional information is added to the base NamingException for pinpointing the problem with the link.

Analogously to how NamingException captures name resolution information, LinkException captures "link"-name resolution information pinpointing the problem encountered while resolving a link. All these fields may be null.

A LinkException instance is not synchronized against concurrent multithreaded access. Multiple threads trying to access and modify a single LinkException instance should lock the object.

Authors
Rosanna Lee, Scott Seligman
Since
1.3
See Also
Context#lookupLink, LinkRef

Field Summary

Modifier and TypeField and Description
protected String
linkExplanation

Contains the exception of why resolution of the link failed.

protected Name
linkRemainingName

Contains the remaining link name that has not been resolved yet.

protected Name
linkResolvedName

Contains the part of the link that has been successfully resolved.

protected Object
linkResolvedObj

Contains the object to which resolution of the part of the link was successful.

private static final long
serialVersionUID

Hides javax.naming.NamingException.serialVersionUID.

Use serialVersionUID from JNDI 1.1.1 for interoperability
Inherited from javax.naming.NamingException:
remainingNameresolvedNameresolvedObjrootException

Constructor Summary

AccessConstructor and Description
public
LinkException(String
A possibly null string containing additional detail about this exception.
explanation
)

Constructs a new instance of LinkException with an explanation.

public
LinkException()

Constructs a new instance of LinkException.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The possibly null detail string explaining more about the problem with resolving a link. If null, it means there is no link detail message for this exception.
getLinkExplanation
()

Retrieves the explanation associated with the problem encountered when resolving a link.

public Name

Returns:

The part of the link name that has not been resolved. It is a composite name. It can be null, which means the link remaining name field has not been set.
getLinkRemainingName
()

Retrieves the remaining unresolved portion of the link name.

public Name

Returns:

The part of the link name that was resolved successfully. It is a composite name. It can be null, which means the link resolved name field has not been set.
getLinkResolvedName
()

Retrieves the leading portion of the link name that was resolved successfully.

public Object

Returns:

The possibly null object that was resolved so far. If null, it means the link resolved object field has not been set.
getLinkResolvedObj
()

Retrieves the object to which resolution was successful.

public void
setLinkExplanation(String
The possibly null detail string explaining more about the problem with resolving a link. If null, it means no detail will be recorded.
msg
)

Sets the explanation associated with the problem encountered when resolving a link.

public void
setLinkRemainingName(Name
The name to set remaining link name to. This can be null. If null, it sets the remaining name field to null.
name
)

Sets the remaining link name field of this exception.

public void
setLinkResolvedName(Name
The name to set resolved link name to. This can be null. If null, it sets the link resolved name field to null.
name
)

Sets the resolved link name field of this exception.

public void
setLinkResolvedObj(Object
The object to set link resolved object to. This can be null. If null, the link resolved object field is set to null.
obj
)

Sets the link resolved object field of this exception.

public String

Returns:

The non-null string representation of this link exception.
toString
()

Overrides javax.naming.NamingException.toString.

Generates the string representation of this exception.

public String

Returns:

The non-null string representation of this link exception.
toString
(boolean
If true, add information about the link resolved object.
detail
)

Overrides javax.naming.NamingException.toString.

Generates the string representation of this exception.

Inherited from javax.naming.NamingException:
appendRemainingComponentappendRemainingNamegetCausegetExplanationgetRemainingNamegetResolvedNamegetResolvedObjgetRootCauseinitCausesetRemainingNamesetResolvedNamesetResolvedObjsetRootCause

Field Detail

linkExplanationback to summary
protected String linkExplanation

Contains the exception of why resolution of the link failed. Can be null. This field is initialized by the constructors. You should access and manipulate this field through its get and set methods.

See Also
getLinkExplanation, setLinkExplanation
linkRemainingNameback to summary
protected Name linkRemainingName

Contains the remaining link name that has not been resolved yet. It is a composite name and can be null. This field is initialized by the constructors. You should access and manipulate this field through its get and set methods.

See Also
getLinkRemainingName, setLinkRemainingName
linkResolvedNameback to summary
protected Name linkResolvedName

Contains the part of the link that has been successfully resolved. It is a composite name and can be null. This field is initialized by the constructors. You should access and manipulate this field through its get and set methods.

See Also
getLinkResolvedName, setLinkResolvedName
linkResolvedObjback to summary
protected Object linkResolvedObj

Contains the object to which resolution of the part of the link was successful. Can be null. This field is initialized by the constructors. You should access and manipulate this field through its get and set methods.

Annotations
@SuppressWarnings:serial
See Also
getLinkResolvedObj, setLinkResolvedObj
serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.naming.NamingException.serialVersionUID.

Use serialVersionUID from JNDI 1.1.1 for interoperability

Constructor Detail

LinkExceptionback to summary
public LinkException(String explanation)

Constructs a new instance of LinkException with an explanation. All the other fields are initialized to null.

Parameters
explanation:String

A possibly null string containing additional detail about this exception.

See Also
java.lang.Throwable#getMessage
LinkExceptionback to summary
public LinkException()

Constructs a new instance of LinkException. All the non-link-related and link-related fields are initialized to null.

Method Detail

getLinkExplanationback to summary
public String getLinkExplanation()

Retrieves the explanation associated with the problem encountered when resolving a link.

Returns:String

The possibly null detail string explaining more about the problem with resolving a link. If null, it means there is no link detail message for this exception.

See Also
setLinkExplanation
getLinkRemainingNameback to summary
public Name getLinkRemainingName()

Retrieves the remaining unresolved portion of the link name.

Returns:Name

The part of the link name that has not been resolved. It is a composite name. It can be null, which means the link remaining name field has not been set.

See Also
setLinkRemainingName
getLinkResolvedNameback to summary
public Name getLinkResolvedName()

Retrieves the leading portion of the link name that was resolved successfully.

Returns:Name

The part of the link name that was resolved successfully. It is a composite name. It can be null, which means the link resolved name field has not been set.

See Also
getLinkResolvedObj, setLinkResolvedName
getLinkResolvedObjback to summary
public Object getLinkResolvedObj()

Retrieves the object to which resolution was successful. This is the object to which the resolved link name is bound.

Returns:Object

The possibly null object that was resolved so far. If null, it means the link resolved object field has not been set.

See Also
getLinkResolvedName, setLinkResolvedObj
setLinkExplanationback to summary
public void setLinkExplanation(String msg)

Sets the explanation associated with the problem encountered when resolving a link.

Parameters
msg:String

The possibly null detail string explaining more about the problem with resolving a link. If null, it means no detail will be recorded.

See Also
getLinkExplanation
setLinkRemainingNameback to summary
public void setLinkRemainingName(Name name)

Sets the remaining link name field of this exception.

name is a composite name. If the intent is to set this field using a compound name or string, you must "stringify" the compound name, and create a composite name with a single component using the string. You can then invoke this method using the resulting composite name.

A copy of name is made and stored. Subsequent changes to name do not affect the copy in this NamingException and vice versa.

Parameters
name:Name

The name to set remaining link name to. This can be null. If null, it sets the remaining name field to null.

See Also
getLinkRemainingName
setLinkResolvedNameback to summary
public void setLinkResolvedName(Name name)

Sets the resolved link name field of this exception.

name is a composite name. If the intent is to set this field using a compound name or string, you must "stringify" the compound name, and create a composite name with a single component using the string. You can then invoke this method using the resulting composite name.

A copy of name is made and stored. Subsequent changes to name do not affect the copy in this NamingException and vice versa.

Parameters
name:Name

The name to set resolved link name to. This can be null. If null, it sets the link resolved name field to null.

See Also
getLinkResolvedName
setLinkResolvedObjback to summary
public void setLinkResolvedObj(Object obj)

Sets the link resolved object field of this exception. This indicates the last successfully resolved object of link name.

Parameters
obj:Object

The object to set link resolved object to. This can be null. If null, the link resolved object field is set to null.

See Also
getLinkResolvedObj
toStringback to summary
public String toString()

Overrides javax.naming.NamingException.toString.

Generates the string representation of this exception. This string consists of the NamingException information plus the link's remaining name. This string is used for debugging and not meant to be interpreted programmatically.

Returns:String

The non-null string representation of this link exception.

toStringback to summary
public String toString(boolean detail)

Overrides javax.naming.NamingException.toString.

Generates the string representation of this exception. This string consists of the NamingException information plus the additional information of resolving the link. If 'detail' is true, the string also contains information on the link resolved object. If false, this method is the same as the form of toString() that accepts no parameters. This string is used for debugging and not meant to be interpreted programmatically.

Parameters
detail:boolean

If true, add information about the link resolved object.

Returns:String

The non-null string representation of this link exception.