|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.gxos.gndi.context.GxContext
GNDI provider class.
$Id: GxContext.java,v 1.19 2001/05/02 17:58:08 balsoy Exp $
Field Summary | |
static java.lang.String |
SELF
Name defining collection objects themselves i.e. |
Fields inherited from interface javax.naming.Context |
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 |
Constructor Summary | |
GxContext(java.util.Hashtable environment)
GNDI context constructor. |
|
GxContext(java.lang.String name,
javax.naming.Context ctx,
java.util.Hashtable environment)
GNDI context constructor. |
Method Summary | |
java.lang.Object |
addToEnvironment(java.lang.String propName,
java.lang.Object propVal)
Adds a new environment property to the environment of this context. |
void |
bind(javax.naming.Name name,
java.lang.Object obj)
Binds an object with a given name. |
void |
bind(java.lang.String name,
java.lang.Object obj)
Binds an object with a given name. |
void |
close()
Closes this context. |
javax.naming.Name |
composeName(javax.naming.Name name,
javax.naming.Name prefix)
|
java.lang.String |
composeName(java.lang.String name,
java.lang.String prefix)
|
protected javax.naming.Context |
createContext(java.lang.String name)
|
javax.naming.Context |
createSubcontext(javax.naming.Name name)
|
javax.naming.Context |
createSubcontext(javax.naming.Name name,
TreeObject gxchild)
|
javax.naming.Context |
createSubcontext(java.lang.String name)
|
javax.naming.Context |
createSubcontext(java.lang.String name,
TreeObject gxchild)
|
javax.naming.Context |
createSubcontext(TreeObject gxchild)
|
void |
destroySubcontext(javax.naming.Name name)
Destroys a sub context under this context. |
void |
destroySubcontext(java.lang.String name)
Destroys a sub context under this context. |
java.util.Hashtable |
getEnvironment()
Retrieves the environment in effect for this context. |
protected javax.naming.Context |
getFSContext()
Returns the pointer to the sub JNDI provider this context uses. |
javax.naming.Name |
getGxosName()
Retrieves the full GXOS name of this context within its GXOS namespace. |
protected TreeObject |
getGxosObject()
Returns the GXOS object for this context. |
java.lang.String |
getNameInNamespace()
Retrieves the full GXOS name of this context within its GXOS namespace. |
javax.naming.NameParser |
getNameParser(javax.naming.Name name)
|
javax.naming.NameParser |
getNameParser(java.lang.String name)
|
java.lang.Object |
getObject()
|
protected java.lang.Object |
getObject(java.io.File x)
|
protected javax.naming.Name |
getPrefix(javax.naming.Name name)
|
protected java.io.File |
getXMLFile()
Returns the file object which holds the XML content of this context. |
protected void |
init(java.util.Hashtable environment)
Initializes sub JNDI provider; sets GXOS name to its initial value; creates a hashtable for child objects and contexts. |
javax.naming.NamingEnumeration |
list(javax.naming.Name name)
|
javax.naming.NamingEnumeration |
list(java.lang.String name)
|
javax.naming.NamingEnumeration |
listBindings(javax.naming.Name name)
|
javax.naming.NamingEnumeration |
listBindings(java.lang.String name)
|
java.lang.Object |
lookup(javax.naming.Name name)
Returns the object corresponding to the given name. |
java.lang.Object |
lookup(java.lang.String name)
Returns the object corresponding to the given name. |
java.lang.Object |
lookupLink(javax.naming.Name name)
|
java.lang.Object |
lookupLink(java.lang.String name)
|
void |
rebind(javax.naming.Name name,
java.lang.Object obj)
|
void |
rebind(java.lang.String name,
java.lang.Object obj)
|
java.lang.Object |
removeFromEnvironment(java.lang.String propName)
Removes an environment property from the environment of this context. |
void |
rename(javax.naming.Name oldname,
javax.naming.Name newname)
|
void |
rename(java.lang.String oldname,
java.lang.String newname)
|
void |
report(TreeObject t)
|
protected void |
setGxosName(javax.naming.Name name)
Sets this context's GXOS name to a new value. |
protected void |
setGxosName(java.lang.String name)
Sets this context's GXOS name to a new value. |
protected java.lang.String |
translateName(java.lang.String gxosURL)
Translates a GXOS name to sub JNDI name, i.e. |
void |
unbind(javax.naming.Name name)
|
void |
unbind(java.lang.String name)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String SELF
Constructor Detail |
public GxContext(java.util.Hashtable environment) throws javax.naming.NamingException
environment
- Environment settings. Could be system properties
as well as user defined variables.javax.naming.NamingException
- if a naming error is encountered.GxContext(String,Context,Hashtable)
public GxContext(java.lang.String name, javax.naming.Context ctx, java.util.Hashtable environment) throws javax.naming.NamingException
name
- Name of the context to be created.ctx
- Parent context of this context.environment
- Environment settings. Could be system properties
as well as user defined variables.javax.naming.NamingException
- if a naming error is encountered.GxContext(Hashtable)
Method Detail |
protected void init(java.util.Hashtable environment) throws javax.naming.NamingException
javax.naming.NamingException
- if a naming error is encountered.protected javax.naming.Context createContext(java.lang.String name) throws javax.naming.NamingException
protected TreeObject getGxosObject() throws javax.naming.NamingException
javax.naming.NamingException
- if a naming error is encountered.protected java.lang.String translateName(java.lang.String gxosURL) throws javax.naming.NamingException
gxosURL
- GXOS name to be converted.javax.naming.NamingException
- if a naming error is encountered.protected java.io.File getXMLFile()
protected javax.naming.Context getFSContext()
protected void setGxosName(java.lang.String name) throws javax.naming.NamingException
String
name and calls setGxosName(Name)
.name
- new name for this context.NamingExpception
- if a naming error is encountered.setGxosName(Name)
protected void setGxosName(javax.naming.Name name) throws javax.naming.NamingException
Name
-type name.
Name should either start with Defaults.GXOS_ROOT_PREFIX
or be a relative name, i.e. name1/name2/name3, etc.
name
- new name for this context.NamingExpception
- if a naming error is encountered
such as empty names.setGxosName(String)
public javax.naming.Context createSubcontext(javax.naming.Name name) throws javax.naming.NamingException
createSubcontext
in interface javax.naming.Context
public javax.naming.Context createSubcontext(TreeObject gxchild) throws javax.naming.NamingException
public javax.naming.Context createSubcontext(java.lang.String name, TreeObject gxchild) throws javax.naming.NamingException
public javax.naming.Context createSubcontext(java.lang.String name) throws javax.naming.NamingException
createSubcontext
in interface javax.naming.Context
public javax.naming.Context createSubcontext(javax.naming.Name name, TreeObject gxchild) throws javax.naming.NamingException
protected java.lang.Object getObject(java.io.File x)
public java.lang.Object getObject()
public java.lang.Object lookup(javax.naming.Name name) throws javax.naming.NamingException
javax.naming.Name
.lookup
in interface javax.naming.Context
name
- Associated name of the object which is searched for.NameNotFoundException
- if the given name is not bound to
an object or a sub context.javax.naming.NamingException
- if there is any other problem.lookup(String)
public java.lang.Object lookup(java.lang.String name) throws javax.naming.NamingException
java.lang.String
.lookup
in interface javax.naming.Context
name
- Associated name of the object which is searched for.NameNotFoundException
- if the given name is not bound to
an object or a sub context.javax.naming.NamingException
- if there is any other problem.lookup(Name)
public void bind(java.lang.String name, java.lang.Object obj) throws javax.naming.NamingException
javax.naming.String
. See bind(String,Object)
.bind
in interface javax.naming.Context
name
- A binding name to the object to retrieve at a later time.obj
- Object which is to be bound to the given name.javax.naming.InvalidNameException
- if the given name is null
or empty string.OperationNotSupported
- if the object is not a descendent of TreeObject.NameAlreadyBoundException
- if the name is already bound to another object.javax.naming.NamingException
- if there is any other problem.bind(Name,Object)
,
TreeObject
public void bind(javax.naming.Name name, java.lang.Object obj) throws javax.naming.NamingException
javax.naming.Name
.bind
in interface javax.naming.Context
name
- A binding name to the object to retrieve at a later time.obj
- Object which is to be bound to the given name.javax.naming.InvalidNameException
- if the given name is null
or empty string.OperationNotSupported
- if the object is not a descendent of TreeObject.NameAlreadyBoundException
- if the name is already bound to another object.javax.naming.NamingException
- if there is any other problem.bind(String,Object)
,
TreeObject
public void rebind(java.lang.String name, java.lang.Object obj) throws javax.naming.NamingException
rebind
in interface javax.naming.Context
public void rebind(javax.naming.Name name, java.lang.Object obj) throws javax.naming.NamingException
rebind
in interface javax.naming.Context
protected javax.naming.Name getPrefix(javax.naming.Name name) throws javax.naming.NamingException
public void unbind(java.lang.String name) throws javax.naming.NamingException
unbind
in interface javax.naming.Context
public void unbind(javax.naming.Name name) throws javax.naming.NamingException
unbind
in interface javax.naming.Context
public void rename(java.lang.String oldname, java.lang.String newname) throws javax.naming.NamingException
rename
in interface javax.naming.Context
public void rename(javax.naming.Name oldname, javax.naming.Name newname) throws javax.naming.NamingException
rename
in interface javax.naming.Context
public javax.naming.NamingEnumeration list(java.lang.String name) throws javax.naming.NamingException
list
in interface javax.naming.Context
public javax.naming.NamingEnumeration list(javax.naming.Name name) throws javax.naming.NamingException
list
in interface javax.naming.Context
public javax.naming.NamingEnumeration listBindings(java.lang.String name) throws javax.naming.NamingException
listBindings
in interface javax.naming.Context
public javax.naming.NamingEnumeration listBindings(javax.naming.Name name) throws javax.naming.NamingException
listBindings
in interface javax.naming.Context
public void destroySubcontext(java.lang.String name) throws javax.naming.NamingException
destroySubcontext(Name)
.destroySubcontext
in interface javax.naming.Context
name
- name of the subcontext to be destroyed.javax.naming.NamingException
- if a naming error is encountered.public void destroySubcontext(javax.naming.Name name) throws javax.naming.NamingException
destroySubcontext
in interface javax.naming.Context
name
- name of the subcontext to be destroyed.CannotProceedException
- if the sub context does not belong to
this context.javax.naming.NamingException
- if this context is not empty, or
another naming error is encountered.destroySubcontext(String)
public java.lang.Object lookupLink(java.lang.String name) throws javax.naming.NamingException
lookupLink
in interface javax.naming.Context
public java.lang.Object lookupLink(javax.naming.Name name) throws javax.naming.NamingException
lookupLink
in interface javax.naming.Context
public javax.naming.NameParser getNameParser(java.lang.String name) throws javax.naming.NamingException
getNameParser
in interface javax.naming.Context
public javax.naming.NameParser getNameParser(javax.naming.Name name) throws javax.naming.NamingException
getNameParser
in interface javax.naming.Context
public java.lang.String composeName(java.lang.String name, java.lang.String prefix) throws javax.naming.NamingException
composeName
in interface javax.naming.Context
public javax.naming.Name composeName(javax.naming.Name name, javax.naming.Name prefix) throws javax.naming.NamingException
composeName
in interface javax.naming.Context
public java.lang.Object addToEnvironment(java.lang.String propName, java.lang.Object propVal) throws javax.naming.NamingException
addToEnvironment
in interface javax.naming.Context
propName
- the name of the environment property to add; may not be nullpropVal
- the value of the property to add; may not be nulljavax.naming.NamingException
- if a naming exception is encounteredgetEnvironment()
,
removeFromEnvironment(String)
public java.lang.Object removeFromEnvironment(java.lang.String propName) throws javax.naming.NamingException
removeFromEnvironment
in interface javax.naming.Context
propName
- the name of the environment property to remove; may not be nulljavax.naming.NamingException
- if a naming exception is encounteredgetEnvironment()
,
addToEnvironment(String, Object)
public java.util.Hashtable getEnvironment() throws javax.naming.NamingException
Retrieves the environment in effect for this context.
The caller should not make any changes to the object returned: their effect on the context is undefined. The environment of this context may be changed using addToEnvironment() and removeFromEnvironment().getEnvironment
in interface javax.naming.Context
javax.naming.NamingException
- if a naming exception is encounteredaddToEnvironment(String, Object)
,
removeFromEnvironment(String)
public javax.naming.Name getGxosName()
Name
.getNameInNamespace()
public java.lang.String getNameInNamespace() throws javax.naming.NamingException
getNameInNamespace
in interface javax.naming.Context
String
.javax.naming.NamingException
- - if a naming exception is encountered.getGxosName()
public void close() throws javax.naming.NamingException
This method is idempotent: invoking it on a context that has already been closed has no effect. Invoking any other method on a closed context is not allowed, and results in undefined behaviour.
close
in interface javax.naming.Context
javax.naming.NamingException
- if a naming exception is encountered.public void report(TreeObject t)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |