The Community OpenORB Naming Services

Marina Wood


Table of Contents

Preface
1. Introduction
Overview
Dependencies
2. How to compile the OpenORB Interoperable Naming Service
How to download OpenORB INS
How to compile OpenORB INS
Update your CLASSPATH environment variable
3. How to configure the Interoperable Naming Service
OpenORB Configuration for the Interoperable Naming Service
How to complete the configuration?
Source code distribution
Pre built distribution
How to start the Interoperable Naming Service
Persistence
The Shutdown flag
4. Some words about the Naming Context Interfaces
The CosNaming module
Naming Context
NamingContextExt
BindingIterator
5. How to launch and use the INS example
How to launch the example
Using the example application
6. How to use the Naming Service Plugin
How to install the plugin
How to launch the plugin
How to use the Naming Service Plugin
7. FAQ
8. Interoperable Naming Service License

Preface

This document provides information on installation, configuration, and use of the Community OpenORB Naming Services.

For any comments or questions about this documentation and the Community OpenORB, please send an email to the Community OpenORB mailing list <openorb-devel@lists.sourceforge.net>.

Contributions to this document would really be appreciated.

Chapter 1. Introduction

Table of Contents

Overview
Dependencies

This document describes how to install, run and test the two naming services that are part of the OpenORB NamingService distribution: the Interoperable Naming Service (INS) and the TransientNamingService (TNS) .

Overview

The OpenORB Interoperable Naming Service (INS) is a fully compliant implementation of the Interoperable Naming Service specified by O.M.G. The persistence of this naming service is managed by the OpenORB Persistent State Service. That allows you to persist objects into a file or a database. The main purpose of the Naming Service is to organize CORBA Objects into a naming graph. Each object in the naming graph is called a name binding. A name binding is always defined relative to a naming context. A naming context is a node that contains a set of name bindings in which each name is unique.

Dependencies

To use the Transient Naming Service, you need the OpenORB kernel; to use the Interoperable Naming Service, you need the OpenORB kernel and the OpenORB Persistent State Service. You can find both modules at http://openorb.sourceforge.net in the Download section.

Chapter 2. How to compile the OpenORB Interoperable Naming Service

This chapter explains how to install the OpenORB Interoperable Naming Service. We remind you that OpenORB kernel and the OpenORB Persistent State Service are required and must be previously installed before proceeding to the next steps.

How to download OpenORB INS

To get the OpenORB Interoperable Naming Service, visit the OpenORB web site (www.openorb.org). Then, go to the download section. Follow the instructions to download the Interoperable Naming Service.

How to compile OpenORB INS

The Interoperable Naming Service distribution contains an Ant script. Several dependances are required: The OpenORB kernel distribution , the Persistent State Service distribution and the Transaction Service distribution. You need to add to your classpath those distributions (this includes openorb-{version}.jar, openorb_tools-{version}.jar, openorb_pss-{version}.jar and openorb_ots-{version}.jar files). We advise you to use the build.bat (for windows) or build.sh (for unix).

Then, to compile the OpenORB Interoperable Naming Service, enter the following command from the command line from the root directory NamingService that you got when downloading the service:

build or sh build.sh

Update your CLASSPATH environment variable

After building the Interoperable Naming Service module, you will find the openorb_ins-{version}.jar and the examples-{version}.jar files in the dist directory. Put both in your classpath before continuing.

Chapter 3. How to configure the Interoperable Naming Service

OpenORB Configuration for the Interoperable Naming Service

The initial reference of the Naming Service is required to initialize the service. You may modify the OpenORB.xml file to configure the initial reference:

        <module name="InitRef">
          <property name="NameService"
            value="corbaloc://1.2@host:port/NameService" />
        </module>
      

The OpenORB.xml, as shipped, contains this text definining the initial reference. The value attribute holds the location of the Name Service, and may be specified by a corbaloc, corbaname, or IOR. To use the corbaloc above, replace the literals host and port with the appropriate values.

To get the Naming Service initial reference, use the resolve_initial_reference method to look up "NameService".

How to complete the configuration?

To complete the configuration, we have to replace the embedded configuration of OpenORB by the new one. The way to do that depends on the distribution that you are currently using: source code or pre-built distribution. The following paragraphs describes how to proceed for each kind of distribution.

Source code distribution

In that case, an Ant target is provided to replace the embedded configuration file. From the command line, run:

          build config
        
in the OpenORB directory.

Note

The new configuration file must be available in the src/config directory. Moreover, the Jar file where the configuration will be output must be available in the dist directory.

Pre built distribution

In that case, the config directory of OpenORB contains a script named setConfig (setConfig.bat for Windows and setConfig.sh for Unix). We have just to start this script to replace the embedded configuration file.

Note

The new configuration file must be available in the config directory of the OpenORB distribution. Moreover, the Jar file where the configuration will be output must be available in the lib directory.

How to start the Interoperable Naming Service

Here is the command line that will start the Interoperable Naming Service:

        java org.openorb.ins.Server -default ( or -ORBPort=portNumber ) 
      

When you start the OpenORB Naming Service, you can

  • Use the default port number with the -default flag,
  • or specify a port number with -ORBPort=port.

If you start the OpenORB Naming Service with a specific port number, you have to specify it in the initial reference of the NameService configuration in your OpenORB.xml file.

        <property name="NameService"
            value="corbaloc://1.2@host:port/NameService" />
      

Persistence

Notice that you can persist your data by specifying the flag -file or -database when launching the Naming Service. We remind you that such persistence is managed by the OpenORB Persistent State Service. That means you must have configured your OpenORB.xml file: you must have at least a module mamed "pss". For more information about the installation and configuration of the Persistent State Service, refer to the documentation that is delivered with the distribution of that service.

The Shutdown flag

You may want to shutdown the Naming Service from a distant host or from an application.

The OpenORB Naming Service allows you to do that by specifying a -shutdown flag when launching the Naming Service. Using this flag, if you invoke the destroy method on the root node (this is not permitted otherwise), you will shutdown the Naming Service.

Chapter 4. Some words about the Naming Context Interfaces

The CosNaming module

The CosNaming module is a set of interfaces that define the Naming Service. It contains three interfaces:

  • The NamingContext interface

  • The BindingIterator interface

  • The NamingContextExt interface

Naming Context

The Naming Context interface provides a NameComponent description and a Binding description. A NameComponent consists of two attributes: the identifier attribute, id and the kind attribute, kind. A Binding contains a Name and a BindingType.

The Naming Service supports four operations to create Bindings:

  • bind

  • rebind

  • bind_context

  • rebind_context

This interface also provides operations for resolving names, unbinding names, deleting contexts and listing a Naming Context.

NamingContextExt

This interface has been introduced for the Interoperable Name Service. This interface extends NamingContext and provides several new methods to manage CORBA URL.

BindingIterator

The BindingIterator interface allows a client to iterate through the bindings using the next_one or next_n operations.

For more information of how to use those interfaces, refer to the Api documentation of this Naming Service.

Chapter 5. How to launch and use the INS example

The Interoperable Naming Service example is a full example that may show you how to develop your applications within such a Naming Service.

How to launch the example

When you run a build on the Naming Service module, the examples-{version}.jar is created in the dist directory.

To launch the example, you just have to launch the Client class after the Naming Service itself.

          java org.openorb.ins.examples.Client
        

Using the example application

When launching the example, you will see a menu that allows you to:

            0- Quit the example application
            1- Bind a new Naming Context
            2- Rebind a Naming Context
            3- Bind a Naming Object
            4- Rebind a Naming Object
            5- Resolve a Binding
            6- Unbind a Binding
            7- List all the Bindings
          

All those actions will be applied on the initial context of the Naming Service.

This example was developed to show how easily you can develop your applications using this Interoperable Naming Service.

However, we give you the possibility to explore and execute such actions in a graphical interface you can plug into our OpenORB Management Board.

For more information about the Interoperable Naming Service Plugin, see the next chapter.

Chapter 6. How to use the Naming Service Plugin

