public class

Continuation

extends ResolveResult
java.lang.Object
   ↳ javax.naming.spi.ResolveResult
     ↳ com.sun.jndi.toolkit.ctx.Continuation

Class Overview

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

Summary

Fields
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.
protected Name starter The name that we started out with.
[Expand]
Inherited Fields
From class javax.naming.spi.ResolveResult
Public Constructors
Continuation()
Constructs a new instance of Continuation.
Continuation(Name top, Hashtable environment)
Constructs a new instance of Continuation.
Public Methods
NamingException fillInException(NamingException e)
Fills in an exception's fields using data from this Continuation.
boolean isContinue()
Determines whether this Continuation contains data that should be used to continue the operation.
void setContinue(Object obj, Name relResName, Context currCtx)
Sets this Continuation with the supplied data, and set remaining name to be the empty name.
void setContinue(Object obj, String relResName, Context currCtx, String remain)
String overload.
void setContinue(Object obj, Name relResName, Context currCtx, Name remain)
Sets this Continuation with the supplied data.
void setContinue(Object obj, Object currCtx)
This method is deprecated. No replacement.
void setContinueNNS(Object resObj, String relResName, Context currCtx)
Overloaded form that accesses String names.
void setContinueNNS(Object resObj, Name relResName, Context currCtx)
Sets this Continuation with the supplied data, and set remaining name to be "/".
void setError(Object resObj, String remain)
Form that accepts a String name instead of a Name name.
void setError(Object resObj, Name remain)
Sets this Continuation to indicated that an error has occurred and supply resolved information.
void setErrorNNS(Object resObj, String remain)
Form that accepts a String name instead of a Name name.
void setErrorNNS(Object resObj, Name remain)
Sets this Continuation to indicated that an error has occurred, and that the remaining name is rename + "/".
void setSuccess()
Sets this Continuation to indicate successful completion.
String toString(boolean detail)
String toString()
Returns a string representation of the object.
[Expand]
Inherited Methods
From class javax.naming.spi.ResolveResult
From class java.lang.Object

Fields

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.

protected Hashtable environment

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

protected Object followingLink

Whether links were encountered.

protected Name relativeResolvedName

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

protected Context resolvedContext

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

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.

Public Constructors

public Continuation ()

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

public Continuation (Name top, Hashtable environment)

Constructs a new instance of Continuation.

Parameters
top 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 The environment used by the caller. It is used when setting the "environment" of a CannotProceedException.

Public Methods

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 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 The non-null naming exception to fill.
Returns
  • The non-null naming exception with its fields set using data from this Continuation.

public boolean isContinue ()

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

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

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
relResName The non-null resolved name relative to currCtx.
currCtx The non-null context from which relResName is to be resolved.

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

String overload.

Parameters
relResName The non-null resolved name relative to currCtx.
currCtx The non-null context from which relResName is to be resolved.
remain The non-null remaining name.

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
relResName The non-null resolved name relative to currCtx.
currCtx The non-null context from which relResName is to be resolved.
remain The non-null remaining name.

public void setContinue (Object obj, Object currCtx)

This method is deprecated.
No replacement.

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

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

Overloaded form that accesses String names.

Parameters
resObj The possibly null resolved object.
relResName The non-null resolved name relative to currCtx.
currCtx The non-null context from which relResName is to be resolved.

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 The possibly null resolved object.
relResName The non-null resolved name relative to currCtx.
currCtx The non-null context from which relResName is to be resolved.

public void setError (Object resObj, String remain)

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

Parameters
resObj The possibly null object that was resolved to.
remain The possibly String remaining name.

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. Consequenetly, it would call setError() with the resolved object and the remaining name.

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

Parameters
resObj The possibly null object that was resolved to.
remain The possibly null remaining name.

public void setErrorNNS (Object resObj, String remain)

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

Parameters
resObj The possibly null object that was resolved to.
remain The possibly String remaining name.

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. Consequenetly, 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 The possibly null object that was resolved to.
remain The non-null remaining name.

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

public String toString (boolean detail)

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
  • a string representation of the object.