All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.icthh.xm.commons.tenant.XmJvmSecurityUtils Maven / Gradle / Ivy

There is a newer version: 4.0.20
Show newest version
package com.icthh.xm.commons.tenant;

import java.lang.management.ManagementPermission;

/**
 * The {@link XmJvmSecurityUtils} class.
 */
public final class XmJvmSecurityUtils {

    /**
     * JVM 'control' permission name.
     */
    public static final String PERMISSION_NAME_CONTROL = "control";

    /**
     * If JVM security manager exists then checks JVM security 'control' permission.
     */
    public static void checkSecurity() {
        SecurityManager securityManager = System.getSecurityManager();
        if (securityManager != null) {
            securityManager.checkPermission(new ManagementPermission(PERMISSION_NAME_CONTROL));
        }
    }

    /**
     * Utils constructor.
     */
    private XmJvmSecurityUtils() {
        throw new IllegalAccessError("utils class constructor");
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy