code: public Object getObjectInstance(Object object, Name jndiName, Context context,
        Hashtable<?, ?> environment) throws Exception {  
      Reference resourceRef = null;
      
      if (object instanceof Reference) {
          resourceRef = (Reference) object;
      } else {
        throw new Exception("Object provided is not a javax.naming.Reference type");
      }
      
      // config CassandraHostConfigurator  
      if ( cluster == null ) {
        configure(resourceRef);
      }
  
      return keyspace;
    }
docs: Creates an object using the location or reference information specified.
  
  @param object       The possibly null object containing location or reference information that
  can be used in creating an object.
  @param jndiName     The name of this object relative to nameCtx, or null if no name is
  specified.
  @param context      The context relative to which the name parameter is specified, or null
  if name is relative to the default initial context.
  @param environment  The possibly null environment that is used in creating the object.
  
  @return Object - The object created; null if an object cannot be created.
  
  @exception Exception - if this object factory encountered an exception while attempting
  to create an object, and no other object factories are to be tried.