code: @Override
      public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment) throws Exception
      {
          Reference ref = (Reference) obj;
          Object ret = null;
  
          if (ref.getClassName().equals("javax.transaction.UserTransaction")
                  || ref.getClassName().equals("com.impetus.kundera.persistence.jta.KunderaJTAUserTransaction"))
          {
              ret = KunderaJTAUserTransaction.getCurrentTx();
          }
  
          if (ret == null)
          {
              ret = new KunderaJTAUserTransaction();
          }
          return ret;
  
      }
docs: Returns reference to userTransaction object.
  
  @see javax.naming.spi.ObjectFactory