APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.jndi.toolkit.ctx

public Class Continuation

extends ResolveResult
Class Inheritance
Imports
javax.naming.*, javax.naming.spi.ResolveResult, java.util.Hashtable

This class contains information required to continue the method (place where it left off, and remaining name to continue).
Author
Rosanna Lee

Field Summary

Modifier and TypeField and Description
protected boolean
continuing

Indicates whether the Continuation instance indicates that the operation should be continued using the data in the Continuation.

protected Hashtable<?, ?>
environment

The environment used by the caller.

protected Object
followingLink

Whether links were encountered.

protected Name
relativeResolvedName

The resolved name relative to resolvedContext.

protected Context
resolvedContext

The last resolved context.

private static final long
protected Name
starter

The name that we started out with.

Inherited from javax.naming.spi.ResolveResult:
remainingNameresolvedObj

Constructor Summary

AccessConstructor and Description
public
Continuation()

Constructs a new instance of Continuation.

public
Continuation(Name
The name of the object that is to be resolved/operated upon. This becomes the Continuation's 'starter' and is used to calculate the "resolved name" when filling in a NamingException.
top
,
Hashtable<?, ?>
The environment used by the caller. It is used when setting the "environment" of a CannotProceedException.
environment
)

Constructs a new instance of Continuation.

Method Summary

Modifier and TypeMethod and Description
public NamingException

Returns:

The non-null naming exception with its fields set using data from this Continuation.
fillInException
(NamingException
The non-null naming exception to fill.
e
)

Fills in an exception's fields using data from this Continuation.

public boolean

Returns:

true if operation should continue; false if operation has completed (successfully or unsuccessfully).
isContinue
()

Determines whether this Continuation contains data that should be used to continue the operation.

public void
setContinue(Object
The possibly null resolved object.
obj
,
Name
The non-null resolved name relative to currCtx.
relResName
,
Context
The non-null context from which relResName is to be resolved.
currCtx
)

Sets this Continuation with the supplied data, and set remaining name to be the empty name.

public void
setContinue(Object
The possibly null resolved object.
obj
,
Name
The non-null resolved name relative to currCtx.
relResName
,
Context
The non-null context from which relResName is to be resolved.
currCtx
,
Name
The non-null remaining name.
remain
)

Sets this Continuation with the supplied data.

public void
setContinue(Object
The possibly null resolved object.
obj
,
String
The non-null resolved name relative to currCtx.
relResName
,
Context
The non-null context from which relResName is to be resolved.
currCtx
,
String
The non-null remaining name.
remain
)

String overload.

public void
setContinue(Object obj, Object currCtx)
Deprecated

%%% This method is kept only for backward compatibility.

private void
setContinueAux(Object resObj, Name relResName, Context currCtx, Name remain)

public void
setContinueNNS(Object
The possibly null resolved object.
resObj
,
Name
The non-null resolved name relative to currCtx.
relResName
,
Context
The non-null context from which relResName is to be resolved.
currCtx
)

Sets this Continuation with the supplied data, and set remaining name to be "/".

public void
setContinueNNS(Object
The possibly null resolved object.
resObj
,
String
The non-null resolved name relative to currCtx.
relResName
,
Context
The non-null context from which relResName is to be resolved.
currCtx
)

Overloaded form that accesses String names.

public void
setError(Object
The possibly null object that was resolved to.
resObj
,
Name
The possibly null remaining name.
remain
)

Sets this Continuation to indicated that an error has occurred and supply resolved information.

public void
setError(Object
The possibly null object that was resolved to.
resObj
,
String
The possibly String remaining name.
remain
)

Form that accepts a String name instead of a Name name.

private void
setErrorAux(Object resObj, Name rname)

public void
setErrorNNS(Object
The possibly null object that was resolved to.
resObj
,
Name
The non-null remaining name.
remain
)

Sets this Continuation to indicated that an error has occurred, and that the remaining name is rename + "/".

public void
setErrorNNS(Object
The possibly null object that was resolved to.
resObj
,
String
The possibly String remaining name.
remain
)

Form that accepts a String name instead of a Name name.

public void
setSuccess()

Sets this Continuation to indicate successful completion.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public String
toString(boolean detail)

Inherited from javax.naming.spi.ResolveResult:
appendRemainingComponentappendRemainingNamegetRemainingNamegetResolvedObjsetRemainingNamesetResolvedObj

Field Detail

continuingback to summary
protected boolean continuing

Indicates whether the Continuation instance indicates that the operation should be continued using the data in the Continuation. Typically, this is only false if an error has been encountered or if the operation has succeeded.

environmentback to summary
protected Hashtable<?, ?> environment

The environment used by the caller. Initialized by constructor and used when filling out a CannotProceedException.

relativeResolvedNameback to summary
protected Name relativeResolvedName

The resolved name relative to resolvedContext. Used to set the "AltName" in a CannotProceedException.

resolvedContextback to summary
protected Context resolvedContext

The last resolved context. Used to set the "AltNameCtx" in a CannotProceedException.

Annotations
@SuppressWarnings:serial
serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.naming.spi.ResolveResult.serialVersionUID.

starterback to summary
protected Name starter

The name that we started out with. It is initialized by the constructor and used to calculate to "resolved name" in NamingException in fillInException(). %%% Note that this approach does not always do the calculation correctly with respect to absence or presence of the trailing slash for resolved name.

Constructor Detail

Continuationback to summary
public Continuation()

Constructs a new instance of Continuation. Used as dummy for contexts that do not do federation (e.g. for schema ops)

Continuationback to summary
public Continuation(Name top, Hashtable<?, ?> environment)

Constructs a new instance of Continuation.

Parameters
top:Name

The name of the object that is to be resolved/operated upon. This becomes the Continuation's 'starter' and is used to calculate the "resolved name" when filling in a NamingException.

environment:Hashtable<?, ?>

The environment used by the caller. It is used when setting the "environment" of a CannotProceedException.

Method Detail

fillInExceptionback to summary
public NamingException fillInException(NamingException e)

Fills in an exception's fields using data from this Continuation. The resolved name is set by subtracting remainingName from starter. %%% This might not always produce the correct answer wrt trailing "/". If the exception is a CannotProceedException, its environment, altName, and altNameCtx fields are set using this continuation's environment, relativeResolvedName, and resolvedContext.

Parameters
e:NamingException

The non-null naming exception to fill.

Returns:NamingException

The non-null naming exception with its fields set using data from this Continuation.

isContinueback to summary
public boolean isContinue()

Determines whether this Continuation contains data that should be used to continue the operation.

Returns:boolean

true if operation should continue; false if operation has completed (successfully or unsuccessfully).

setContinueback to summary
public void setContinue(Object obj, Name relResName, Context currCtx)

Sets this Continuation with the supplied data, and set remaining name to be the empty name. This method is typically called by list-style methods in which the target context implementing list() expects an empty name. For example when c_list() is given a non-empty name to process, it would resolve that name, and then call setContinue() with the resolved object so that the target context to be listed would be called with the empty name (i.e. list the target context itself).

After this method is called, isContinuing() returns true.

Parameters
obj:Object

The possibly null resolved object.

relResName:Name

The non-null resolved name relative to currCtx.

currCtx:Context

The non-null context from which relResName is to be resolved.

setContinueback to summary
public void setContinue(Object obj, Name relResName, Context currCtx, Name remain)

Sets this Continuation with the supplied data. This method is typically called by a method that has been asked to operate on a name. The method resolves part of the name (relResName) to obj and sets the unprocessed part to rename. It calls setContinue() so that the operation can be continued using this data.

After this method is called, isContinuing() returns true.

Parameters
obj:Object

The possibly null resolved object.

relResName:Name

The non-null resolved name relative to currCtx.

currCtx:Context

The non-null context from which relResName is to be resolved.

remain:Name

The non-null remaining name.

