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; 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 { 19 private final String key; 20 21 public GetPropertyAction(String key) { 22 this.key = key; 23 } 24 25 public Object run() { 26 return System.getProperty(key); 27 } 28 } 29