gnu.javax.naming.giop
Class GiopNamingServiceURLContext
- Context
The context to represent the corba naming service. Being the naming service,
the returned context supports creating the subcontexts, forwarding this task
to the existing naming service. When listing bindings, it uses the
Context.BATCHSIZE
property to determine, how many bindings should
be returned at once (the process is transparend)
int | DEFAULT_BATCH_SIZE - This number of bindings will be requested from the naming server at once,
while the subsequent bindings will be requested via binding iterator one by
one.
|
int | howMany - The batch size for list operations - how many to return at once.
|
APPLET , AUTHORITATIVE , BATCHSIZE , DNS_URL , INITIAL_CONTEXT_FACTORY , LANGUAGE , OBJECT_FACTORIES , PROVIDER_URL , REFERRAL , SECURITY_AUTHENTICATION , SECURITY_CREDENTIALS , SECURITY_PRINCIPAL , SECURITY_PROTOCOL , STATE_FACTORIES , URL_PKG_PREFIXES |
Object | addToEnvironment(String key, Object value) - Add new environment property to the environment of this context.
|
void | bind(String name, Object obj) - Give the specified name for the specified object.
|
void | bind(Name name, Object obj) - Give the specified name for the specified object.
|
void | close() - Releases all resources, associated with this context.
|
String | composeName(String name1, String name2) - Not supported
|
Name | composeName(Name name, Name prefix) - Not supported.
|
Context | createSubcontext(String subContext) - Creates the new naming subcontext and binds it to the current (this)
context.
|
Context | createSubcontext(Name subContext) - Creates the new naming subcontext and binds it to the current (this)
context.
|
void | destroySubcontext(String subContext) - Removes the naming subcontext from this naming context.
|
void | destroySubcontext(Name subContext) - Removes the naming subcontext from this naming context.
|
int | getBatchSize() - Get the batch size from the environment properties.
|
Hashtable<K,V> | getEnvironment() - Returns the environment, associated with this naming context.
|
String | getNameInNamespace() - Returs the empty string.
|
NameParser | getNameParser(String name) - Not supported.
|
NameParser | getNameParser(Name name) - Not supported.
|
NamingContextExt | getService(String address)
|
NamingEnumeration<T> | list(String name) - Creates and returns the enumeration over the name bindings that are present
the given subcontext.
|
NamingEnumeration<T> | list(Name name) - Creates and returns the enumeration over the name bindings that are present
the given subcontext.
|
NamingEnumeration<T> | listBindings(String name) - Creates and returns the enumeration over the name - object bindings that
are present the given subcontext.
|
NamingEnumeration<T> | listBindings(Name name) - Creates and returns the enumeration over the name - object bindings that
are present the given subcontext.
|
Object | lookup(String name) - Gets the previously named object by name.
|
Object | lookup(Name name) - Gets the previously named object by name.
|
Object | lookupLink(String name) - Not supported.
|
Object | lookupLink(Name name) - Not supported.
|
void | rebind(String name, Object obj) - Give the specified name for the specified object.
|
void | rebind(Name name, Object obj) - Give the specified name for the specified object.
|
Object | removeFromEnvironment(String propName) - Removes the property with the given name from the environment.
|
void | rename(String oldName, String newName) - Renames the existing binding, removing the existing and giving the new name
for the same object.
|
void | rename(Name oldName, Name newName) - Renames the existing binding, removing the existing and giving the new name
for the same object.
|
String[] | split(String corbaloc) - Split the corbaname name into the address of the naming service (first
part) and the name of the object in the naming service (second part)
|
NameComponent[] | toGiop(Name name) - Convert the
Name into array of the name components, required to the
CORBA naming service.
|
void | unbind(String name) - Removes the name - object mapping from the current context.
|
void | unbind(Name name) - Removes the name - object mapping from the current context.
|
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
DEFAULT_BATCH_SIZE
public int DEFAULT_BATCH_SIZE
This number of bindings will be requested from the naming server at once,
while the subsequent bindings will be requested via binding iterator one by
one. Use
Context.BATCHSIZE
to override the value of this constant.
howMany
public final int howMany
The batch size for list operations - how many to return at once.
GiopNamingServiceURLContext
public GiopNamingServiceURLContext(Hashtable<K,V> props,
GiopNamingServiceFactory aFactory,
ORB anOrb)
Creates a new naming context that uses naming service, represented by the
given CORBA object.
props
- the environment table.aFactory
- parent factory. This reference is used during cleanup.anOrb
- the associated ORB. This reference is used during cleanup.
addToEnvironment
public Object addToEnvironment(String key,
Object value)
throws NamingException
Add new environment property to the environment of this context. Both name
and value of the new property must not be null. If the property is already
defined, is current value is replaced by the propVal.
- addToEnvironment in interface Context
key
- the name of the new propertyvalue
- the value of the new property
- the previous value of this property or null if the property has not
been previously defined
bind
public void bind(String name,
Object obj)
throws NamingException
Give the specified name for the specified object. The passed name must not
be already bound to some other object.
- bind in interface Context
name
- the name that will be given to the object (in the scope of this
context).obj
- the object being named.
bind
public void bind(Name name,
Object obj)
throws NamingException
Give the specified name for the specified object. The passed name must not
be already bound to some other object. The components of the name are
mapped into the components of the CORBA name.
- bind in interface Context
name
- the name that will be given to the object (in the scope of this
context).obj
- the object being named.
close
public void close()
throws NamingException
Releases all resources, associated with this context. The close() method
can be called several times, but after it has been once invoked, it is not
allowed to call any other method of this context. This method destroys
the ORB, if we have one.
- close in interface Context
createSubcontext
public Context createSubcontext(String subContext)
throws NamingException
Creates the new naming subcontext and binds it to the current (this)
context. The returned object will wrap around the newly created CORBA
subcontext
- createSubcontext in interface Context
subContext
- the name of the new context being created
- the newly created context, bound to the instance of the context on
that the method has been called
createSubcontext
public Context createSubcontext(Name subContext)
throws NamingException
Creates the new naming subcontext and binds it to the current (this)
context. The returned object will wrap around the newly created CORBA
subcontext
- createSubcontext in interface Context
subContext
- the name of the new context being created
- the newly created context, bound to the instance of the context on
that the method has been called
destroySubcontext
public void destroySubcontext(String subContext)
throws NamingException
Removes the naming subcontext from this naming context. Returns without
action if such subcontext does not exist. The context being destroyed must
be empty.
- destroySubcontext in interface Context
subContext
- the name of the subcontext beig removed.
destroySubcontext
public void destroySubcontext(Name subContext)
throws NamingException
Removes the naming subcontext from this naming context. Returns without
action if such subcontext does not exist. The context being destroyed must
be empty.
- destroySubcontext in interface Context
subContext
- the name of the subcontext beig removed.
getBatchSize
public int getBatchSize()
Get the batch size from the environment properties. The batch size is used
for listing operations.
- the batch size, or some default value if not specified.
list
public NamingEnumeration<T> list(String name)
throws NamingException
Creates and returns the enumeration over the name bindings that are present
the given subcontext. The enumeration elements have the type of
NameClassPair
, providing also information about the class of the
bound object. The behaviour in the case if the bindings are added or
removed later is not defined. The contents of the subcontexts are not
included.
- list in interface Context
name
- the name of the subcontext
- the enumeration over the names, known for the given subcontext.
list
public NamingEnumeration<T> list(Name name)
throws NamingException
Creates and returns the enumeration over the name bindings that are present
the given subcontext. The enumeration elements have the type of
NameClassPair
, providing also information about the class of the
bound object. The behaviour in the case if the bindings are added or
removed later is not defined. The contents of the subcontexts are not
included.
- list in interface Context
name
- the name of the subcontext
- the enumeration over the names, known for the given subcontext.
listBindings
public NamingEnumeration<T> listBindings(String name)
throws NamingException
Creates and returns the enumeration over the name - object bindings that
are present the given subcontext. The enumeration elements have the type of
Binding
, providing also information about the class of the bound
object. The behaviour in the case if the bindings are added or removed
later is not defined. The contents of the subcontexts are not included.
- listBindings in interface Context
name
- the name of the subcontext
- the enumeration over the names, known for the given subcontext.
listBindings
public NamingEnumeration<T> listBindings(Name name)
throws NamingException
Creates and returns the enumeration over the name - object bindings that
are present the given subcontext. The enumeration elements have the type of
Binding
, providing also information about the class of the bound
object. The behaviour in the case if the bindings are added or removed
later is not defined. The contents of the subcontexts are not included.
- listBindings in interface Context
name
- the name of the subcontext
- the enumeration over the names, known for the given subcontext.
lookup
public Object lookup(String name)
throws NamingException
Gets the previously named object by name. If the passed name is empty, the
method should return a cloned instance of this naming context.
- lookup in interface Context
name
- the name of the object being searched in this context
lookup
public Object lookup(Name name)
throws NamingException
Gets the previously named object by name. If the passed name is empty, the
method should return a cloned instance of this naming context.
- lookup in interface Context
name
- the name of the object being searched in this context
rebind
public void rebind(String name,
Object obj)
throws NamingException
Give the specified name for the specified object. Unlike bind, this method
silently replaces the existing binding for this name, if one exists.
- rebind in interface Context
name
- the name that will be given to the object (in the scope of this
context).obj
- the object being named.
rebind
public void rebind(Name name,
Object obj)
throws NamingException
Give the specified name for the specified object. Unlike bind, this method
silently replaces the existing binding for this name, if one exists.
- rebind in interface Context
name
- the name that will be given to the object (in the scope of this
context).obj
- the object being named.
removeFromEnvironment
public Object removeFromEnvironment(String propName)
throws NamingException
Removes the property with the given name from the environment. Returns
without action if this property is not defined.
- removeFromEnvironment in interface Context
propName
- the name of the property being removed.
- the value of the property that has been removed or null if the
property was not defined.
rename
public void rename(String oldName,
String newName)
throws NamingException
Renames the existing binding, removing the existing and giving the new name
for the same object.
- rename in interface Context
oldName
- the existing name of the known objectnewName
- the new name of the same object
rename
public void rename(Name oldName,
Name newName)
throws NamingException
Renames the existing binding, removing the existing and giving the new name
for the same object.
- rename in interface Context
oldName
- the existing name of the known objectnewName
- the new name of the same object
split
public String[] split(String corbaloc)
throws InvalidNameException
Split the corbaname name into the address of the naming service (first
part) and the name of the object in the naming service (second part)
toGiop
public NameComponent[] toGiop(Name name)
throws InvalidName
Convert the
Name
into array of the name components, required to the
CORBA naming service. First the string representation is obtained, then
it is converted using parsing rules of the CORBA name.
name
- then name to convert
- the converted array of components.
unbind
public void unbind(String name)
throws NamingException
Removes the name - object mapping from the current context. This method
returns without action if the name is not bound to an object in the
terminal context, but throws
NameNotFoundException
if one of the
intermadiate contexts does not exist.
- unbind in interface Context
name
- the name to be removed
unbind
public void unbind(Name name)
throws NamingException
Removes the name - object mapping from the current context. This method
returns without action if the name is not bound to an object in the
terminal context, but throws
NameNotFoundException
if one of the
intermadiate contexts does not exist.
- unbind in interface Context
name
- the name to be removed
GiopNamingServiceURLContext.java -- handles corbaname: urls
Copyright (C) 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.