com.arjuna.webservices11.util.PrivilegedServiceRegistryFactory Maven / Gradle / Ivy
The newest version!
/*
Copyright The Narayana Authors
SPDX-License-Identifier: Apache-2.0
*/
package com.arjuna.webservices11.util;
import com.arjuna.webservices11.ServiceRegistry;
import java.security.AccessController;
/**
* @author Gytis Trikleris
*/
public class PrivilegedServiceRegistryFactory {
private static final PrivilegedServiceRegistryFactory INSTANCE = new PrivilegedServiceRegistryFactory();
private PrivilegedServiceRegistryFactory() {
}
public static PrivilegedServiceRegistryFactory getInstance() {
return INSTANCE;
}
public ServiceRegistry getServiceRegistry() {
final ServiceRegistryAction serviceRegistryAction = ServiceRegistryAction.getInstance();
if (System.getSecurityManager() == null) {
return serviceRegistryAction.run();
}
return AccessController.doPrivileged(serviceRegistryAction);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy