Class CNCtx
- java.lang.Object
-
- org.wildfly.iiop.openjdk.naming.jndi.CNCtx
-
-
Field Summary
Fields Modifier and Type Field Description org.omg.CosNaming.NamingContext_nc-
Fields inherited from interface javax.naming.Context
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectaddToEnvironment(String propName, Object propValue)Adds to the environment for the current context.voidbind(String name, Object obj)Converts the "String" name into a CompositeName object and performs the bind operation.voidbind(Name name, Object obj)Converts the "Name" name into a NameComponent[] object and performs the bind operation.voidclose()StringcomposeName(String name, String prefix)NamecomposeName(Name name, Name prefix)ContextcreateSubcontext(String name)Uses the callBindNewContext convenience function to create a new context.ContextcreateSubcontext(Name name)Uses the callBindNewContext convenience function to create a new context.static ResolveResultcreateUsingURL(String url, Hashtable env)This method is used by the iiop and iiopname URL Context factories.voiddestroySubcontext(String name)Uses the callDestroy function to destroy the context.voiddestroySubcontext(Name name)Uses the callDestroy function to destroy the context.protected voidfinalize()HashtablegetEnvironment()Returns the current environment.StringgetNameInNamespace()NameParsergetNameParser(String name)Allow access to the name parser object.NameParsergetNameParser(Name name)Allow access to the name parser object.NamingEnumerationlist(String name)Returns a NameClassEnumeration object which has a list of name class pairs.NamingEnumerationlist(Name name)Returns a NameClassEnumeration object which has a list of name class pairs.NamingEnumerationlistBindings(String name)Returns a BindingEnumeration object which has a list of name object pairs.NamingEnumerationlistBindings(Name name)Returns a BindingEnumeration object which has a list of name class pairs.Objectlookup(String name)Converts the "String" name into a CompositeName returns the object resolved by the COS Naming api, resolve.Objectlookup(Name name)Converts the "Name" name into a NameComponent[] object and returns the object resolved by the COS Naming api, resolve.ObjectlookupLink(String name)Is mapped to resolve in the COS Naming api.ObjectlookupLink(Name name)Is mapped to resolve in the COS Naming api.voidrebind(String name, Object obj)Converts the "String" name into a CompositeName object and performs the rebind operation.voidrebind(Name name, Object obj)Converts the "Name" name into a NameComponent[] object and performs the rebind operation.ObjectremoveFromEnvironment(String propName)voidrename(String oldName, String newName)Renames an object.voidrename(Name oldName, Name newName)Renames an object.voidunbind(String name)Converts the "String" name into a CompositeName object and performs the unbind operation.voidunbind(Name name)Converts the "Name" name into a NameComponent[] object and performs the unbind operation.
-
-
-
Method Detail
-
createUsingURL
public static ResolveResult createUsingURL(String url, Hashtable env) throws NamingException
This method is used by the iiop and iiopname URL Context factories.- Throws:
NamingException
-
getNameInNamespace
public String getNameInNamespace() throws NamingException
- Specified by:
getNameInNamespacein interfaceContext- Throws:
NamingException
-
lookup
public Object lookup(String name) throws NamingException
Converts the "String" name into a CompositeName returns the object resolved by the COS Naming api, resolve. Returns the current context if the name is empty. Returns either an org.omg.CORBA.Object or javax.naming.Context object.- Specified by:
lookupin interfaceContext- Parameters:
name- string used to resolve the object.- Returns:
- the resolved object
- Throws:
NamingException- See callResolve.
-
lookup
public Object lookup(Name name) throws NamingException
Converts the "Name" name into a NameComponent[] object and returns the object resolved by the COS Naming api, resolve. Returns the current context if the name is empty. Returns either an org.omg.CORBA.Object or javax.naming.Context object.- Specified by:
lookupin interfaceContext- Parameters:
name- JNDI Name used to resolve the object.- Returns:
- the resolved object
- Throws:
NamingException- See callResolve.
-
bind
public void bind(Name name, Object obj) throws NamingException
Converts the "Name" name into a NameComponent[] object and performs the bind operation. Uses callBindOrRebind. Throws an invalid name exception if the name is empty. We need a name to bind the object even when we work within the current context.- Specified by:
bindin interfaceContext- Parameters:
name- JNDI Name objectobj- Object to be bound.- Throws:
NamingException- See callBindOrRebind
-
bind
public void bind(String name, Object obj) throws NamingException
Converts the "String" name into a CompositeName object and performs the bind operation. Uses callBindOrRebind. Throws an invalid name exception if the name is empty.- Specified by:
bindin interfaceContext- Parameters:
name- stringobj- Object to be bound.- Throws:
NamingException- See callBindOrRebind
-
rebind
public void rebind(Name name, Object obj) throws NamingException
Converts the "Name" name into a NameComponent[] object and performs the rebind operation. Uses callBindOrRebind. Throws an invalid name exception if the name is empty. We must have a name to rebind the object to even if we are working within the current context.- Specified by:
rebindin interfaceContext- Parameters:
name- stringobj- Object to be bound.- Throws:
NamingException- See callBindOrRebind
-
rebind
public void rebind(String name, Object obj) throws NamingException
Converts the "String" name into a CompositeName object and performs the rebind operation. Uses callBindOrRebind. Throws an invalid name exception if the name is an empty string.- Specified by:
rebindin interfaceContext- Parameters:
name- stringobj- Object to be bound.- Throws:
NamingException- See callBindOrRebind
-
unbind
public void unbind(String name) throws NamingException
Converts the "String" name into a CompositeName object and performs the unbind operation. Uses callUnbind. If the name is empty, throws an invalid name exception. Do we unbind the current context (JNDI spec says work with the current context if the name is empty) ?- Specified by:
unbindin interfaceContext- Parameters:
name- string- Throws:
NamingException- See callUnbind
-
unbind
public void unbind(Name name) throws NamingException
Converts the "Name" name into a NameComponent[] object and performs the unbind operation. Uses callUnbind. Throws an invalid name exception if the name is empty.- Specified by:
unbindin interfaceContext- Parameters:
name- string- Throws:
NamingException- See callUnbind
-
rename
public void rename(String oldName, String newName) throws NamingException
Renames an object. Since COS Naming does not support a rename api, this method unbinds the object with the "oldName" and creates a new binding.- Specified by:
renamein interfaceContext- Parameters:
oldName- string, existing name for the binding.newName- string, name used to replace.- Throws:
NamingException- See bind
-
rename
public void rename(Name oldName, Name newName) throws NamingException
Renames an object. Since COS Naming does not support a rename api, this method unbinds the object with the "oldName" and creates a new binding.- Specified by:
renamein interfaceContext- Parameters:
oldName- JNDI Name, existing name for the binding.newName- JNDI Name, name used to replace.- Throws:
NamingException- See bind
-
list
public NamingEnumeration list(String name) throws NamingException
Returns a NameClassEnumeration object which has a list of name class pairs. Lists the current context if the name is empty.- Specified by:
listin interfaceContext- Parameters:
name- string- Returns:
- a list of name-class objects as a NameClassEnumeration.
- Throws:
NamingException- All exceptions thrown by lookup with a non-null argument
-
list
public NamingEnumeration list(Name name) throws NamingException
Returns a NameClassEnumeration object which has a list of name class pairs. Lists the current context if the name is empty.- Specified by:
listin interfaceContext- Parameters:
name- JNDI Name- Returns:
- a list of name-class objects as a NameClassEnumeration.
- Throws:
NamingException- All exceptions thrown by lookup
-
listBindings
public NamingEnumeration listBindings(String name) throws NamingException
Returns a BindingEnumeration object which has a list of name object pairs. Lists the current context if the name is empty.- Specified by:
listBindingsin interfaceContext- Parameters:
name- string- Returns:
- a list of bindings as a BindingEnumeration.
- Throws:
NamingException- all exceptions returned by lookup
-
listBindings
public NamingEnumeration listBindings(Name name) throws NamingException
Returns a BindingEnumeration object which has a list of name class pairs. Lists the current context if the name is empty.- Specified by:
listBindingsin interfaceContext- Parameters:
name- JNDI Name- Returns:
- a list of bindings as a BindingEnumeration.
- Throws:
NamingException- all exceptions returned by lookup.
-
destroySubcontext
public void destroySubcontext(String name) throws NamingException
Uses the callDestroy function to destroy the context. If name is empty destroys the current context.- Specified by:
destroySubcontextin interfaceContext- Parameters:
name- string- Throws:
OperationNotSupportedException- when list is invoked with a non-null argumentNamingException
-
destroySubcontext
public void destroySubcontext(Name name) throws NamingException
Uses the callDestroy function to destroy the context. Destroys the current context if name is empty.- Specified by:
destroySubcontextin interfaceContext- Parameters:
name- JNDI Name- Throws:
OperationNotSupportedException- when list is invoked with a non-null argumentNamingException
-
createSubcontext
public Context createSubcontext(String name) throws NamingException
Uses the callBindNewContext convenience function to create a new context. Throws an invalid name exception if the name is empty.- Specified by:
createSubcontextin interfaceContext- Parameters:
name- string- Returns:
- the new context object.
- Throws:
NamingException- See callBindNewContext
-
createSubcontext
public Context createSubcontext(Name name) throws NamingException
Uses the callBindNewContext convenience function to create a new context. Throws an invalid name exception if the name is empty.- Specified by:
createSubcontextin interfaceContext- Parameters:
name- string- Returns:
- the new context object.
- Throws:
NamingException- See callBindNewContext
-
lookupLink
public Object lookupLink(String name) throws NamingException
Is mapped to resolve in the COS Naming api.- Specified by:
lookupLinkin interfaceContext- Parameters:
name- string- Returns:
- the resolved object.
- Throws:
NamingException- See lookup.
-
lookupLink
public Object lookupLink(Name name) throws NamingException
Is mapped to resolve in the COS Naming api.- Specified by:
lookupLinkin interfaceContext- Parameters:
name- string- Returns:
- the resolved object.
- Throws:
NamingException- See lookup.
-
getNameParser
public NameParser getNameParser(String name) throws NamingException
Allow access to the name parser object.- Specified by:
getNameParserin interfaceContext- Parameters:
name- , is ignored since there is only one Name Parser object.- Returns:
- NameParser object
- Throws:
NamingException- --
-
getNameParser
public NameParser getNameParser(Name name) throws NamingException
Allow access to the name parser object.- Specified by:
getNameParserin interfaceContext- Parameters:
name- JNDI name, is ignored since there is only one Name Parser object.- Returns:
- NameParser object
- Throws:
NamingException- --
-
getEnvironment
public Hashtable getEnvironment() throws NamingException
Returns the current environment.- Specified by:
getEnvironmentin interfaceContext- Returns:
- Environment.
- Throws:
NamingException
-
composeName
public String composeName(String name, String prefix) throws NamingException
- Specified by:
composeNamein interfaceContext- Throws:
NamingException
-
composeName
public Name composeName(Name name, Name prefix) throws NamingException
- Specified by:
composeNamein interfaceContext- Throws:
NamingException
-
addToEnvironment
public Object addToEnvironment(String propName, Object propValue) throws NamingException
Adds to the environment for the current context. Record change but do not reinitialize ORB.- Specified by:
addToEnvironmentin interfaceContext- Parameters:
propName- The property name.propValue- The ORB.- Returns:
- the previous value of this property if any.
- Throws:
NamingException
-
removeFromEnvironment
public Object removeFromEnvironment(String propName) throws NamingException
- Specified by:
removeFromEnvironmentin interfaceContext- Throws:
NamingException
-
close
public void close() throws NamingException- Specified by:
closein interfaceContext- Throws:
NamingException
-
-