KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > modules > input > SystemPropertyModule


1 /*
2 * Copyright 1999-2005 The Apache Software Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */

16 package org.apache.cocoon.components.modules.input;
17
18 import org.apache.avalon.framework.configuration.Configuration;
19 import org.apache.avalon.framework.thread.ThreadSafe;
20
21 import java.util.Map JavaDoc;
22
23 /**
24  * SystemPropertyModule is an JXPath based InputModule implementation that
25  * provides access to system properties.
26  * Available system properties are defined by Java's <a
27  * HREF="http://java.sun.com/j2se/1.4.1/docs/api/java/lang/System.html#getProperties()">System.getProperties()</a>.
28  *
29  * JXPath allows to apply XPath functions to system properties.
30  *
31  * <p>If there is a security manager, its <code>checkPropertiesAccess</code>
32  * method is called with no arguments. This may result in a security exception
33  * which is wrapped into a configuration exception and re-thrown.</p>
34  *
35  * @author Konstantin Piroumian
36  * @version $Id: SystemPropertyModule.java 169479 2005-05-10 14:27:45Z vgritsenko $
37  */

38 public class SystemPropertyModule extends AbstractJXPathModule
39                                   implements ThreadSafe {
40
41     /**
42      * @throws SecurityException if access is denied
43      */

44     protected Object JavaDoc getContextObject(Configuration modeConf,
45                                       Map JavaDoc objectModel) {
46         return System.getProperties();
47     }
48 }
49
Popular Tags