public class NamingContextImpl extends NamingContextExtPOA implements NamingContextDataStore, Serializable
The operations bind(), rebind(), bind_context() and rebind_context() are all really implemented by doBind(). resolve() is really implemented by doResolve(), unbind() by doUnbind(). list(), new_context() and destroy() uses the NamingContextDataStore interface directly. All the doX() methods are public static. They synchronize on the NamingContextDataStore object.
None of the methods here are Synchronized because These methods will be invoked from Super class's doBind( ), doResolve( ) which are already Synchronized.
Constructor and Description |
---|
NamingContextImpl(ORB orb,
String objKey,
NameService theNameService,
ServantManagerImpl theServantManagerImpl)
Create a naming context servant.
|
Modifier and Type | Method and Description |
---|---|
void |
bind_context(NameComponent[] n,
NamingContext nc)
Bind a NamingContext under a name in this NamingContext.
|
NamingContext |
bind_new_context(NameComponent[] n)
Create a new NamingContext, bind it in this Naming Context and return
its object reference.
|
void |
bind(NameComponent[] n,
Object obj)
Bind an object under a name in this NamingContext.
|
void |
Bind(NameComponent n,
Object obj,
BindingType bt)
Implements all flavors of binding( bind and bindcontext)
This method will be called from the superclass's doBind( ) method
which takes care of all the conditions before calling this method.
|
void |
destroy()
Destroy this NamingContext object.
|
void |
Destroy()
Destroys the NamingContext.
|
static Object |
doResolve(NamingContextDataStore impl,
NameComponent[] n)
Implements resolving names in this NamingContext.
|
static void |
doUnbind(NamingContextDataStore impl,
NameComponent[] n)
Implements unbinding bound names in this NamingContext.
|
POA |
getNSPOA() |
boolean |
IsEmpty()
This is a Debugging Method
|
void |
list(int how_many,
BindingListHolder bl,
BindingIteratorHolder bi)
List the contents of this NamingContest.
|
void |
List(int how_many,
BindingListHolder bl,
BindingIteratorHolder bi)
List the contents of this NamingContext.
|
static String |
nameToString(NameComponent[] name) |
NamingContext |
new_context()
Create a NamingContext object and return its object reference.
|
NamingContext |
NewContext()
Create a NamingContext object and return its object reference.
|
void |
printSize()
This is a Debugging Method
|
void |
rebind_context(NameComponent[] n,
NamingContext nc)
Bind a NamingContext under a name in this NamingContext.
|
void |
rebind(NameComponent[] n,
Object obj)
Bind an object under a name in this NamingContext.
|
Object |
resolve_str(String sn)
This operation resolves the Stringified name into the object
reference.
|
Object |
resolve(NameComponent[] n)
Resolve a name in this NamingContext and return the object reference
bound to the name.
|
Object |
Resolve(NameComponent n,
BindingTypeHolder bth)
This method resolves the NamingContext or Object Reference for one level
The doResolve( ) method calls Resolve( ) recursively to resolve n level
Names.
|
protected static NamingContext |
resolveFirstAsContext(NamingContextDataStore impl,
NameComponent[] n)
Implements resolving a NameComponent in this context and
narrowing it to CosNaming::NamingContext.
|
void |
setORB(ORB theOrb) |
void |
setRootNameService(NameService theNameService) |
void |
setServantManagerImpl(ServantManagerImpl theServantManagerImpl) |
NameComponent[] |
to_name(String sn)
This operation converts a Stringified Name into an equivalent array
of Name Components.
|
String |
to_string(NameComponent[] n)
This operation creates a stringified name from the array of Name
components.
|
String |
to_url(String addr,
String sn)
This operation creates a URL based "iiopname://" format name
from the Stringified Name of the object.
|
Object |
Unbind(NameComponent n)
This method Unbinds the NamingContext or Object Reference for one level
The doUnbind( ) method from superclass calls Unbind() to recursively
Unbind using compound Names.
|
void |
unbind(NameComponent[] n)
Remove a binding from this NamingContext.
|
_all_interfaces, _invoke, _this, _this
_default_POA, _get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
public NamingContextImpl(ORB orb, String objKey, NameService theNameService, ServantManagerImpl theServantManagerImpl) throws Exception
orb
- an ORB object.objKey
- as StringTheNameService
- as NameServiceTheServantManagerImpl
- as ServantManagerImplException
- a Java exception.public void setRootNameService(NameService theNameService)
public void setORB(ORB theOrb)
public void setServantManagerImpl(ServantManagerImpl theServantManagerImpl)
public POA getNSPOA()
getNSPOA
in interface NamingContextDataStore
public void bind(NameComponent[] n, Object obj) throws NotFound, CannotProceed, InvalidName, AlreadyBound
bind
in interface NamingContextOperations
n
- a sequence of NameComponents which is the name under which
the object will be bound.obj
- the object reference to be bound.NotFound
- A name with multiple
components was supplied, but the first component could not be
resolved.CannotProceed
- Could not proceed
in resolving the n-1 components of the supplied name.InvalidName
- The supplied name
is invalid (i.e., has length less than 1).AlreadyBound
- The supplied name
is already bound.SystemException
- One of a fixed set of CORBA system exceptions.doBind
public void bind_context(NameComponent[] n, NamingContext nc) throws NotFound, CannotProceed, InvalidName, AlreadyBound
bind_context
in interface NamingContextOperations
n
- a sequence of NameComponents which is the name under which
the object will be bound.obj
- the NamingContect object reference to be bound.NotFound
- A name with multiple
components was supplied, but the first component could not be
resolved.CannotProceed
- Could not proceed
in resolving the n-1 components of the supplied name.InvalidName
- The supplied name
is invalid (i.e., has length less than 1).AlreadyBound
- An object is
already bound under the supplied name.SystemException
- One of a fixed set of CORBA system exceptions.doBind
public void rebind(NameComponent[] n, Object obj) throws NotFound, CannotProceed, InvalidName
rebind
in interface NamingContextOperations
n
- a sequence of NameComponents which is the name under which
the object will be bound.obj
- the object reference to be bound.NotFound
- A name with multiple
components was supplied, but the first component could not be
resolved.CannotProceed
- Could not proceed
in resolving the n-1 components of the supplied name.InvalidName
- The supplied name
is invalid (i.e., has length less than 1).SystemException
- One of a fixed set of CORBA system exceptions.doBind
public void rebind_context(NameComponent[] n, NamingContext nc) throws NotFound, CannotProceed, InvalidName
rebind_context
in interface NamingContextOperations
n
- a sequence of NameComponents which is the name under which
the object will be bound.obj
- the object reference to be bound.NotFound
- A name with multiple
components was supplied, but the first component could not be
resolved.CannotProceed
- Could not proceed
in resolving the n-1 components of the supplied name.InvalidName
- The supplied name
is invalid (i.e., has length less than 1).SystemException
- One of a fixed set of CORBA system exceptions.doBind
public Object resolve(NameComponent[] n) throws NotFound, CannotProceed, InvalidName
resolve
in interface NamingContextOperations
n
- a sequence of NameComponents which is the name to be resolved.NotFound
- A name with multiple
components was supplied, but the first component could not be
resolved.CannotProceed
- Could not proceed
in resolving the n-1 components of the supplied name.InvalidName
- The supplied name
is invalid (i.e., has length less than 1).SystemException
- One of a fixed set of CORBA system exceptions.doResolve
public void unbind(NameComponent[] n) throws NotFound, CannotProceed, InvalidName
unbind
in interface NamingContextOperations
n
- a sequence of NameComponents which is the name to be unbound.NotFound
- A name with multiple
components was supplied, but the first component could not be
resolved.CannotProceed
- Could not proceed
in resolving the n-1 components of the supplied name.InvalidName
- The supplied name
is invalid (i.e., has length less than 1).SystemException
- One of a fixed set of CORBA system exceptions.doUnbind
public void list(int how_many, BindingListHolder bl, BindingIteratorHolder bi)
list
in interface NamingContextOperations
how_many
- The number of requested bindings in the BindingList.bl
- The BindingList as an out parameter.bi
- The BindingIterator as an out parameter.SystemException
- One of a fixed set of CORBA system exceptions.BindingListHolder
,
BindingIteratorImpl
public NamingContext new_context()
new_context
in interface NamingContextOperations
SystemException
- One of a fixed set of CORBA system exceptions.public NamingContext bind_new_context(NameComponent[] n) throws NotFound, AlreadyBound, CannotProceed, InvalidName
bind_new_context
in interface NamingContextOperations
n
- a sequence of NameComponents which is the name to be unbound.AlreadyBound
- An object is
already bound under the supplied name.NotFound
- A name with multiple
components was supplied, but the first component could not be
resolved.CannotProceed
- Could not proceed
in resolving the n-1 components of the supplied name.InvalidName
- The supplied name
is invalid (i.e., has length less than 1).SystemException
- One of a fixed set of CORBA system exceptions.new_context
,
bind_context
public void destroy() throws NotEmpty
destroy
in interface NamingContextOperations
NotEmpty
- This NamingContext
is not empty (i.e., contains bindings).SystemException
- One of a fixed set of CORBA system exceptions.public static Object doResolve(NamingContextDataStore impl, NameComponent[] n) throws NotFound, CannotProceed, InvalidName
impl
- an implementation of NamingContextDataStoren
- a sequence of NameComponents which is the name to be resolved.NotFound
- A name with multiple
components was supplied, but the first component could not be
resolved.CannotProceed
- Could not proceed
in resolving the first component of the supplied name.InvalidName
- The supplied name
is invalid (i.e., has length less than 1).SystemException
- One of a fixed set of CORBA system exceptions.resolve
public static void doUnbind(NamingContextDataStore impl, NameComponent[] n) throws NotFound, CannotProceed, InvalidName
impl
- an implementation of NamingContextDataStoren
- a sequence of NameComponents which is the name to be unbound.NotFound
- A name with multiple
components was supplied, but the first component could not be
resolved.CannotProceed
- Could not proceed
in resolving the n-1 components of the supplied name.InvalidName
- The supplied name
is invalid (i.e., has length less than 1).SystemException
- One of a fixed set of CORBA system exceptions.resolve
protected static NamingContext resolveFirstAsContext(NamingContextDataStore impl, NameComponent[] n) throws NotFound
impl
- an implementation of NamingContextDataStoren
- a NameComponents which is the name to be found.NotFound
- The
first component could not be resolved.CannotProceed
- Could not proceed
in resolving the first component of the supplied name.SystemException
- One of a fixed set of CORBA system exceptions.resolve
public static String nameToString(NameComponent[] name)
public void Bind(NameComponent n, Object obj, BindingType bt)
Bind
in interface NamingContextDataStore
n
- a sequence of NameComponents which is the name under which
the object will be bound.obj
- the object reference to be bound.bt
- Type of binding (as object or as context).NotFound
- raised
if the NameComoponent list is invalidCannotProceed
- Could not proceed in resolving the Name from the given NameComponentAlreadyBound
- An object
is already bound under the supplied name.SystemException
- One of a fixed set of CORBA
system exceptionsResolve
,
Unbind
public Object Resolve(NameComponent n, BindingTypeHolder bth) throws SystemException
Resolve
in interface NamingContextDataStore
n
- a sequence of NameComponents which is the name to be resolved.bt
- Type of binding (as object or as context).NotFound
- Neither a NamingContext
or a Corba Object reference not found under this NameCannotProceed
- Could not proceed
in resolving the the supplied name.InvalidName
- The supplied name
is invalid (i.e., has length less than 1).SystemException
- One of a fixed set of CORBA system exceptions.Bind
public Object Unbind(NameComponent n) throws SystemException
Unbind
in interface NamingContextDataStore
n
- a sequence of NameComponents which is the name to be resolved.NotFound
- Neither a NamingContext
or a Corba Object reference not found under this NameCannotProceed
- Could not proceed
in resolving the the supplied name.InvalidName
- The supplied name
is invalid (i.e., has length less than 1).SystemException
- One of a fixed set of CORBA system exceptions.Bind
public void List(int how_many, BindingListHolder bl, BindingIteratorHolder bi) throws SystemException
List
in interface NamingContextDataStore
how_many
- The number of requested bindings in the BindingList.bl
- The BindingList as an out parameter.bi
- The BindingIterator as an out parameter.SystemException
- One of a fixed set of CORBA system exceptions.public NamingContext NewContext() throws SystemException
NewContext
in interface NamingContextDataStore
SystemException
- One of a fixed set of CORBA system exceptions.public void Destroy() throws SystemException
Destroy
in interface NamingContextDataStore
SystemException
- One of a fixed set of CORBA system exceptions.public String to_string(NameComponent[] n) throws InvalidName
to_string
in interface NamingContextExtOperations
n
- Name of the object org.omg.CosNaming.NamingContextExtPackage.InvalidName
- Indicates the name does not identify a binding.InvalidName
public NameComponent[] to_name(String sn) throws InvalidName
to_name
in interface NamingContextExtOperations
sn
- Stringified Name of the object org.omg.CosNaming.NamingContextExtPackage.InvalidName
- Indicates the name does not identify a binding.InvalidName
public String to_url(String addr, String sn) throws InvalidAddress, InvalidName
to_url
in interface NamingContextExtOperations
addr
- internet based address of the host machine where
Name Service is running sn
- Stringified Name of the object org.omg.CosNaming.NamingContextExtPackage.InvalidName
- Indicates the name does not identify a binding.org.omg.CosNaming.NamingContextPackage.InvalidAddress
- Indicates the internet based address of the host machine is
incorrect InvalidAddress
InvalidName
public Object resolve_str(String sn) throws NotFound, CannotProceed, InvalidName
resolve_str
in interface NamingContextExtOperations
sn
- Stringified Name of the object NotFound
- Indicates there is no object reference for the given name. CannotProceed
- Indicates that the given compound name is incorrect org.omg.CosNaming.NamingContextExtPackage.InvalidName
- Indicates the name does not identify a binding.InvalidName
public boolean IsEmpty()
IsEmpty
in interface NamingContextDataStore
public void printSize()
Copyright © 2019 JBoss by Red Hat. All rights reserved.