import javax.naming.Binding;
import javax.naming.Context;
import javax.naming.Name;
-import javax.naming.NameAlreadyBoundException;
import javax.naming.NameClassPair;
-import javax.naming.NameNotFoundException;
import javax.naming.NameParser;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
-import javax.naming.NotContextException;
-import javax.naming.OperationNotSupportedException;
-import javax.naming.directory.InvalidAttributesException;
/**
* Catalina JNDI Context implementation.
* @return the object bound to name
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public Object lookup(Name name)
throws NamingException {
* @return the object bound to name
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public Object lookup(String name)
throws NamingException {
*
* @param name the name to bind; may not be empty
* @param obj the object to bind; possibly null
- * @exception NameAlreadyBoundException if name is already bound
- * @exception InvalidAttributesException if object did not supply all
- * mandatory attributes
+ * @exception javax.naming.NameAlreadyBoundException if name is already
+ * bound
+ * @exception javax.naming.InvalidAttributesException if object did not
+ * supply all mandatory attributes
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public void bind(Name name, Object obj)
throws NamingException {
getBoundContext().bind(parseName(name), obj);
*
* @param name the name to bind; may not be empty
* @param obj the object to bind; possibly null
- * @exception NameAlreadyBoundException if name is already bound
- * @exception InvalidAttributesException if object did not supply all
- * mandatory attributes
+ * @exception javax.naming.NameAlreadyBoundException if name is already
+ * bound
+ * @exception javax.naming.InvalidAttributesException if object did not
+ * supply all mandatory attributes
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public void bind(String name, Object obj)
throws NamingException {
getBoundContext().bind(parseName(name), obj);
*
* @param name the name to bind; may not be empty
* @param obj the object to bind; possibly null
- * @exception InvalidAttributesException if object did not supply all
- * mandatory attributes
+ * @exception javax.naming.InvalidAttributesException if object did not
+ * supply all mandatory attributes
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public void rebind(Name name, Object obj)
throws NamingException {
getBoundContext().rebind(parseName(name), obj);
*
* @param name the name to bind; may not be empty
* @param obj the object to bind; possibly null
- * @exception InvalidAttributesException if object did not supply all
- * mandatory attributes
+ * @exception javax.naming.InvalidAttributesException if object did not
+ * supply all mandatory attributes
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public void rebind(String name, Object obj)
throws NamingException {
getBoundContext().rebind(parseName(name), obj);
* NameNotFoundException if any of the intermediate contexts do not exist.
*
* @param name the name to bind; may not be empty
- * @exception NameNotFoundException if an intermediate context does not
- * exist
+ * @exception javax.naming NameNotFoundException if an intermediate context
+ * does not exist
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public void unbind(Name name)
throws NamingException {
getBoundContext().unbind(parseName(name));
* Unbinds the named object.
*
* @param name the name to bind; may not be empty
- * @exception NameNotFoundException if an intermediate context does not
- * exist
+ * @exception javax.naming NameNotFoundException if an intermediate context
+ * does not exist
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public void unbind(String name)
throws NamingException {
getBoundContext().unbind(parseName(name));
*
* @param oldName the name of the existing binding; may not be empty
* @param newName the name of the new binding; may not be empty
- * @exception NameAlreadyBoundException if newName is already bound
+ * @exception javax.naming.NameAlreadyBoundException if name is already
+ * bound
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public void rename(Name oldName, Name newName)
throws NamingException {
getBoundContext().rename(parseName(oldName), parseName(newName));
*
* @param oldName the name of the existing binding; may not be empty
* @param newName the name of the new binding; may not be empty
- * @exception NameAlreadyBoundException if newName is already bound
+ * @exception javax.naming.NameAlreadyBoundException if name is already
+ * bound
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public void rename(String oldName, String newName)
throws NamingException {
getBoundContext().rename(parseName(oldName), parseName(newName));
* this context. Each element of the enumeration is of type NameClassPair.
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public NamingEnumeration<NameClassPair> list(Name name)
throws NamingException {
* this context. Each element of the enumeration is of type NameClassPair.
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public NamingEnumeration<NameClassPair> list(String name)
throws NamingException {
* Each element of the enumeration is of type Binding.
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public NamingEnumeration<Binding> listBindings(Name name)
throws NamingException {
* Each element of the enumeration is of type Binding.
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public NamingEnumeration<Binding> listBindings(String name)
throws NamingException {
* the foreign context's "native" naming system.
*
* @param name the name of the context to be destroyed; may not be empty
- * @exception NameNotFoundException if an intermediate context does not
- * exist
- * @exception NotContextException if the name is bound but does not name
- * a context, or does not name a context of the appropriate type
+ * @exception javax.naming NameNotFoundException if an intermediate context
+ * does not exist
+ * @exception javax.naming.NotContextException if the name is bound but does
+ * not name a context, or does not name a context of the appropriate type
*/
+ @Override
public void destroySubcontext(Name name)
throws NamingException {
getBoundContext().destroySubcontext(parseName(name));
* Destroys the named context and removes it from the namespace.
*
* @param name the name of the context to be destroyed; may not be empty
- * @exception NameNotFoundException if an intermediate context does not
- * exist
- * @exception NotContextException if the name is bound but does not name
- * a context, or does not name a context of the appropriate type
+ * @exception javax.naming NameNotFoundException if an intermediate context
+ * does not exist
+ * @exception javax.naming.NotContextException if the name is bound but does
+ * not name a context, or does not name a context of the appropriate type
*/
+ @Override
public void destroySubcontext(String name)
throws NamingException {
getBoundContext().destroySubcontext(parseName(name));
*
* @param name the name of the context to create; may not be empty
* @return the newly created context
- * @exception NameAlreadyBoundException if name is already bound
- * @exception InvalidAttributesException if creation of the subcontext
- * requires specification of mandatory attributes
+ * @exception javax.naming.NameAlreadyBoundException if name is already
+ * bound
+ * @exception javax.naming.InvalidAttributesException if creation of the
+ * sub-context requires specification of mandatory attributes
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public Context createSubcontext(Name name)
throws NamingException {
return getBoundContext().createSubcontext(parseName(name));
*
* @param name the name of the context to create; may not be empty
* @return the newly created context
- * @exception NameAlreadyBoundException if name is already bound
- * @exception InvalidAttributesException if creation of the subcontext
- * requires specification of mandatory attributes
+ * @exception javax.naming.NameAlreadyBoundException if name is already
+ * bound
+ * @exception javax.naming.InvalidAttributesException if creation of the
+ * sub-context requires specification of mandatory attributes
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public Context createSubcontext(String name)
throws NamingException {
return getBoundContext().createSubcontext(parseName(name));
* (if any).
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public Object lookupLink(Name name)
throws NamingException {
* (if any).
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public Object lookupLink(String name)
throws NamingException {
* components
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public NameParser getNameParser(Name name)
throws NamingException {
return getBoundContext().getNameParser(parseName(name));
* components
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public NameParser getNameParser(String name)
throws NamingException {
return getBoundContext().getNameParser(parseName(name));
* @return the composition of prefix and name
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public Name composeName(Name name, Name prefix)
throws NamingException {
- prefix = (Name) prefix.clone();
- return prefix.addAll(name);
+ Name prefixClone = (Name) prefix.clone();
+ return prefixClone.addAll(name);
}
* @return the composition of prefix and name
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public String composeName(String name, String prefix)
throws NamingException {
return prefix + "/" + name;
* @param propVal the value of the property to add; may not be null
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public Object addToEnvironment(String propName, Object propVal)
throws NamingException {
return getBoundContext().addToEnvironment(propName, propVal);
* may not be null
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public Object removeFromEnvironment(String propName)
throws NamingException {
return getBoundContext().removeFromEnvironment(propName);
* @return the environment of this context; never null
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public Hashtable<?,?> getEnvironment()
throws NamingException {
return getBoundContext().getEnvironment();
*
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public void close()
throws NamingException {
getBoundContext().close();
* OperationNotSupportedException is thrown.
*
* @return this context's name in its own namespace; never null
- * @exception OperationNotSupportedException if the naming system does
- * not have the notion of a full name
+ * @exception javax.naming.OperationNotSupportedException if the naming
+ * system does not have the notion of a full name
* @exception NamingException if a naming exception is encountered
*/
+ @Override
public String getNameInNamespace()
throws NamingException {
return prefix;