Examples of ManagementPermission


Examples of java.lang.management.ManagementPermission

        assertFalse(mp1.implies(mp2));
        assertFalse(mp2.implies(mp1));
    }

    public void testGetActions() {
        ManagementPermission mp1 = new ManagementPermission("monitor");
        assertEquals("", mp1.getActions());

        mp1 = new ManagementPermission("control", null);
        assertEquals("", mp1.getActions());
    }
View Full Code Here

Examples of java.lang.management.ManagementPermission

     * @see java.lang.management.MemoryPoolMXBean#resetPeakUsage()
     */
    public void resetPeakUsage() {
        SecurityManager security = System.getSecurityManager();
        if (security != null) {
            security.checkPermission(new ManagementPermission("control"));
        }
        this.resetPeakUsageImpl();
    }
View Full Code Here

Examples of java.lang.management.ManagementPermission

                    "VM does not support collection usage threshold.");
        }

        SecurityManager security = System.getSecurityManager();
        if (security != null) {
            security.checkPermission(new ManagementPermission("control"));
        }

        if (threshold < 0) {
            throw new IllegalArgumentException(
                    "Collection usage threshold cannot be negative.");
View Full Code Here

Examples of java.lang.management.ManagementPermission

                    "VM does not support usage threshold.");
        }

        SecurityManager security = System.getSecurityManager();
        if (security != null) {
            security.checkPermission(new ManagementPermission("control"));
        }

        if (threshold < 0) {
            throw new IllegalArgumentException(
                    "Usage threshold cannot be negative.");
View Full Code Here

Examples of java.lang.management.ManagementPermission

     * @see java.lang.management.MemoryMXBean#setVerbose(boolean)
     */
    public void setVerbose(boolean value) {
        SecurityManager security = System.getSecurityManager();
        if (security != null) {
            security.checkPermission(new ManagementPermission("control"));
        }
        this.setVerboseImpl(value);
    }
View Full Code Here

Examples of java.lang.management.ManagementPermission

          "VM does not support boot classpath.");
    }

    SecurityManager security = System.getSecurityManager();
    if (security != null) {
      security.checkPermission(new ManagementPermission("monitor"));
    }

    return AccessController.doPrivileged(new PrivilegedAction<String>() {
      public String run() {
        return System.getProperty("sun.boot.class.path");
View Full Code Here

Examples of java.lang.management.ManagementPermission

   * @see java.lang.management.RuntimeMXBean#getInputArguments()
   */
  public List<String> getInputArguments() {
    SecurityManager security = System.getSecurityManager();
    if (security != null) {
      security.checkPermission(new ManagementPermission("monitor"));
    }
       
        // TODO : Retrieve the input args from the VM
        return new ArrayList<String>();
  }
View Full Code Here

Examples of java.lang.management.ManagementPermission

     * @see java.lang.management.ClassLoadingMXBean#setVerbose(boolean)
     */
    public void setVerbose(boolean value) {
        SecurityManager security = System.getSecurityManager();
        if (security != null) {
            security.checkPermission(new ManagementPermission("control"));
        }
        this.setVerboseImpl(value);
    }
View Full Code Here

Examples of java.lang.management.ManagementPermission

     * @see java.lang.management.ThreadMXBean#findMonitorDeadlockedThreads()
     */
    public long[] findMonitorDeadlockedThreads() {
        SecurityManager security = System.getSecurityManager();
        if (security != null) {
            security.checkPermission(new ManagementPermission("monitor"));
        }
        return this.findMonitorDeadlockedThreadsImpl();
    }
View Full Code Here

Examples of java.lang.management.ManagementPermission

     * @see java.lang.management.ThreadMXBean#getAllThreadIds()
     */
    public long[] getAllThreadIds() {
        SecurityManager security = System.getSecurityManager();
        if (security != null) {
            security.checkPermission(new ManagementPermission("monitor"));
        }
        return this.getAllThreadIdsImpl();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.