KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > mbeanserver > GetPropertyAction


1 /*
2  * @(#)GetPropertyAction.java 1.8 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.jmx.mbeanserver;
9
10 import java.security.PrivilegedAction JavaDoc;
11
12 /**
13  * Utility class to be used by the method <tt>AccessControler.doPrivileged</tt>
14  * to get a system property.
15  *
16  * @since 1.5
17  */

18 public class GetPropertyAction implements PrivilegedAction JavaDoc {
19     private final String JavaDoc key;
20
21     public GetPropertyAction(String JavaDoc key) {
22     this.key = key;
23     }
24
25     public Object JavaDoc run() {
26     return System.getProperty(key);
27     }
28 }
29
Popular Tags