javax.naming
Interface Context
- DirContext, EventContext, EventDirContext, LdapContext
- ContextContinuation, ContextContinuation, GiopNamingServiceURLContext, InitialContext, InitialDirContext, InitialLdapContext, rmiURLContext, RmiContinuation
Object | addToEnvironment(String propName, Object propVal) - Add new environment property to the environment of this context.
|
void | bind(String name, Object obj) - Give the specified name for the specified object.
|
void | bind(Name name, Object obj) - Give the specified name for the specified object.
|
void | close() - Releases all resources, associated with this context.
|
String | composeName(String name, String prefix) - Composes the name of this context together with another name, related to
this context.
|
Name | composeName(Name name, Name prefix) - Composes the name of this context together with another name, related to
this context.
|
Context | createSubcontext(String name) - Creates the new naming subcontext and binds it to the current (this)
context.
|
Context | createSubcontext(Name name) - Creates the new naming subcontext and binds it to the current (this)
context.
|
void | destroySubcontext(String name) - Removes the naming subcontext from this naming context.
|
void | destroySubcontext(Name name) - Removes the naming subcontext from this naming context.
|
Hashtable,?> | getEnvironment() - Returns the environment, associated with this naming context.
|
String | getNameInNamespace() - Returs the full name of this naming context.
|
NameParser | getNameParser(String name) - Obtains the name parser for parsing the names of the given naming
subcontext.
|
NameParser | getNameParser(Name name) - Obtains the name parser for parsing the names of the given naming
subcontext.
|
NamingEnumeration | list(String name) - Creates and returns the enumeration over the name bindings that are present
the given subcontext.
|
NamingEnumeration | list(Name name) - Creates and returns the enumeration over the name bindings that are present
the given subcontext.
|
NamingEnumeration | listBindings(String name) - Creates and returns the enumeration over the name - object bindings that
are present the given subcontext.
|
NamingEnumeration | listBindings(Name name) - Creates and returns the enumeration over the name - object bindings that
are present the given subcontext.
|
Object | lookup(String name) - Gets the previously named object by name.
|
Object | lookup(Name name) - Gets the previously named object by name.
|
Object | lookupLink(String name) - Retrieves the named object, not following the link of the terminal atomic
component of the name.
|
Object | lookupLink(Name name) - Retrieves the named object, not following the link of the terminal atomic
component of the name.
|
void | rebind(String name, Object obj) - Give the specified name for the specified object.
|
void | rebind(Name name, Object obj) - Give the specified name for the specified object.
|
Object | removeFromEnvironment(String propName) - Removes the property with the given name from the environment.
|
void | rename(String oldName, String newName) - Renames the existing binding, removing the existing and giving the new name
for the same object.
|
void | rename(Name oldName, Name newName) - Renames the existing binding, removing the existing and giving the new name
for the same object.
|
void | unbind(String name) - Removes the name - object mapping from the current context.
|
void | unbind(Name name) - Removes the name - object mapping from the current context.
|
APPLET
public static final String APPLET
Property for the initial context constructor to use when searching for
other properties.
AUTHORITATIVE
public static final String AUTHORITATIVE
Property with the authoritativeness of the service requested.
- "java.naming.authoritative"
BATCHSIZE
public static final String BATCHSIZE
Property with the batch size to use when returning data via the service's
protocol.
DNS_URL
public static final String DNS_URL
Property with the DNS host and domain names to use.
INITIAL_CONTEXT_FACTORY
public static final String INITIAL_CONTEXT_FACTORY
Property with name of the inital context factory to use
- "java.naming.factory.initial"
LANGUAGE
public static final String LANGUAGE
Property for specifying the preferred language to use with the service.
OBJECT_FACTORIES
public static final String OBJECT_FACTORIES
Property with colon-separated list of object factories to use.
- "java.naming.factory.object"
PROVIDER_URL
public static final String PROVIDER_URL
Property with URL specifying configuration for the service provider to use.
- "java.naming.provider.url"
REFERRAL
public static final String REFERRAL
Property defining how referrals encountered by the service provider are to
be processed.
SECURITY_AUTHENTICATION
public static final String SECURITY_AUTHENTICATION
Property specifying the security level to use.
- "java.naming.security.authentication"
SECURITY_CREDENTIALS
public static final String SECURITY_CREDENTIALS
Property specifying the credentials of the principal for authenticating the
caller to the service.
- "java.naming.security.credentials"
SECURITY_PRINCIPAL
public static final String SECURITY_PRINCIPAL
Property for the identity of the principal for authenticating the caller to
the service.
- "java.naming.security.principal"
SECURITY_PROTOCOL
public static final String SECURITY_PROTOCOL
Property specifying the security protocol to use.
- "java.naming.security.protocol"
STATE_FACTORIES
public static final String STATE_FACTORIES
Property with colon-separated list of state factories to use.
- "java.naming.factory.state"
URL_PKG_PREFIXES
public static final String URL_PKG_PREFIXES
Property with colon-separated list of package prefixes to use.
- "java.naming.factory.url.pkgs"
addToEnvironment
public Object addToEnvironment(String propName,
Object propVal)
throws NamingException
Add new environment property to the environment of this context. Both name
and value of the new property must not be null. If the property is already
defined, is current value is replaced by the propVal.
propName
- the name of the new propertypropVal
- the value of the new property
- the previous value of this property or null if the property has not
been previously defined
bind
public void bind(String name,
Object obj)
throws NamingException
Give the specified name for the specified object. The passed name must not
be already bound to some other object.
name
- the name that will be given to the object (in the scope of this
context).obj
- the object being named.
bind
public void bind(Name name,
Object obj)
throws NamingException
Give the specified name for the specified object. The passed name must not
be already bound to some other object.
name
- the name that will be given to the object (in the scope of this
context).obj
- the object being named.
close
public void close()
throws NamingException
Releases all resources, associated with this context. The close() method
can be called several times, but after it has been once invoked, it is not
allowed to call any other method of this context,
composeName
public String composeName(String name,
String prefix)
throws NamingException
Composes the name of this context together with another name, related to
this context.
name
- a name, defined in the scope of this contextprefix
- a name of this context itself, defined in the scope of some
ancestor
- the name of the same object as named by the first parameter, but
related to the context of the specified ancestor.
composeName
public Name composeName(Name name,
Name prefix)
throws NamingException
Composes the name of this context together with another name, related to
this context.
name
- a name, defined in the scope of this contextprefix
- a name of this context itself, defined in the scope of some
ancestor
- the name of the same object as named by the first parameter, but
related to the context of the specified ancestor.
createSubcontext
public Context createSubcontext(String name)
throws NamingException
Creates the new naming subcontext and binds it to the current (this)
context.
name
- the name of the new context being created
- the newly created context, bound to the instance of the context on
that the method has been called
createSubcontext
public Context createSubcontext(Name name)
throws NamingException
Creates the new naming subcontext and binds it to the current (this)
context.
name
- the name of the new context being created
- the newly created context, bound to the instance of the context on
that the method has been called
destroySubcontext
public void destroySubcontext(String name)
throws NamingException
Removes the naming subcontext from this naming context. Returns without
action if such subcontext does not exist. The context being destroyed must
be empty.
name
- the name of the subcontext beig removed.
destroySubcontext
public void destroySubcontext(Name name)
throws NamingException
Removes the naming subcontext from this naming context. Returns without
action if such subcontext does not exist. The context being destroyed must
be empty.
name
- the name of the subcontext beig removed.
getNameInNamespace
public String getNameInNamespace()
throws NamingException
Returs the full name of this naming context. The returned string is not a
JNDI composite name and should not be passed directly to the methods of the
naming context.
- the full name of this naming context, in its own namespace.
getNameParser
public NameParser getNameParser(String name)
throws NamingException
Obtains the name parser for parsing the names of the given naming
subcontext.
name
- the name of the subcontext for that the parser must be obtained
- the parser to parse the names of that context
getNameParser
public NameParser getNameParser(Name name)
throws NamingException
Obtains the name parser for parsing the names of the given naming
subcontext.
name
- the name of the subcontext for that the parser must be obtained
- the parser to parse the names of that context
list
public NamingEnumeration list(String name)
throws NamingException
Creates and returns the enumeration over the name bindings that are present
the given subcontext. The enumeration elements have the type of
NameClassPair
, providing also information about the class of the
bound object. The behaviour in the case if the bindings are added or
removed later is not defined. The contents of the subcontexts are not
included.
name
- the name of the subcontext
- the enumeration over the names, known for the given subcontext.
list
public NamingEnumeration list(Name name)
throws NamingException
Creates and returns the enumeration over the name bindings that are present
the given subcontext. The enumeration elements have the type of
NameClassPair
, providing also information about the class of the
bound object. The behaviour in the case if the bindings are added or
removed later is not defined. The contents of the subcontexts are not
included.
name
- the name of the subcontext
- the enumeration over the names, known for the given subcontext.
listBindings
public NamingEnumeration listBindings(String name)
throws NamingException
Creates and returns the enumeration over the name - object bindings that
are present the given subcontext. The enumeration elements have the type of
Binding
, providing also information about the class of the bound
object. The behaviour in the case if the bindings are added or removed
later is not defined. The contents of the subcontexts are not included.
name
- the name of the subcontext
- the enumeration over the names, known for the given subcontext.
listBindings
public NamingEnumeration listBindings(Name name)
throws NamingException
Creates and returns the enumeration over the name - object bindings that
are present the given subcontext. The enumeration elements have the type of
Binding
, providing also information about the class of the bound
object. The behaviour in the case if the bindings are added or removed
later is not defined. The contents of the subcontexts are not included.
name
- the name of the subcontext
- the enumeration over the names, known for the given subcontext.
lookup
public Object lookup(String name)
throws NamingException
Gets the previously named object by name. If the passed name is empty, the
method should return a cloned instance of this naming context.
name
- the name of the object being searched in this context
lookup
public Object lookup(Name name)
throws NamingException
Gets the previously named object by name. If the passed name is empty, the
method should return a cloned instance of this naming context.
name
- the name of the object being searched in this context
lookupLink
public Object lookupLink(String name)
throws NamingException
Retrieves the named object, not following the link of the terminal atomic
component of the name. If the object, named by the passed name, is not a
link, returns that object itself. The intermediate links, if present, are
followed.
name
- the name of the object that may be a link, leading to another
object.
- the named object, not following the terminal link (if present).
lookupLink
public Object lookupLink(Name name)
throws NamingException
Retrieves the named object, not following the link of the terminal atomic
component of the name. If the object, named by the passed name, is not a
link, returns that object itself. The intermediate links, if present, are
followed.
name
- the name of the object that may be a link, leading to another
object.
- the named object, not following the terminal link (if present).
rebind
public void rebind(String name,
Object obj)
throws NamingException
Give the specified name for the specified object. Unlike bind, this method
silently replaces the existing binding for this name, if one exists.
name
- the name that will be given to the object (in the scope of this
context).obj
- the object being named.
rebind
public void rebind(Name name,
Object obj)
throws NamingException
Give the specified name for the specified object. Unlike bind, this method
silently replaces the existing binding for this name, if one exists.
name
- the name that will be given to the object (in the scope of this
context).obj
- the object being named.
removeFromEnvironment
public Object removeFromEnvironment(String propName)
throws NamingException
Removes the property with the given name from the environment. Returns
without action if this property is not defined.
propName
- the name of the property being removed.
- the value of the property that has been removed or null if the
property was not defined.
rename
public void rename(String oldName,
String newName)
throws NamingException
Renames the existing binding, removing the existing and giving the new name
for the same object.
oldName
- the existing name of the known objectnewName
- the new name of the same object
rename
public void rename(Name oldName,
Name newName)
throws NamingException
Renames the existing binding, removing the existing and giving the new name
for the same object.
oldName
- the existing name of the known objectnewName
- the new name of the same object
unbind
public void unbind(String name)
throws NamingException
Removes the name - object mapping from the current context. This method
returns without action if the name is not bound to an object in the
terminal context, but throws
NameNotFoundException
if one of the
intermadiate contexts does not exist.
name
- the name to be removed
unbind
public void unbind(Name name)
throws NamingException
Removes the name - object mapping from the current context. This method
returns without action if the name is not bound to an object in the
terminal context, but throws
NameNotFoundException
if one of the
intermadiate contexts does not exist.
name
- the name to be removed
Context.java -- A naming context
Copyright (C) 2000, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath 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 for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.