org.jacorb.naming
Class NamingContextImpl

java.lang.Object
  extended byorg.omg.PortableServer.Servant
      extended byorg.omg.CosNaming.NamingContextExtPOA
          extended byorg.jacorb.naming.NamingContextImpl
All Implemented Interfaces:
InvokeHandler, NamingContextExtOperations, NamingContextOperations, java.io.Serializable

public class NamingContextImpl
extends NamingContextExtPOA
implements java.io.Serializable

The actual implementation for the CORBAService Naming

Version:
$Id: NamingContextImpl.java,v 1.22 2004/02/05 15:57:12 nick.cross Exp $
Author:
Gerald Brose, FU Berlin
See Also:
Serialized Form

Constructor Summary
NamingContextImpl()
           
 
Method Summary
 void bind_context(NameComponent[] nc, NamingContext obj)
          Bind a context to a name
 NamingContext bind_new_context(NameComponent[] nc)
           
 void bind(NameComponent[] nc, Object obj)
          bind a name (an array of name components) to an object
 POA default_POA()
          POA-related,
 void destroy()
           
 int how_many()
           
static void init(ORB orb, POA rootPoa)
          This method needs to be called once to initialize the static fields orb and rootPoa.
 void list(int how_many, BindingListHolder bl, BindingIteratorHolder bi)
          list all bindings
 NamingContext new_context()
           
 void rebind_context(NameComponent[] nc, NamingContext obj)
          Bind an context to a name that's already in use, i.e. rebind the name
 void rebind(NameComponent[] nc, Object obj)
          Bind an object to a name that's already in use, i.e. rebind the name
 Object resolve_str(java.lang.String n)
           
 Object resolve(NameComponent[] nc)
          resolve a name
 NameComponent[] to_name(java.lang.String sn)
          convert a string into name
 java.lang.String to_string(NameComponent[] n)
          convert a name into its string representation
 java.lang.String to_url(java.lang.String addr, java.lang.String sn)
           
 void unbind(NameComponent[] nc)
          unbind a name
 
Methods inherited from class org.omg.CosNaming.NamingContextExtPOA
_all_interfaces, _invoke, _this, _this
 
Methods inherited from class org.omg.PortableServer.Servant
_default_POA, _get_delegate, _get_interface_def, _get_interface, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamingContextImpl

public NamingContextImpl()
Method Detail

bind

public void bind(NameComponent[] nc,
                 Object obj)
          throws NotFound,
                 CannotProceed,
                 InvalidName,
                 AlreadyBound
bind a name (an array of name components) to an object

Specified by:
bind in interface NamingContextOperations
Throws:
NotFound
CannotProceed
InvalidName
AlreadyBound

rebind

public void rebind(NameComponent[] nc,
                   Object obj)
            throws NotFound,
                   CannotProceed,
                   InvalidName
Bind an object to a name that's already in use, i.e. rebind the name

Specified by:
rebind in interface NamingContextOperations
Throws:
NotFound
CannotProceed
InvalidName

rebind_context

public void rebind_context(NameComponent[] nc,
                           NamingContext obj)
                    throws NotFound,
                           CannotProceed,
                           InvalidName
Bind an context to a name that's already in use, i.e. rebind the name

Specified by:
rebind_context in interface NamingContextOperations
Throws:
NotFound
CannotProceed
InvalidName

bind_context

public void bind_context(NameComponent[] nc,
                         NamingContext obj)
                  throws NotFound,
                         CannotProceed,
                         InvalidName,
                         AlreadyBound
Bind a context to a name

Specified by:
bind_context in interface NamingContextOperations
Throws:
NotFound
CannotProceed
InvalidName
AlreadyBound

bind_new_context

public NamingContext bind_new_context(NameComponent[] nc)
                               throws NotFound,
                                      CannotProceed,
                                      InvalidName,
                                      AlreadyBound
Specified by:
bind_new_context in interface NamingContextOperations
Throws:
NotFound
CannotProceed
InvalidName
AlreadyBound

destroy

public void destroy()
             throws NotEmpty
Specified by:
destroy in interface NamingContextOperations
Throws:
NotEmpty

how_many

public int how_many()
Returns:
numer of bindings in this context

list

public void list(int how_many,
                 BindingListHolder bl,
                 BindingIteratorHolder bi)
list all bindings

Specified by:
list in interface NamingContextOperations

new_context

public NamingContext new_context()
Specified by:
new_context in interface NamingContextOperations

resolve

public Object resolve(NameComponent[] nc)
               throws NotFound,
                      CannotProceed,
                      InvalidName
resolve a name

Specified by:
resolve in interface NamingContextOperations
Throws:
NotFound
CannotProceed
InvalidName

unbind

public void unbind(NameComponent[] nc)
            throws NotFound,
                   CannotProceed,
                   InvalidName
unbind a name

Specified by:
unbind in interface NamingContextOperations
Throws:
NotFound
CannotProceed
InvalidName

default_POA

public POA default_POA()
POA-related,


init

public static void init(ORB orb,
                        POA rootPoa)
This method needs to be called once to initialize the static fields orb and rootPoa.


to_string

public java.lang.String to_string(NameComponent[] n)
                           throws InvalidName
convert a name into its string representation

Specified by:
to_string in interface NamingContextExtOperations
Throws:
InvalidName

to_name

public NameComponent[] to_name(java.lang.String sn)
                        throws InvalidName
convert a string into name

Specified by:
to_name in interface NamingContextExtOperations
Throws:
InvalidName

to_url

public java.lang.String to_url(java.lang.String addr,
                               java.lang.String sn)
                        throws InvalidAddress,
                               InvalidName
Specified by:
to_url in interface NamingContextExtOperations
Throws:
InvalidAddress
InvalidName

resolve_str

public Object resolve_str(java.lang.String n)
                   throws NotFound,
                          CannotProceed,
                          InvalidName
Specified by:
resolve_str in interface NamingContextExtOperations
Throws:
NotFound
CannotProceed
InvalidName