setContinueback to summary
public void setContinue(Object obj, String relResName, Context currCtx, String remain)

String overload.

Parameters
obj:Object

The possibly null resolved object.

relResName:String

The non-null resolved name relative to currCtx.

currCtx:Context

The non-null context from which relResName is to be resolved.

remain:String

The non-null remaining name.

See Also
setContinue(java.lang.Object, java.lang.String, javax.naming.Context, java.lang.String)
setContinueback to summary
public void setContinue(Object obj, Object currCtx)

Deprecated

%%% This method is kept only for backward compatibility. Delete when old implementations updated. Replaced by setContinue(obj, relResName, (Context)currCtx);

Annotations
@Deprecated
setContinueAuxback to summary
private void setContinueAux(Object resObj, Name relResName, Context currCtx, Name remain)
setContinueNNSback to summary
public void setContinueNNS(Object resObj, Name relResName, Context currCtx)

Sets this Continuation with the supplied data, and set remaining name to be "/". This method is typically called by _nns methods that have been given a name to process. It might the name (without the nns) and continue process of the nns elsewhere. Consequently, it would call this form of the setContinueNNS(). This method supplies "/" as the remaining name.

After this method is called, isContinuing() returns true.

Parameters
resObj:Object

The possibly null resolved object.

relResName:Name

The non-null resolved name relative to currCtx.

currCtx:Context

The non-null context from which relResName is to be resolved.

setContinueNNSback to summary
public void setContinueNNS(Object resObj, String relResName, Context currCtx)

Overloaded form that accesses String names.

Parameters
resObj:Object

The possibly null resolved object.

relResName:String

The non-null resolved name relative to currCtx.

currCtx:Context

The non-null context from which relResName is to be resolved.

See Also
setContinueNNS(java.lang.Object, javax.naming.Name, javax.naming.Context)
setErrorback to summary
public void setError(Object resObj, Name remain)

Sets this Continuation to indicated that an error has occurred and supply resolved information. This method is typically called by methods that have been given a name to process. It might process part of that name but encountered some error. Consequently, it would call setError() with the resolved object and the remaining name.

After this method is called, isContinuing() returns false.

Parameters
resObj:Object

The possibly null object that was resolved to.

remain:Name

The possibly null remaining name.

setErrorback to summary
public void setError(Object resObj, String remain)

Form that accepts a String name instead of a Name name.

Parameters
resObj:Object

The possibly null object that was resolved to.

remain:String

The possibly String remaining name.

See Also
setError(java.lang.Object, javax.naming.Name)
setErrorAuxback to summary
private void setErrorAux(Object resObj, Name rname)
setErrorNNSback to summary
public void setErrorNNS(Object resObj, Name remain)

Sets this Continuation to indicated that an error has occurred, and that the remaining name is rename + "/". This method is typically called by _nns methods that have been given a name to process. It might process part of that name but encountered some error. Consequently, it would call setErrorNNS() with the remaining name. Since the _nns method was expected to operate upon the "nns" of the original name, the remaining name must include the "nns". That's why this method adds a trailing "/".

After this method is called, isContinuing() returns false.

Parameters
resObj:Object

The possibly null object that was resolved to.

remain:Name

The non-null remaining name.

setErrorNNSback to summary
public void setErrorNNS(Object resObj, String remain)

Form that accepts a String name instead of a Name name.

Parameters
resObj:Object

The possibly null object that was resolved to.

remain:String

The possibly String remaining name.

See Also
setErrorNNS(java.lang.Object, javax.naming.Name)
setSuccessback to summary
public void setSuccess()

Sets this Continuation to indicate successful completion. Subsequent calls to isContinue() will return false. This method is different from the setError() methods only from the standpoint that this method does not set any of the other fields such as resolved object or resolved context. This is because this method is typically called when the context recognizes that the operation has successfully completed and that the continuation already contains the appropriately set fields.

See Also
setError, setErrorNNS
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

toStringback to summary
public String toString(boolean detail)