code: @Override
      public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {
          if (obj instanceof Reference) {
              try {
                  String jndiName = nameCtx == null ? "" : nameCtx.getNameInNamespace();
                  jndiName += name == null ? "" : name.toString();
                  String urlValue = (String) ((Reference) obj).get(0).getContent();
                  return createURL(jndiName, urlValue);
              } catch (Throwable t) {
                  NamingException ne = new NamingException();
                  ne.initCause(t);
                  throw ne;
              }
          }
  
          return null;
      }
docs: /*
  (non-Javadoc)
  
  @see javax.naming.spi.ObjectFactory#getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable)