The Community OpenORB Naming Services

Marina Wood


Table of Contents

Preface
1. Introduction
2. Overview
Dependencies
3. How to compile the OpenORB Naming Service
How to download OpenORB Naming Service
How to compile OpenORB Naming Service
Update your CLASSPATH environment variable
4. Installation
5. Configuration
OpenORB Configuration for the Interoperable Naming Service
6. Launching the Naming Service
Launch Scripts
Persistence
The ShutdownRoot flag
7. The Example Application
The CosNaming module
Naming Context
NamingContextExt
BindingIterator
Launching the example application
Using the example application
8. FAQ
9. 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 .

Contributions to this document would really be appreciated.

Chapter 1. Introduction

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) .

Chapter 2. Overview

Table of Contents

Dependencies

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 3. How to compile the OpenORB Naming Service

This chapter explains how to install the OpenORB 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 Naming Service

To get the OpenORB Naming Service, visit the OpenORB web site (openorb.sf.net). Then, go to the downloads section. Follow the instructions to download the NamingService distribution archive.

How to compile OpenORB Naming Service

The Interoperable Naming Service distribution contains an Ant script. Several dependencies 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 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 lib directory. Put both in your classpath before continuing.

Chapter 4. Installation

Chapter 5. Configuration

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 defining 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".

Chapter 6. Launching the Naming Service

Launch Scripts

The bin directory of the NamingService distribution contains launch scripts for both Unix and Windows. Here is the command line that will start the Interoperable Naming Service (use tns instead of ins for the Transient NamingService):

ins -ORBPort=port
      

When you start the OpenORB Naming Service, you can either

  • Use the default port number (683) with the --default flag (note that many operating systems only allow this if you have administrator permissions)
  • 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" />
      

Each launch script supports a number of options. All available options can be displayed using the --help option. A few parameters of the ins will be explained in the next sections.

Persistence

When using the ins you can persist your data by specifying the --persistenceType type option when launching the Naming Service. The default type is memory persistence, but you can specify file or database as well.

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 ShutdownRoot 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 --shutdownRoot 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 7. The Example Application

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.

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

Launching the example application

When you run a build.[bat|sh] jar-examples on the Naming Service module, the openorb_ns_examples-{version}.jar is created in the lib directory.

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

java org.openorb.ns.examples.person.Client
        
You can also run the example client with the ORB that is provided with JDK 1.4 and later, using the following commandline (on one line and without the usual openorb classpath settings):
java -classpath openorb_ns_examples-{version}.jar
  org.openorb.ns.examples.person.Client
  -ORBInitRef NameService=corbaloc://1.2@host:port/NameService
        
Use the host same port as in the -ORBPort command line parameter when you started the ins.

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 8. FAQ

8.1. I get a CannotProceed Exception in rebind_context.
8.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 9. 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 acknowledged. 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.