The Naming Service Plugin was developed in order to be used by the Management Board graphical interface. It represents an independent part of the Naming Service module.

How to install the plugin

The INS Plugin requires the ManagementBoard distribution. For more information concerning that module, refer to the documentation which is delivered with the ManagementBoard packaging.

You can download the ManagementBoard module on the OpenORB web site. You need to put the openorb_board-{version}.jar file in your CLASSPATH environment variable.

Once you have downloaded that module, you can build the INS Plugin application with the Ant tool. From the NamingService directory, run build plugin or sh build.sh plugin to build the INS Plugin.

You will then find a insplugin-{version}.jar file in the dist directory. Add it to your CLASSPATH environment variable.

You also have to update the board.xml file provided by the ManagementBoard to specify that you want to start the Board with the INS Plugin. When editing your OpenORB.xml file, add the following information in the board module.

        <property name="namingPluginClass"
            value="org.openorb.ins.plugin.Plugin"/>
        <property name="namingPluginPath"
            value="<PATH>/insplugin-{version}.jar"/>
        <property name="namingPluginHelp"
            value=""/>
      

For more information about such a configuration, refer to the ManagementBoard documentation.

How to launch the plugin

After you have installed and configured the Management Board as explained above, you can now launch it by using this command line:

        java org.openorb.board.Board -ORBProfile=xxx
      

where xxx is the board profile that imports the board module.

How to use the Naming Service Plugin

Here is the graphical interface from which you can display and use the Naming Service.

To connect a specific Naming Service, click on the Connect... button on this interface. A dialog box will appear enabling you to specify where the Naming Service is running.

You have two possibilities. The first one is to use initial references. In this case, you do not need to fill in the text fields below. The connection will be done reading the OpenORB configuration file. Otherwise, you can use corbaloc reference. In that case, you have to specify the host and the port number of the system where the Naming Service is running.

This plugin allows you to execute all the operations provided by the Naming Service. You can bind, rebind, bind a Naming Context or a Naming Object and explore all Bindings in a hierarchical way (on a graphical tree representation)

Chapter 7. FAQ

7.1. I get a CannotProceed Exception in rebind_context.
7.1.

I get a CannotProceed Exception in rebind_context.

If you get the following stack trace:

              org.omg.CosNaming.NamingContextPackage.CannotProceed:
                  IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0
              at org.omg.CosNaming.NamingContextPackage.CannotProceedHelper.read
                  (CannotProceedHelper.java:105)
              at org.omg.CosNaming._NamingContextStub.rebind_context
                  (_NamingContextStub.java:266)
              at org.openorb.ins.plugin.Plugin.rebindContext(Plugin.java:791)
            
it probably means you tried to rebind a Naming Context that is already bound somewhere in your INS. If you want to bind a naming context that is already bound elsewhere, unbind it first.

Chapter 8. Interoperable Naming Service License

================================================================================ The OpenORB Community Software License, Version 1.0 ================================================================================

Copyright (C) 2002 The OpenORB Project. All rights reserved.

Redistribution and use in source and binary forms, with or without modifica- tion, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by the OpenORB Community Project (http://sourceforge.net/projects/openorb/)." together with the due credit statements listed below. Alternately, this acknowledgment and due credits may appear in the soft- ware itself, if and wherever such third-party acknowledgments normally appear.

THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MEMBERS OF THE OPENORB COMMUNITY PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This software consists of voluntary contributions made by many individuals to the OpenORB Community Project. For more information on the OpenORB Community Project, please refer to http://sourceforge.net/projects/openorb/.

================================================================================ Due Credits ================================================================================

This product includes software developed by the Apache Software Foundation (http://www.apache.org/), including the Avalon Framework, Avalon Logkit, and related Excalibur utilities. Due credit to the Apache Software Foundation is hereby acknowledged.

This product is derived from initial works published under the Exolab Group, (http://www.exolab.org/). Due credit to the Exolab Group is hereby acknow- ledged. Parts of this software are derived from and subject to the terms of the Exolab license. A copy of the Exolab license is contained in respective distributions.