•
•
• cns CLOPT="[-A] [servopts options] --
[-b bucketcount]
[-c]
[-d]
[-f filename]
[-M maxiterators]
[-p [persiststoragefilename] ]"The server process for the CORBA Name Service provides a CORBA CosNaming compliant name service. You need to define the server process for the CORBA Name Service and its options in the UBBCONFIG file for your Oracle Tuxedo application as you do any other server process used by your Oracle Tuxedo application. Enter the cns command-line options after the double dash (--) in the CLOPT parameter of the UBBCONFIG file. The command-line options are as follows:-b bucketcountCompresses the persistent storage file when the server process for the CORBA Name Service starts. Over time the persistent storage file can grow in size as naming context and application objects are added and removed from the namespace. Compression reduces the size of the persistent storage file to a minimum. Dangling bindings are removed during compression. Dangling bindings are left in the namespace after the object the binding is associated with is deleted from the namespace. The -p command-line option must be specified when specifying the -c command-line option.Directs the server process for the CORBA Name Service to delete orphan contexts when the server process starts. An orphan context is a context that is not bound to any other context. It may never have been bound or it may have been bound to a context and the binding was destroyed either explicitly or as a side-effect of a rebind. The -p command-line option must be specified when specifying the -d command-line option.-f filename-M maxiteratorsBinding iterators are created when a client application uses the CosNaming::NamingContext::list()method. The client application should use the CosNaming::BindingIterator::destroy()method to delete a binding iterator when the client application is done using the binding iterator.If a client application does not specifically delete binding iterators, the server process for the CORBA Name Service deletes the binding iterators when the number reaches the value specified in the -M command-line option. Once the maximum number of binding iterators is reached, any attempt to create a new binding iterator causes the server process for the CORBA Name Service to destroy a binding iterator currently in use by the client application.Binding iterators are deleted using a least-recently-used algorithm. The default value is 20. A value of 0 indicates that there is no maximum number of binding iterators (meaning binding interators are never destroyed by the server process for the CORBA Name Service and the associated memory is not released). If a value of 0 is specified, the client application must explicitly use the CosNaming::BindingIterator::destroy() method to delete outstanding binding iterators.Directs the server process for the CORBA Name Service to save a copy of the current namespace to persistent storage using the specified file. If a filename is not specified, the value of the CNS_PERSIST_FILE environment variable is used. If the CNS_PERSIST_FILE environment variable is not set, the following files are used:
Note: The cnsbind command interacts with the CosNaming interfaces. The server process for the CORBA Name Service must be running to use this command.The cnsbind command binds new application and naming context objects into the namespace using the CORBA CosNaming interfaces. This command facilitates the creation of a federated namespace. If an exception is returned when the cnsbind command is invoked, the command exits and an appropriate message is displayed.The command-line options for the cnsbind command are as follows:Specifies that the cnsbind command creates a context using the bind_name for the name and the ior_filename specified for the -o command-line option. The -C command-line option is used to federate a naming context object from one namespace into the specified namespace.-f root_context_filenameSpecifies the file containing the IOR of the server process for the CORBA Name Service with which the command interacts to modify the contents of the namespace. If this command-line option is not specified, the command uses the Tobj_Bootstrap::resolve_initial_references() method with the NameService environmental object to locate the server process for the CORBA Name Service in the specified Oracle Tuxedo domain. The host and port in the IOR must match the value of TOBJADDR. This command-line option overrides the setting for the TOBJADDR environment variable. If the command-line option is not specified, the TOBJADDR environment variable is used.Creates a new context and binds the new context into the namespace using the specified name. The -o command-line option is not needed with the -N command-line option because the cnsbind command is creating a new context. If the -o command-line option is used with the -N command-line option, the information from the -o command-line option is ignored.-o ior_filenameSpecifies a file that contains the IOR of the object to be bound into the namespace specified via the -f command-line option. If the -C command-line option is specified, an object of type ncontext is created otherwise a object of type nobject is created.Creates a binding for an application or naming context object even if the name already has a binding. The default behavior of the cnsbind command without the -r command-line option is to raise the AlreadyBound exception in the case where a binding for the specified object already exists. If an AlreadyBound or any other exception is returned when the cnsbind command is invoked, the command exits and an “Error, already bound” message is displayed.Specifies the host and port for an Oracle Tuxedo domain. Before connecting to a server process for the CORBA Name Service, the cnsbind command must log into the Oracle Tuxedo domain in which the server process is running. This command-line option overrides the setting for the TOBJADDR environment variable. If the command-line option is not specified, the value of the TOBJADDR environment variable is used. If the command-line option is not specified and TOBJADDR is not set, the program will run as a native client and load the TGIOP protocol.Specifies the name to be bound to the application object or name context object added to the namespace relative to either the root naming context retrieved from the Tobj_Bootstrap::resolve_initial_references method, or the naming context identified by the stringified IOR obtained from the -f command-line option. The bind_name string should conform to the name string form specified in the Object Management Group (OMG) Interoperable Name Service (INS) specification.
Note: The cnsls command interacts with the CosNaming interfaces. The server process for the CORBA Name Service must be running to use this command.The cnsls command displays the contents of the namespace using the CORBA CosNaming interfaces. If non-printing characters are used as part of a NameComponent data structure, the behavior of the cnsls command is undefined. If an exception is returned when the cnsls command is invoked, the command exits and an appropriate message is displayed.The command-line options for the cnsls command are as follows:-f root_context_filenameSpecifies the file containing the IOR of the server process for the CORBA Name Service with which the command interacts to modify the contents of the namespace. If this command-line option is not specified, the command uses the Tobj_Bootstrap::resolve_initial_references() method with the NameService environmental object to locate the server process for the CORBA Name Service in the specified Oracle Tuxedo domain. The host and port in the IOR must match the value of TObjAddr. This command-line option overrides the setting for the TOBJADDR environment variable. If the command-line option is not specified, the value of the TOBJADDR environment variable is used.Displays the stringified IOR for the namespace name specified in resolve_name command-line option.Recursively displays namespace bindings beginning at resolve_name. This command-line option may cause the cnsls command to cross federation boundaries with no indication when such a boundary is cross. Also, if cycles exist in the namespace information, this command-line option can cause the cnsls command to enter a loop.Specifies the host and port for an Oracle Tuxedo domain. Before connecting to a server process for the CORBA Name Service, the cnsls command must log into the Oracle Tuxedo domain in which the server process is running. This command-line option overrides the setting for the TOBJADDR environment variable. If the command-line option is not specified, the TOBJADDR environment variable is used.Specifies the name to resolve in the name service relative to either the root naming context retrieved via the Tobj_Bootstrap::resolve_initial_references() method or the naming context identified by the stringified IOR obtained from the -f command-line option. The resolve_name string should conform to the name string form specified in the OMG INS specification. The backslash (\) character is used to delimit name components and the period (.) character separates the id and kind fields.The cnsubind command removes bindings from the namespace. If an exception is returned when the cnsunbind command is invoked, the command exits and an appropriate message is displayed.The cnsunbind command-line options are as follows:Destroys the naming context bound to the bind_name after removing the binding. Specifying the -D command-line option when deleting a context prevents the context from being orphaned if it is not part of another binding. This command-line option should be used with care because it can cause dangling bindings (for example, if the binding was bound to multiple naming context objects at the same time).-f root_context_filenameSpecifies the file containing the IOR of the server process for the CORBA Name Service with which the command interacts to modify the contents of the namespace. If this command-line option is not specified, the command uses the Tobj_Bootstrap::resolve_initial_references() method with the NameService environmental object to locate the server process for the specified Oracle Tuxedo domain.Specifies the host and port for an Oracle Tuxedo domain. Before connecting to a server process for the CORBA Name Service, the cnsbind command must log into the Oracle Tuxedo domain in which the server process is running. This command-line option overrides the setting for the TOBJADDR environment variable. If the command-line option is not specified, the TOBJADDR environment variable is used.Specifies the name of the binding to be removed from the namespace relative to either the root naming context retrieved via the Tobj_Bootstrap::resolve_initial_references() method or the naming context identified by the stringified IOR obtained from the -f command-line option. The bind_name string should conform to the name string form specified in the OMG INS specification.
• A NULL character must only be used to terminate the id and kind strings (empty strings are considered valid).
•
• The CORBA Name Service does not throw the CannotProceed exception.A NameService environmental object is available for connecting to the root of the namespace. When using the NameService environmental object, the Object Request Broker (ORB) locates the root of the namespace. Use the Bootstrap object or the CORBA Interoperable Naming Service (INS) bootstrapping mechanism to get an initial reference to the NameService environmental object. Use the Oracle proprietary mechanism if you are using the Oracle client ORB. Use the CORBA INS mechanism is you are using a client ORB from another vendor.For more information on connecting to the namespace, see “Step 3: Connect to the Oracle Tuxedo Namespace.” For more information about bootstrapping the Oracle Tuxedo domain see Chapter 4, “CORBA Bootstrapping Programming Reference,” in the CORBA Programming Reference in the Oracle Tuxedo online documentation.The NamingContext object is used to contain and manipulate a list of names that are bound to Object Request Broker (ORB) objects or to other NamingContext objects. Oracle Tuxedo CORBA client applications use this interface to resolve or list all the names within that context. Oracle Tuxedo CORBA server applications use this object to bind names to application objects or naming context objects. Listing 2‑1 shows the OMG IDL for the NamingContext object.Listing 2‑1 OMG IDL for the NamingContext ObjectAttempts to bind the specified object to the specified name by resolving the context associated with the first NameComponent data structure and then binding the object to the new context.A Name data structure, initialized with the desired name of the object.The Name on a bind() or a bind_context() method has already been bound to another object within the naming context.The specified Name has zero name components or one of the first name components did not resolve to a naming context.The Name or one of its components, could not be found.Naming contexts bound with bind do not participate in name resolution when compound names are passed to be resolved.This method is similar to the bind() method, except that the supplied Name is associated with a NamingContext object.A Name data structure initialized with the desired name for the naming context. The first NameComponent data structure in the sequence must resolve to a naming context.The NamingContext object to be bound to the supplied name.The Name on a bind() or a bind_context() method has already been bound to another object within the naming context.The specified Name has zero name components or one of the first name components did not resolve to a naming context.The Name or one of its components, could not be found.Indicates the call attempted to bind a NULL context.Naming contexts bound with bind_context() participate in name resolution when compound names are passed to be resolved.Creates a new context and binds it to the specified Name within this context.A Name data structure, initialized with the desired name for the newly created NamingContext object.The Name on a bind() or a bind_context() method has already been bound to another object within the naming context.The specified Name has zero name components or one of the first name components did not resolve to a naming context.The Name or one of its components could not be found.This method combines the CosNaming::NamingContext::new_context() and CosNaming::NamingContext::bind_context() methods into a single method.Returns a reference to a new NamingContext object.Deletes a NamingContext object. Any subsequent attempt to invoke methods on the NamingContext object raises a CORBA::NO_IMPLEMENT exception.Before using this method, all name objects that have been bound to the NamingContext object should be unbound using the
CosNaming::NamingContext::unbind() method.A list of returned bindings where each element is a binding containing a Name representing a single NameComponent object. Each Name is a simple name, that is, a name sequence of length 1. The number of bindings in the list does not exceed the value of how_many.A reference to a BindingIterator object for use in traversing the rest of the bindings.The specified Name has zero name components or one of the first name components did not resolve to a naming context.The Name or one of its components could not be found.This method returns a sequence of name bindings. If more name bindings exist than can fit in the bl list, a BindingIterator object is returned. The BindingIterator object can be used to get the next set of bindings. The BindingList (C++) object can return less than the requested number of bindings if it is at the end of the list. If bi returns a NULL reference, then bl contains all of the bindings.This method is similar to the bind() method. The difference is that the rebind method does not raise the AlreadyBound exception. If the specified Name has already been bound to another object, that binding is replaced by the new binding.A Name data structure, initialized with the desired name for the object.The specified Name data structure has zero name components or one of the first name components did not resolve to a naming context.The Name or one of its components, could not be found. If this exception is raised because the binding already exists or the binding is of the wrong type, the rest_of_name member of the exception has a length of 1.Naming contexts bound with the rebind()method do not participate in name resolution when compound names are passed to be resolved.This method is similar to the bind_context() method. The difference is that the rebind_context method does not raise the AlreadyBound exception. If the specified Name has already been bound to another object, that binding is replaced by the new binding.A Name data structure, initialized with the desired name for the object.The NamingContext object to be rebound.The specified Name data structure has zero name components or one of the first name components did not resolve to a naming context.The component of a name does not identify a binding or the type of binding is incorrect for the operation being performed. If this exception is raised because a binding already exists or it is of the wrong type, the rest_of_name member of the exception has a length of 1.Naming contexts bound with the rebind_context method do not participate in name resolution when compound names are passed to be resolved.A Name data structure, initialized with the desired name for the object.The specified Name data structure has zero name components or one of the first name components did not resolve to a naming context.The specified Name must exactly match the name used to bind the object. The CORBA Name Service does not return the type of the object. Client applications are responsible for narrowing the object to the appropriate type.Performs the inverse operation of the bind() method, removing the binding associated with the specified Name.A Name data structure, initialized with the desired name for the object.The specified Name data structure has zero name components or one of the first name components did not resolve to a naming context.This method removes the binding between a name and an object. It does not delete the object. Use the CosNaming::NamingContext::unbind() method and then the CosNaming::NamingContext::destroy() method to delete the object.The NamingContextExt object provides methods to use URLs and stringified names in the CORBA Name Service. The NamingContextExt object is derived from the NamingContext object. Note that the root of the CORBA Name Service is a NamingContextExt object (which means the root is also a NamingContext object). No special operation is needed to obtain a reference to a NamingContextExt object. Listing 2‑2 shows the OMG IDL for the NamingContextExt object.Listing 2‑2 OMG IDL for the NamingContextExt ObjectTakes a stringified name, converts it to a Name, and resolves it.This is a convenience method that performs a resolve in the same manner as the
CosNaming:NamingContext::resolve() method. The method accepts a stringified name as an argument instead of a Name object. The method returns errors if the stringified name is invalid or if the method cannot bind it.Takes a stringified name and returns a Name object.The stringified name to be resolved to a Name object.This method accepts a stringified name and returns a Name object. The method returns errors if the name is invalid.Returns a Name object.Accepts a Name object and returns a stringified name.The Name object to be converted to stringified nameThis method accepts a Name object and returns a stringified name. It returns errors if the name is invalid.The BindingIterator object allows a client application to walk through the unbounded collection of bindings returned by the list method of a
NamingContext object. Using the BindingIterator object, a client application can control the number of bindings obtained with each call. If a naming context is modified between calls to the methods of a BindingIterator object, the behavior of further calls to the next_one() method or the next_n() method is implementation specific.If a client application creates BindingIterator objects but never calls the destroy method, the client application can run out of resources. The CORBA Name Service is free to destroy binding iterators at any time and without warning to the client application. Client applications should be written to expect the OBJECT_NOT_EXIST exception from calls to a BindingIterator object and to handle this exception gracefully.Listing 2‑3 shows the OMG IDL for the BindingIterator object.Listing 2‑3 OMG IDL for BindingIterator ObjectDestroys the BindingIterator object and releases the memory associated with the object. Failure to call this method results in increased memory usage.If a client application invokes any operation on a BindingIterator object after calling the destroy method, the operation raises an OBJECT_NOT_EXIST exception.Returns a BindingList data structure containing the number of requested bindings from the list. The number of bindings returned may be less than the requested amount if the list is exhausted.A BindingList data structure containing no more than the requested number of bindings.Raised if the how_many parameter has a value of zero.CORBA::FALSE is returned when the list has been exhausted. Otherwise, CORBA::TRUE is returned.Returns the next Binding object in the list.The next Binding object from the list.CORBA::FALSE is returned when the list has been exhausted. Otherwise, CORBA::TRUE is returned.NamingContext cxtName rest_of_nameThis exception is raised if a Name is invalid. A name length of zero is invalid.This exception is raised when the destroy()method is used on a NamingContext object that contains bindings. A NamingContext object must be empty before it is destroyed.This exception is raised when a component of the name does not identify a binding, or if the type of binding is incorrect for the operation being performed. The why parameter explains the reason for the error. The rest_of_name parameter identifies the cause of the error. The following causes can appear:
• missing_node—the first name component in the rest_of_name parameter is a binding that is not bound under that name within its parent context.
• not_context—the first name component in the rest_of_name parameter is a binding with a type of nobject when the type of ncontext was required.
• not_object—the first name component in the rest_of_name parameter is a binding with a type of ncontext when the type of nobject was required.