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. package com.sun.jmx.mbeanserver;
  8. import java.security.PrivilegedAction;
  9. /**
  10. * Utility class to be used by the method <tt>AccessControler.doPrivileged</tt>
  11. * to get a system property.
  12. *
  13. * @since 1.5
  14. */
  15. public class GetPropertyAction implements PrivilegedAction {
  16. private final String key;
  17. public GetPropertyAction(String key) {
  18. this.key = key;
  19. }
  20. public Object run() {
  21. return System.getProperty(key);
  22. }
  23. }