aicas logo Jamaica 3.4 release 8

com.sun.jndi.toolkit.ctx
Class Continuation

java.lang.Object
  extended by javax.naming.spi.ResolveResult
      extended by com.sun.jndi.toolkit.ctx.Continuation
All Implemented Interfaces:
Serializable

public class Continuation
extends ResolveResult

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

See Also:
Serialized Form

Field Summary
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.
 
Fields inherited from class javax.naming.spi.ResolveResult
remainingName, resolvedObj
 
Constructor Summary
Continuation()
          Constructs a new instance of Continuation.
Continuation(Name top, Hashtable environment)
          Constructs a new instance of Continuation.
 
Method Summary
 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 resObj, Name relResName, Context currCtx)
          Sets this Continuation with the supplied data, and set remaining name to be the empty name.
 void setContinue(Object resObj, Name relResName, Context currCtx, Name remain)
          Sets this Continuation with the supplied data.
 void setContinue(Object obj, Object currCtx)
          Deprecated.  
 void setContinue(Object resObj, String relResName, Context currCtx, String remain)
          String overload.
 void setContinueNNS(Object resObj, Name relResName, Context currCtx)
          Sets this Continuation with the supplied data, and set remaining name to be "/".
 void setContinueNNS(Object resObj, String relResName, Context currCtx)
          Overloaded form that accesses String names.
 void setError(Object resObj, Name remain)
          Sets this Continuation to indicated that an error has occurred and supply resolved information.
 void setError(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 setErrorNNS(Object resObj, String remain)
          Form that accepts a String name instead of a Name name.
 void setSuccess()
          Sets this Continuation to indicate successful completion.
 String toString()
          toString creates a printable string that represents this object for debugging purposes.
 String toString(boolean detail)
           
 
Methods inherited from class javax.naming.spi.ResolveResult
appendRemainingComponent, appendRemainingName, getRemainingName, getResolvedObj, setRemainingName, setResolvedObj
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

starter

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.


followingLink

protected Object followingLink
Whether links were encountered.


environment

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


continuing

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.


resolvedContext

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


relativeResolvedName

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

Constructor Detail

Continuation

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


Continuation

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.
Method Detail

isContinue

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).

setSuccess

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(java.lang.Object, javax.naming.Name), setErrorNNS(java.lang.Object, javax.naming.Name)

fillInException

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.

setErrorNNS

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.

setErrorNNS

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.
See Also:
setErrorNNS(java.lang.Object, javax.naming.Name)

setError

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.

setError

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.
See Also:
setError(java.lang.Object, javax.naming.Name)

setContinueNNS

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.

setContinueNNS

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.
See Also:
setContinueNNS(java.lang.Object, javax.naming.Name, javax.naming.Context)

setContinue

public void setContinue(Object resObj,
                        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:
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.

setContinue

public void setContinue(Object resObj,
                        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:
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.
remain - The non-null remaining name.

setContinue

public void setContinue(Object resObj,
                        String relResName,
                        Context currCtx,
                        String remain)
String overload.

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.
remain - The non-null remaining name.
See Also:
setContinue(java.lang.Object, java.lang.String, javax.naming.Context, java.lang.String)

setContinue

@Deprecated
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);


toString

public String toString()
Description copied from class: Object
toString creates a printable string that represents this object for debugging purposes.

The default implementation returns getClass().getName() + '@' + Integer.toHexString(hashCode()).

Overrides:
toString in class Object
Returns:
a string identifying this object.

toString

public String toString(boolean detail)

aicas logo Jamaica 3.4 release 8

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2009 aicas GmbH. All Rights Reserved.