code: private Client discoverClient(String persistenceUnit)
      {
          if (logger.isInfoEnabled())
          {
              logger.info("Returning client instance for persistence unit {}.", persistenceUnit);
          }
  
          ClientFactory clientFactory = ((EntityManagerFactoryImpl) getEntityManagerFactory())
                  .getClientFactory(persistenceUnit);
          if (clientFactory != null)
          {
              return clientFactory.getClientInstance();
          }
          throw new ClientResolverException("No client configured for persistence unit " + persistenceUnit + ".");
      }
docs: Gets the client.
  
  @param persistenceUnit
  the persistence unit
  @return the client