Class CNCtx
java.lang.Object
org.wildfly.iiop.openjdk.naming.jndi.CNCtx
- All Implemented Interfaces:
Context
Provides a bridge to the CosNaming server provided by
JavaIDL. This class provides the InitialContext from CosNaming.
- Author:
- Raj Krishnamurthy, Rosanna Lee
-
Field Summary
FieldsFields 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
Modifier and TypeMethodDescriptionaddToEnvironment(String propName, Object propValue) Adds to the environment for the current context.voidConverts the "String" name into a CompositeName object and performs the bind operation.voidConverts the "Name" name into a NameComponent[] object and performs the bind operation.voidclose()composeName(String name, String prefix) composeName(Name name, Name prefix) createSubcontext(String name) Uses the callBindNewContext convenience function to create a new context.createSubcontext(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()Returns the current environment.getNameParser(String name) Allow access to the name parser object.getNameParser(Name name) Allow access to the name parser object.Returns a NameClassEnumeration object which has a list of name class pairs.Returns a NameClassEnumeration object which has a list of name class pairs.listBindings(String name) Returns a BindingEnumeration object which has a list of name object pairs.listBindings(Name name) Returns a BindingEnumeration object which has a list of name class pairs.Converts the "String" name into a CompositeName returns the object resolved by the COS Naming api, resolve.Converts the "Name" name into a NameComponent[] object and returns the object resolved by the COS Naming api, resolve.lookupLink(String name) Is mapped to resolve in the COS Naming api.lookupLink(Name name) Is mapped to resolve in the COS Naming api.voidConverts the "String" name into a CompositeName object and performs the rebind operation.voidConverts the "Name" name into a NameComponent[] object and performs the rebind operation.removeFromEnvironment(String propName) voidRenames an object.voidRenames an object.voidConverts the "String" name into a CompositeName object and performs the unbind operation.voidConverts the "Name" name into a NameComponent[] object and performs the unbind operation.
-
Field Details
-
_nc
public org.omg.CosNaming.NamingContext _nc
-
-
Method Details
-
createUsingURL
This method is used by the iiop and iiopname URL Context factories.- Throws:
NamingException
-
getNameInNamespace
- Specified by:
getNameInNamespacein interfaceContext- Throws:
NamingException
-
lookup
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Returns the current environment.- Specified by:
getEnvironmentin interfaceContext- Returns:
- Environment.
- Throws:
NamingException
-
composeName
- Specified by:
composeNamein interfaceContext- Throws:
NamingException
-
composeName
- Specified by:
composeNamein interfaceContext- Throws:
NamingException
-
addToEnvironment
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
- Specified by:
removeFromEnvironmentin interfaceContext- Throws:
NamingException
-
close
- Specified by:
closein interfaceContext- Throws:
NamingException
-
finalize
protected void finalize()
-