Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
public interface Context
Field Summary | |
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
Method Summary | |
Object |
|
void | |
void | |
void |
|
String |
|
Name |
|
Context |
|
Context |
|
void |
|
void |
|
Hashtable |
|
String |
|
NameParser |
|
NameParser |
|
NamingEnumeration | |
NamingEnumeration | |
NamingEnumeration |
|
NamingEnumeration |
|
Object | |
Object | |
Object |
|
Object |
|
void | |
void | |
Object |
|
void | |
void | |
void | |
void |
public static final String APPLET
Property for the initial context constructor to use when searching for other properties.
- Field Value:
- "java.naming.applet"
public static final String AUTHORITATIVE
Property with the authoritativeness of the service requested.
- Field Value:
- "java.naming.authoritative"
public static final String BATCHSIZE
Property with the batch size to use when returning data via the service's protocol.
- Field Value:
- "java.naming.batchsize"
public static final String DNS_URL
Property with the DNS host and domain names to use.
- Field Value:
- "java.naming.dns.url"
public static final String INITIAL_CONTEXT_FACTORY
Property with name of the inital context factory to use
- Field Value:
- "java.naming.factory.initial"
public static final String LANGUAGE
Property for specifying the preferred language to use with the service.
- Field Value:
- "java.naming.language"
public static final String OBJECT_FACTORIES
Property with colon-separated list of object factories to use.
- Field Value:
- "java.naming.factory.object"
public static final String PROVIDER_URL
Property with URL specifying configuration for the service provider to use.
- Field Value:
- "java.naming.provider.url"
public static final String REFERRAL
Property defining how referrals encountered by the service provider are to be processed.
- Field Value:
- "java.naming.referral"
public static final String SECURITY_AUTHENTICATION
Property specifying the security level to use.
- Field Value:
- "java.naming.security.authentication"
public static final String SECURITY_CREDENTIALS
Property specifying the credentials of the principal for authenticating the caller to the service.
- Field Value:
- "java.naming.security.credentials"
public static final String SECURITY_PRINCIPAL
Property for the identity of the principal for authenticating the caller to the service.
- Field Value:
- "java.naming.security.principal"
public static final String SECURITY_PROTOCOL
Property specifying the security protocol to use.
- Field Value:
- "java.naming.security.protocol"
public static final String STATE_FACTORIES
Property with colon-separated list of state factories to use.
- Field Value:
- "java.naming.factory.state"
public static final String URL_PKG_PREFIXES
Property with colon-separated list of package prefixes to use.
- Field Value:
- "java.naming.factory.url.pkgs"
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.
- Parameters:
propName
- the name of the new propertypropVal
- the value of the new property
- Returns:
- the previous value of this property or null if the property has not been previously defined
- Throws:
NamingException
-
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.
- Parameters:
name
- the name that will be given to the object (in the scope of this context).obj
- the object being named.
- Throws:
NamingException
- if the naming operation has failed due other reasons.
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.
- Parameters:
name
- the name that will be given to the object (in the scope of this context).obj
- the object being named.
- Throws:
NamingException
- if the naming operation has failed due other reasons.
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,
- Throws:
NamingException
-
public String composeName(String name, String prefix) throws NamingException
Composes the name of this context together with another name, related to this context.
- Parameters:
name
- a name, defined in the scope of this contextprefix
- a name of this context itself, defined in the scope of some ancestor
- Returns:
- the name of the same object as named by the first parameter, but related to the context of the specified ancestor.
- Throws:
NamingException
-
public Name composeName(Name name, Name prefix) throws NamingException
Composes the name of this context together with another name, related to this context.
- Parameters:
name
- a name, defined in the scope of this contextprefix
- a name of this context itself, defined in the scope of some ancestor
- Returns:
- the name of the same object as named by the first parameter, but related to the context of the specified ancestor.
- Throws:
NamingException
-
public Context createSubcontext(String name) throws NamingException
Creates the new naming subcontext and binds it to the current (this) context.
- Parameters:
name
- the name of the new context being created
- Returns:
- the newly created context, bound to the instance of the context on that the method has been called
- Throws:
NamingException
-
public Context createSubcontext(Name name) throws NamingException
Creates the new naming subcontext and binds it to the current (this) context.
- Parameters:
name
- the name of the new context being created
- Returns:
- the newly created context, bound to the instance of the context on that the method has been called
- Throws:
NamingException
-
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.
- Parameters:
name
- the name of the subcontext beig removed.
- Throws:
NamingException
-
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.
- Parameters:
name
- the name of the subcontext beig removed.
- Throws:
NamingException
-
public Hashtable getEnvironment() throws NamingException
Returns the environment, associated with this naming context. The returned table should never be modified by the caller. UseaddToEnvironment(String,Object)
andremoveFromEnvironment(String)
to modify the environement, if needed.
- Returns:
- the table, representing the environment of this context
- Throws:
NamingException
-
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.
- Returns:
- the full name of this naming context, in its own namespace.
- Throws:
NamingException
-
public NameParser getNameParser(String name) throws NamingException
Obtains the name parser for parsing the names of the given naming subcontext.
- Parameters:
name
- the name of the subcontext for that the parser must be obtained
- Returns:
- the parser to parse the names of that context
- Throws:
NamingException
-
public NameParser getNameParser(Name name) throws NamingException
Obtains the name parser for parsing the names of the given naming subcontext.
- Parameters:
name
- the name of the subcontext for that the parser must be obtained
- Returns:
- the parser to parse the names of that context
- Throws:
NamingException
-
public NamingEnumerationlist(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 ofNameClassPair
, 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.
- Parameters:
name
- the name of the subcontext
- Returns:
- the enumeration over the names, known for the given subcontext.
- Throws:
NamingException
-
public NamingEnumerationlist(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 ofNameClassPair
, 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.
- Parameters:
name
- the name of the subcontext
- Returns:
- the enumeration over the names, known for the given subcontext.
- Throws:
NamingException
-
public NamingEnumerationlistBindings(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 ofBinding
, 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.
- Parameters:
name
- the name of the subcontext
- Returns:
- the enumeration over the names, known for the given subcontext.
- Throws:
NamingException
-
public NamingEnumerationlistBindings(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 ofBinding
, 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.
- Parameters:
name
- the name of the subcontext
- Returns:
- the enumeration over the names, known for the given subcontext.
- Throws:
NamingException
-
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.
- Parameters:
name
- the name of the object being searched in this context
- Returns:
- the named object
- Throws:
NamingException
- if the naming fails.
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.
- Parameters:
name
- the name of the object being searched in this context
- Returns:
- the named object
- Throws:
NamingException
- if the naming fails.
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.
- Parameters:
name
- the name of the object that may be a link, leading to another object.
- Returns:
- the named object, not following the terminal link (if present).
- Throws:
NamingException
-
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.
- Parameters:
name
- the name of the object that may be a link, leading to another object.
- Returns:
- the named object, not following the terminal link (if present).
- Throws:
NamingException
-
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.
- Parameters:
name
- the name that will be given to the object (in the scope of this context).obj
- the object being named.
- Throws:
NamingException
- if the naming operation has failed due other reasons.
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.
- Parameters:
name
- the name that will be given to the object (in the scope of this context).obj
- the object being named.
- Throws:
NamingException
- if the naming operation has failed due other reasons.
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.
- Parameters:
propName
- the name of the property being removed.
- Returns:
- the value of the property that has been removed or null if the property was not defined.
- Throws:
NamingException
-
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.
- Parameters:
oldName
- the existing name of the known objectnewName
- the new name of the same object
- Throws:
NamingException
- if the naming operation has failed due other reasons.
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.
- Parameters:
oldName
- the existing name of the known objectnewName
- the new name of the same object
- Throws:
NamingException
- if the naming operation has failed due other reasons.
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 throwsNameNotFoundException
if one of the intermadiate contexts does not exist.
- Parameters:
name
- the name to be removed
- Throws:
NamingException
- if the naming operation has failed due other reasons.
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 throwsNameNotFoundException
if one of the intermadiate contexts does not exist.
- Parameters:
name
- the name to be removed
- Throws:
NamingException
- if the naming operation has failed due other reasons.