/** * Obtain an Generic policy client instance. * @param conf Configuration that should be used. Configuration is only used for the * initial creation and ignored afterwords. */ public static SentryGenericServiceClient create(Configuration conf) throws Exception { SentryGenericServiceClientFactory factory = clientFactory.get(); if (factory != null) { return factory.create(); } factory = new SentryGenericServiceClientFactory(conf); boolean ok = clientFactory.compareAndSet(null, factory); if (ok) { return factory.create(); } factory.close(); return clientFactory.get().create(); }