Package java.lang.management

Examples of java.lang.management.ManagementPermission


     * Method to test whether a given user has permission to execute the given method.
     */
    public static void checkSecurity() {
        SecurityManager secMan = System.getSecurityManager();
        if (secMan != null) {
            secMan.checkPermission(new ManagementPermission("control"));
        }
    }
View Full Code Here


        SecurityManager secMan = System.getSecurityManager();
        if (secMan != null) {
            StackTraceElement[] trace = Thread.currentThread().getStackTrace();
            String callingClass = trace[3].getClassName();
            if (!allowedClasses.contains(callingClass)) {
                secMan.checkPermission(new ManagementPermission("control"));
            }
        }
    }/**
 
View Full Code Here

                if (allowedMethods.keySet().contains(callingClass)
                        && allowedMethods.get(callingClass).equals(methodName)) {
                    return;
                }
            }
            secMan.checkPermission(new ManagementPermission("control"));
        }
    }
View Full Code Here

    // Initializes caching manager
        CarbonContextHolder.getCurrentCarbonContextHolder();
        // Need permissions in order to instantiate user core
        SecurityManager secMan = System.getSecurityManager();
        if(secMan != null){
           secMan.checkPermission(new ManagementPermission("control"));
        }
        try {
            RealmService realmService = new DefaultRealmService(bundleContext);
            bundleContext.registerService(RealmService.class.getName(), realmService, null);
            DatabaseUtil.logDatabaseConnections();
View Full Code Here

public class FrameworkRestarter implements Runnable {

    public void run() {
        SecurityManager secMan = System.getSecurityManager();
        if (secMan != null) {
            secMan.checkPermission(new ManagementPermission("control"));
        }

        if (CarbonUtils.isRunningInStandaloneMode()) { // If Carbon is running standalone
            SystemRestarter.restart();
        } else // Carbon is running within an AppServer
View Full Code Here

    @SuppressWarnings("unused")
    protected void activate(ComponentContext context) {
        // Need permissions in order activate Registry
        SecurityManager securityManager = System.getSecurityManager();
        if(securityManager != null){
            securityManager.checkPermission(new ManagementPermission("control"));
        }
        try {
            bundleContext = context.getBundleContext();
            registryService = buildRegistryService();
View Full Code Here

     */
    public void start(BundleContext context) {
        // Need permissions in order to instantiate CarbonServerManager
        SecurityManager secMan = System.getSecurityManager();
        if (secMan != null) {
            secMan.checkPermission(new ManagementPermission("control"));
            new Timer("JavaSecPolicyUpdateTimer").
                    scheduleAtFixedRate(new TimerTask() {
                        public void run() {
                            java.security.Policy.getPolicy().refresh();
                        }
View Full Code Here

     *                   restart should be forced
     */
    private void restart(boolean isGraceful) {
        SecurityManager secMan = System.getSecurityManager();
        if (secMan != null) {
            secMan.checkPermission(new ManagementPermission("control"));
        }
        Runtime.getRuntime().removeShutdownHook(shutdownHook);
        new JMXServerManager().stopJmxService();

        try {
View Full Code Here

     * Forced shutdown
     */
    public void shutdown() {
        SecurityManager secMan = System.getSecurityManager();
        if (secMan != null) {
            secMan.checkPermission(new ManagementPermission("control"));
        }
        log.info("Shutting down " + serverName + "...");
        if (!isShutdownTriggeredByShutdownHook) {
            Runtime.getRuntime().removeShutdownHook(shutdownHook);
        }
View Full Code Here

    public void start(BundleContext context) throws Exception {
        // Need permissions in order to activate Carbon Core
        SecurityManager secMan = System.getSecurityManager();
        if (secMan != null) {
           secMan.checkPermission(new ManagementPermission("control"));
        }
        dataHolder.setBundleContext(context);
        log.info("Starting WSO2 Carbon...");
        log.info("Operating System : " + System.getProperty("os.name") + " " +
                 System.getProperty("os.version") + ", " + System.getProperty("os.arch"));
View Full Code Here

TOP

Related Classes of java.lang.management.ManagementPermission

Copyright © 2018 www.massapicom. 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.