View RSS Feed


Binding JNDI Objects

Rate this Entry
by , 07-07-2012 at 04:17 PM (619 Views)
Subordinates of Context are stored as Binding objects set. Binding is basically an association present b/w objects and name. Hence it has already been observed that Binding objects hold its name, object and its class. A newer Binding could be added to Context along with thebind() method. E.g, Addition of binding could be done to already existing Context as following:

Java Code: newfile ="c:\temp\newfile");
tempContext.bind("newfile", newfile);
Now if at this context list() is being called we will be observing a new child, named as newfile. As it has already been discussed, you shall drop down JNDI, so that a new file could be created by the help of Sun filesystem provider. For creation of a file constructor is used that is not JNDI part. Hence file could be binded into naming system by using Context bind()method.

When name and object are bound, and already name is in use then a NameAlreadyBoundException is being thrown by the method. If a new object is required to bound to some already existing name then rebind() method shall be used. An unbind() method is also present in Context that is used for removal of a binding.

Submit "Binding JNDI Objects" to Facebook Submit "Binding JNDI Objects" to Digg Submit "Binding JNDI Objects" to Submit "Binding JNDI Objects" to StumbleUpon Submit "Binding JNDI Objects" to Google