org.jboss.portal.jems.as
Class JNDI.Binding

java.lang.Object
  extended by org.jboss.portal.jems.as.JNDI.Binding
Enclosing class:
JNDI

public static class JNDI.Binding
extends java.lang.Object

Encapsulate JNDI binding operation into one single class, hidding non usefull JNDI complexity. It has been designed to fit with service life cycle.

private String jndiName; private JNDI.Binding jndiBinding;

public void startService() throws Exception { ... if (this.jndiName != null) { jndiBinding = new JNDI.Binding(jndiName, this); jndiBinding.bind(); } ... }

public void stopService() throws Exception { ... if (jndiBinding != null) { jndiBinding.unbind(); jndiBinding = null; } ... }


Constructor Summary
JNDI.Binding(java.lang.String jndiName, java.lang.Object o)
           
 
Method Summary
 void bind()
          Attempt to perform binding.
 void unbind()
          Unbinds in a safe manner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JNDI.Binding

public JNDI.Binding(java.lang.String jndiName,
                    java.lang.Object o)
Method Detail

bind

public void bind()
          throws javax.naming.NamingException
Attempt to perform binding.

Throws:
javax.naming.NamingException - on failure

unbind

public void unbind()
Unbinds in a safe manner.