/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Implements the JNDI NamingEnumeration interface for COS
* Naming. Gets hold of a list of bindings from the COS Naming Server
* and allows the client to iterate through them.
*
* @author Raj Krishnamurthy
* @author Rosanna Lee
*/
/**
* Creates a CNBindingEnumeration object.
* @param ctx Context to enumerate
*/
// Get batch size to use
try {
} catch (NumberFormatException e) {
}
}
_ctx.incEnumCount();
this.isLookedUpCtx = isLookedUpCtx;
_bindingList = new BindingListHolder();
// Perform listing and request that bindings be returned in _bindingIter
// Upon return,_bindingList returns a zero length list
// Get first batch using _bindingIter
if (_bindingIter != null) {
} else {
more = false;
}
counter = 0;
}
/**
* Returns the next binding in the list.
* @exception NamingException any naming exception.
*/
getMore();
}
counter++;
return mapBinding(bndg);
} else {
throw new NoSuchElementException();
}
}
/**
* Returns true or false depending on whether there are more bindings.
* @return boolean value
*/
// If there's more, check whether current bindingList has been exhausted,
// and if so, try to get more.
// If no more, just say so.
}
/**
* Returns true or false depending on whether there are more bindings.
* Need to define this to satisfy the Enumeration api requirement.
* @return boolean value
*/
public boolean hasMoreElements() {
try {
return hasMore();
} catch (NamingException e) {
return false;
}
}
/**
* Returns the next binding in the list.
* @exception NoSuchElementException Thrown when the end of the
* list is reached.
*/
try {
return next();
} catch (NamingException ne) {
throw new NoSuchElementException();
}
}
more = false;
if (_bindingIter != null) {
_bindingIter = null;
}
_ctx.decEnumCount();
/**
* context was obtained by CNCtx, the user doesn't have a handle to
* it, close it as we are done enumerating through the context
*/
if (isLookedUpCtx) {
}
}
}
protected void finalize() {
try {
close();
} catch (NamingException e) {
// ignore failures
}
}
/**
* Get the next batch using _bindingIter. Update the 'more' field.
*/
try {
} catch (Exception e) {
more = false;
"Problem getting binding list");
ne.setRootCause(e);
throw ne;
}
return more;
}
/**
* Constructs a JNDI Binding object from the COS Naming binding
* object.
* @exception NameNotFound No objects under the name.
* @exception CannotProceed Unable to obtain a continuation context
* @exception InvalidName Name not understood.
* @exception NamingException One of the above.
*/
throws NamingException {
try {
} catch (NamingException e) {
throw e;
} catch (Exception e) {
"problem generating object using object factory");
ne.setRootCause(e);
throw ne;
}
// Use cname.toString() instead of bindingName because the name
// in the binding should be a composite name
return jbndg;
}
}