public class LinkException extends NamingException
Analogous 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.
Context.lookupLink(javax.naming.Name)
,
LinkRef
,
Serialized FormModifier and Type | Field 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.
|
remainingName, resolvedName, resolvedObj, rootException
Constructor and Description |
---|
LinkException()
Constructs a new instance of LinkException.
|
LinkException(String explanation)
Constructs a new instance of LinkException with an explanation
All the other fields are initialized to null.
|
Modifier and Type | Method and Description |
---|---|
String |
getLinkExplanation()
Retrieves the explanation associated with the problem encounter
when resolving a link.
|
Name |
getLinkRemainingName()
Retrieves the remaining unresolved portion of the link name.
|
Name |
getLinkResolvedName()
Retrieves the leading portion of the link name that was resolved
successfully.
|
Object |
getLinkResolvedObj()
Retrieves the object to which resolution was successful.
|
void |
setLinkExplanation(String msg)
Sets the explanation associated with the problem encounter
when resolving a link.
|
void |
setLinkRemainingName(Name name)
Sets the remaining link name field of this exception.
|
void |
setLinkResolvedName(Name name)
Sets the resolved link name field of this exception.
|
void |
setLinkResolvedObj(Object obj)
Sets the link resolved object field of this exception.
|
String |
toString()
Generates the string representation of this exception.
|
String |
toString(boolean detail)
Generates the string representation of this exception.
|
appendRemainingComponent, appendRemainingName, getCause, getExplanation, getRemainingName, getResolvedName, getResolvedObj, getRootCause, initCause, setRemainingName, setResolvedName, setResolvedObj, setRootCause
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, printStackTrace, printStackTrace, printStackTrace, setStackTrace
protected Name linkResolvedName
protected Object linkResolvedObj
protected Name linkRemainingName
protected String linkExplanation
public LinkException(String explanation)
explanation
- A possibly null string containing additional
detail about this exception.Throwable.getMessage()
public LinkException()
public Name getLinkResolvedName()
getLinkResolvedObj()
,
setLinkResolvedName(javax.naming.Name)
public Name getLinkRemainingName()
setLinkRemainingName(javax.naming.Name)
public Object getLinkResolvedObj()
getLinkResolvedName()
,
setLinkResolvedObj(java.lang.Object)
public String getLinkExplanation()
setLinkExplanation(java.lang.String)
public void setLinkExplanation(String msg)
msg
- The possibly null detail string explaining more about the problem
with resolving a link. If null, it means no detail will be recorded.getLinkExplanation()
public void setLinkResolvedName(Name name)
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
does not
affect the copy in this NamingException and vice versa.
name
- The name to set resolved link name to. This can be null.
If null, it sets the link resolved name field to null.getLinkResolvedName()
public void setLinkRemainingName(Name name)
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
does not
affect the copy in this NamingException and vice versa.
name
- The name to set remaining link name to. This can be null.
If null, it sets the remaining name field to null.getLinkRemainingName()
public void setLinkResolvedObj(Object obj)
obj
- The object to set link resolved object to. This can be null.
If null, the link resolved object field is set to null.getLinkResolvedObj()
public String toString()
toString
in class NamingException
public String toString(boolean detail)
toString
in class NamingException
detail
- If true, add information about the link resolved
object. Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2011, Oracle and/or its affiliates. All rights reserved.
DRAFT ea-b138