org.objectweb.mobilitools.util.corba
Class NSbinder

java.lang.Object
  |
  +--org.objectweb.mobilitools.util.corba.NSbinder

public class NSbinder
extends java.lang.Object

MobiliTools $Name: $, $Id: NSbinder.java,v 1.1.1.1 2003/03/28 14:48:06 dillense Exp $

Tool for making automatic bindings in CORBA naming service. The input can be a property file, an XML file, or Java properties. Binding names must be given according to "id!kind/.../id!kind" format. A binding object may be given as a stringified IOR, as a file containing a stringified IOR, or as a URL containing a stringified IOR.


Constructor Summary
NSbinder()
          Creates a new name service binder utility, using default/singleton ORB object.
NSbinder(org.omg.CORBA.ORB orb)
          Creates a new name service binder utility, using the provided ORB object.
 
Method Summary
 void bind(java.util.Properties props)
          Performs CORBA name service bindings specified by the provided properties.
 void bindFromPropFile(java.lang.String file)
          Parses the specified property file in order to make the specified bindings.
 void bindFromXMLFile(java.lang.String file)
          Parses the specified XML file in order to make the specified bindings.
static void main(java.lang.String[] args)
          Parses a property file or an xml file describing a set of CORBA name service bindings to do.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NSbinder

public NSbinder()
         throws NameServiceException
Creates a new name service binder utility, using default/singleton ORB object.
Throws:
NameServiceException - if no valid initial reference to a naming service could be obtained.

NSbinder

public NSbinder(org.omg.CORBA.ORB orb)
         throws NameServiceException
Creates a new name service binder utility, using the provided ORB object.
Parameters:
orb - the ORB object to use.
Throws:
NameServiceException - if no valid initial reference to a naming service could be obtained.
Method Detail

main

public static void main(java.lang.String[] args)
Parses a property file or an xml file describing a set of CORBA name service bindings to do.
Parameters:
args - shall contain ORB-specific switches first, and then either -xml xml_file or -prop property_file switch.
See Also:
bindFromXMLFile(String), bindFromPropFile(String)

bindFromXMLFile

public void bindFromXMLFile(java.lang.String file)
                     throws java.lang.Exception
Parses the specified XML file in order to make the specified bindings. This file should contain only bind tags, with the following attributes:
Parameters:
file - the name of the XML file to be parsed.
Throws:
java.lang.Exception - a variety of exceptions if a parsing error occurs, because of an invalid file format (check the XML content)

bindFromPropFile

public void bindFromPropFile(java.lang.String file)
                      throws java.io.IOException
Parses the specified property file in order to make the specified bindings.
Parameters:
file - the name of the property file to be parsed.
Throws:
java.io.IOException - if the specified file could not be read.
See Also:
bind(Properties)

bind

public void bind(java.util.Properties props)
Performs CORBA name service bindings specified by the provided properties. Properties are: Where n increments from 1 and stops as soon as property name.n is undefined. If no URL, file or IOR is specified for a name, then the name is bound to a new naming context.